You are here: Re: Code readability vs. execution time « PHP Programming Language « IT news, forums, messages
Re: Code readability vs. execution time

Posted by The Natural Philosopher on 09/04/07 15:28

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.

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...

At least in C you could be sure it meant 'the numerical value of
whatever $int is supposed to be, when cast to an integer, is tested for
zero)

And I used to LIKE my compilers giving me hell about

foo{return ('c');}

char p=foo();

and making me type it either as

char foo{return ('c');}

or char p=(char)foo();

Fussy, but it did pick up some errors all right.

 

Navigation:

[Reply to this 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

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