|
此文章由 典 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 典 所有!转贴必须注明作者、出处和本声明,并保持内容完整
http://who.wants.in/2008/06/why-i-hate-php.html
PHP itself has not too much to with it actually, well, it has, but the biggest problem with that language is the entry barrier. it is too low. every 10 year old can learn how to write basic php code and then starts to mess around with it, writes broken stuff and wonders why on earth software design is told to be complicated.
i got one of those php projects on the desk in the moment. a customer needs to get that project online and "just needs some bugs fixed". end of the story is that they refuse to have it rewritten because they sank too much money in it already and now got only the budget to fix the remaining bugs. turns out there is no "remaining bugs" there is just broken code around broken design around missing experience around no f**ing clue what software design is in the first place.
i saw lots of broken code in my live and i am well aware that i wrote broken code as well when i was a teen, probably even later. i wrote php as well as other stuff but i learned programming with real languages. programming is more than knowing the syntax, it is software design. it is the concept of how to optimize not only how to bump lines of code into an editor. this code rejects every idea of design. it has nothing to do with programming it is only inconsistent lines of code that happen do display things (at least from time to time).
why blame php? i think php is a language that can be used by guys knowing their business (even then it is a pain). it does not try to force you to a clean design. it does not provide you with a consistent API (positional parameters are interchanged every now and then) and it does not force you to actually design your code. this leads to the problem that every teen thinks to be able to write an application 10 times too big for him and the result even does nearly what was required. the problem is that the code is not maintainable because it was not planned, the code will never scale because the concept of scaling has never been considered. the code is cluttered and not readable because a codebase normally reflects the state of mind of the programmer this is a bad picture for the poor guy who cranked out those lines.
if all that sounds a bit frustrated then you are probably right. i never saw such bad code before not even in perl. most probably because perl has a higher entry level (replace perl with the language of your desire, i just used perl as it is often referred to as write only code).
it is embarrassing to know that someone paid good money for such a mess! |
|