Reply to Re: Code readability vs. execution time

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация