|
Posted by Michael Fesser on 09/04/07 15:54
..oO(The Natural Philosopher)
>ELINTPimp wrote:
>>> PHP is in some respects retrograde: Its too much like BASIC in that you
>>> can 'hack it till it works' too easily.
>>
>> Agreed, but that's why test driven development has such an important
>> place in our world...but that is just another form of programmer
>> introduced standard. Just like PHP's loosely typed aspect, it's a
>> double edge sword...but I wouldn't have it any other way =).
>>
>coming from strictly typed C I find it awful.
Loose typing in scripting languages is not a bug, but a feature, even if
many people seem to have a problem with that. JavaScript for example has
the same feature, but surprisingly nobody complains about it there. It's
always just PHP which is blamed.
>When I want to cast a string to an integer, I'd rather do it explicitly..
>
>I mean
>
>$int="0"
>
>If($int==0) echo "true";
>if($int) echo "its non zero"
>
>I am still not sure WHAT that last statement means, 0 means unsassigned,
>non zero, or what...
The second statement simply means that the value of $int, whatever it
may be, evaluates to FALSE.
Micha
Navigation:
[Reply to this message]
|