If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Comment

Why are people so much against PHP? It is simple to use, and start with, and it is not like it is meant to be used for system programming or artificial intelligence. I think it is mostly because of bad programming practices, from the time of PHP 4 and before. There were bunch of crazy web designers, without basic programming know how, best practices and design patterns writing terrible looking, hard to maintain code. I really don't have experience with Python, but I doubt it can prevent someone to write messy code.

Comment

Why are people so much against PHP? It is simple to use, and start with, and it is not like it is meant to be used for system programming or artificial intelligence. I think it is mostly because of bad programming practices, from the time of PHP 4 and before. There were bunch of crazy web designers, without basic programming know how, best practices and design patterns writing terrible looking, hard to maintain code. I really don't have experience with Python, but I doubt it can prevent someone to write messy code.

It's this bad, because it's been abused to do things for which it has never been intended to in the first place, and has grown into a monstrosity from that point.

The rant you cite, although valid from technical point of view (I agree with technicality behind all its points), like any other of the technically correct rants about PHP, is written by a Real Programmer (tm), with a big extensive experience in the field, and who as an everyday job writes huge million-lines long applications.
From his point of view, he is indeed right, and PHP would be very badly suited for this kind of use. PHP-written big applications, like Facebook or Wikipedia, are more an exception (done for some precise historic or technical reason) than the rule.

But, in the first place, PHP has began its life as a quick tool to put some dynamic content inside a web page. While fire up a huge web application, when you could simply just write a single line of PHP code ?

PHP Code:

<body>
<p>The current foo is: <?php print $foo; ?></p>
</body>

That how PHP began its life, and that's the extent of how far it should be used.

Complaining about PHP's problems, would make as much sense as complaining about the limitation and short commings of shell scripts.
(which share some of PHP problems, including inconsistencies of API, because most of the shell call into system command which have each their own parameter syntax).

The main problem with PHP is not that it's bad language, it's that is *used* as a programming language, whereas it should be for quickly hacking small dynamic stuff like what it was designed for.
It would be akin to creating a complex desktop application with a GUI by using nothing but shell-scripts: It is possible, but that would be a really bad idea.
And in both case, there's only a very limited subset of situation where is would make sense (complex web applications written in PHP only make sense for end-user who only have a "classic" web page service: upload files with FTP and have apache serve them, instead of being able to run a full blown web application on a real full-scale web server.
Complex application written in shell script only make sense, for example, for the first stage of an ".sh" installer, before being able to unpack and run actual binary code).
In both case, after the phase of quick-prototyping, if the project grows, it would be better to switch to a language which scales up. Even if that language is Perl (still very hackish, still oriented toward fast-prototype and small experiments, but at least scales better up than PHP).

Comment

It's this bad, because it's been abused to do things for which it has never been intended to in the first place, and has grown into a monstrosity from that point.

The rant you cite, although valid from technical point of view (I agree with technicality behind all its points), like any other of the technically correct rants about PHP, is written by a Real Programmer (tm), with a big extensive experience in the field, and who as an everyday job writes huge million-lines long applications.
From his point of view, he is indeed right, and PHP would be very badly suited for this kind of use. PHP-written big applications, like Facebook or Wikipedia, are more an exception (done for some precise historic or technical reason) than the rule.

But, in the first place, PHP has began its life as a quick tool to put some dynamic content inside a web page. While fire up a huge web application, when you could simply just write a single line of PHP code ?

PHP Code:

<body><p>The current foo is: <?php print $foo; ?></p></body>

That how PHP began its life, and that's the extent of how far it should be used.

Complaining about PHP's problems, would make as much sense as complaining about the limitation and short commings of shell scripts.
(which share some of PHP problems, including inconsistencies of API, because most of the shell call into system command which have each their own parameter syntax).

The main problem with PHP is not that it's bad language, it's that is *used* as a programming language, whereas it should be for quickly hacking small dynamic stuff like what it was designed for.
It would be akin to creating a complex desktop application with a GUI by using nothing but shell-scripts: It is possible, but that would be a really bad idea.
And in both case, there's only a very limited subset of situation where is would make sense (complex web applications written in PHP only make sense for end-user who only have a "classic" web page service: upload files with FTP and have apache serve them, instead of being able to run a full blown web application on a real full-scale web server.
Complex application written in shell script only make sense, for example, for the first stage of an ".sh" installer, before being able to unpack and run actual binary code).
In both case, after the phase of quick-prototyping, if the project grows, it would be better to switch to a language which scales up. Even if that language is Perl (still very hackish, still oriented toward fast-prototype and small experiments, but at least scales better up than PHP).

Saying that PHP isn't supposed to write big apps is wrong. It were true in the beginning but now they try to sell it as a real language with OO and such. And a lot of people believe in that utter crap.

PHP is a powerful templating language, however it isn't a good one as it is designed more like a programming language than a templating language. I do use PHP myself on occasion as it's powerful and simple to get started with. However I never ever would use it in something that is bigger than three files or 100 lines in total (whatever comes first). If PHP ever only where advertised that it should only be used under that simple rule I wouldn't have any problem with it at all, now it's advertised as

PHP is a popular general-purpose scripting language that is especially suited to web development.

Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

and I say, and stand for, that PHP is the worst programming language ever constructed.