DasGenie: !Scrap
« Hit the penguin! Again! | Main | Anti-Valentine »

Samstag, 14. Februar 2004

Why PHP sucks, Part III

... because it was intended to.
Listen to this Interview with Rasmus Lerdorf, the Father of PHP and be enlightened.
BTW: ITConversations real nice site.
What do we learn from this interview? The main goals of PHP were a easy learning curve, a easy way to solve simple problems. It all evolved through Mr. Lerdorf including more and more fucntionality to suit his users. He puts it this way: "I don't know how to stop it, there was never any intend to write a programming language [...] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way".
In this way PHP is a great success for it's original target group: the HTML-Dreamweaver-Javascript-Designer. It's easy for them to do nice small stuff quickly. But if you want to do a proper web applications there are other solutions around that include an actual programming language, nice separation of data and layout, etc.
And the other downside is: PHP works in many ways different than actual programming languages, all intended to make it easier too use for the non-programmer. The problem is once a non-programmer gets into PHP he gets mislead in so many areas, so it will be very hard for him to do some real programming with an actual programming language that has a memory model, where endless loops run endless, where objects are pointers and not copied, where variables have a consistent and thought through scoping, where memory consumption does count, where lifecycles of objects are important and so on and on.

02:39 - Samstag, 14. Februar 2004
Comments

To summarize this inane rant. PHP sucks because it isn't C++.

Posted by: at 20.02.04 05:25

No I'd never say that! I don't even like C++. Its quite ugly.

Posted by: Domink Wagner at 20.02.04 11:25

I've been working in the IT industry as an Oracle rep for just under 5 years now. We manage several accounts that involve competent PHP programmers. While any "good" programmer does not specialize in only one language I have seen a LOT of success with individuals who work with PHP. As far as how "proper" these web applications are is really a serious matter of ego. If you want to get ahead, you'll need to know both C++ and PHP, among others.

In sum, PHP does not "mislead in so many areas", if anything, PHP is a language for both advanced and beginning programmers.

Posted by: WLN at 26.07.04 13:59

IMHO to get ahead you need to really know many Computer languages to be able to choose the right one for the right task. So you can say I agree with you on that.
And one thing you can argue is that PHP may be the right language for many web things, because of availability. The point I was making is that you're not supported by PHP to write clean code with good separation. Also you running into deep problems now again with PHP5 because so many things change from version to version. Just have a look at the changelog, it's ridiculous, even in minor revisions.

Posted by: Domink Wagner at 26.07.04 14:27

PHP has its pros and cons, that's for sure. But don't forget that the ease of use and availability of PHP (read: cost) has allowed many to utilise it on the web.

Posted by: NetNexi at 08.10.04 06:05

I've used php many times. I did work on a massive project for web-based cluster administration. After a point release, A POINT RELEASE, 6 key functions worked differently than they had done before, effectively crippling my entire setup. Quite honestly, after my experiences, I see PHP as the Fisher Price language: made for kids. Not made for real work.

You wanna access DB's? Use perl. You wanna do some cool server side scripting? Perl and/or Servlets work pretty nice. I am vowing to avoid PHP until they decide to make it a grown-up language.

Posted by: brian at 26.10.04 21:18

PHP is for homepages. Personal Home Page language.

It hasn't brought anything new to IT. Just miserably mixed Basic, C and Java (by kids who don't know the Real Programming).


Posted by: P.K. at 16.11.04 14:09

PHP jest pojebany bo kurwa musimy go umiec na zaliczenie. PHP s0x

Posted by: Admin at 18.01.05 13:32

I wouldn't say it is easy to learn.. I learned PHP as my first language and got into all sorts of bad habits. Actually, my first language learned was Regexes.. which sort of got me into PHP. I liked regexes a lot, but I understood that they had a special purpose.. they were for text processing, not for managing a project.

PHP is hard to read. You can't print it out on paper and read it, it has too many symbols, ... not a beginner language. It's like reading one long Regex. Way too many symbols. Regexes are short and dirty and very useful.. but a language shouldn't look like a regex. I.e I'm not a fan of perl either.. I've yet to see any offline software applications ship that are in perl or php. I've seen several hundreds ship in Pascal, C++, Java. I'm not a Java fan only due to the fact that it requries such a large SDK. Not because of it's language.

They call perl a beginner language too. Nonsense.
I'd rather learn how to do .bat files than learn perl as a beginner.

If you use PHP in large projects, it's because you like to give yourself a hard time rather than an easier one.

Note: I run a software co and develop several large offline projects underway with 10,000's of lines of code.. so I do speak from experience. I I'm not an object (oo) advocate or anything. There are a time for regular old procedures without objects, partial use of OO, etc. I became a very capable programmer in short time (a few years) that I would have never thought possible when I was using PHP in the beginning. I'm sure glad I took a break from the net for a while and learned how to program offline software.

But with PHP, it's just too much time converting symbols in your brain and converting Isset's to "Form button was clicked". PHP is not assembly, but it sure is unmanagable. Sure, you can manage it but it takes hours of your time.. i.e. relatively, it is absurdly unmanagable compared to doing something in say Visual C++, Delphi, or even gnu C++ or borland C++, or borland c++ builder.

You might want to consider CGI if you are looking for alternatives. The trick will be optimizing it since it has to load into the memory upon a new server request. Then again that isn't a big deal since there are ways around that. CGI is not perl remember.. CGI can run any application.. CGI could run PHP for example, if you really wanted. CGI is not a language, CGI is not perl.. don't read too much on the net, as that was my impression when I first heard about CGI.

Posted by: Joshua Bolan at 25.02.05 09:15

Hah.. PS.. i just noticed that this site was run off CGI when I posted the message! Neato..

Posted by: Joshua Bolan at 25.02.05 09:16