in reply to Re: Why is $. not zero-based?
in thread Why is $. not zero-based?
Note, $. is used for warnings outup too!
But the idea to count from 0 in the real life!!! No! ;-/
We count to say how many things we have, math star from here. 0 was created, and a big invention, to can count bigger amounts, but with the same symbols, and to represent the null too! If we count from 0, we need to invent another "0" symbol for null!
I say again, we count arrays from 0 only to manipulate it better. Is easier to make an algorithm that count from 0!For example, the subsrt() command:
You use the 2 to say where the 1st substr ends and to say "where" the 2nd substr start! If we count from 1 you need to always recount the values for start and end:substr($var , 0 , 2) ; substr($var , 2 , 2) ;
substr($var , 1 , 2) ; substr($var , 3 , 2) ;
Graciliano M. P.
"The creativity is the expression of the liberty".
|
|---|