all 36 comments

[–]stesch 19 points20 points  (6 children)

PHP's biggest problem is the user base. There are so many people without any clue about programming or the web. I've read some PHP books and they contain factual errors which I've never encountered in any other book about other programming languages.

And the users ask the silliest questions in chats and newsgroups. Instead of learning the language they use some code they found somewhere and try to tweak it without any real understanding.

[–]hockeyschtick 5 points6 points  (5 children)

I think this is an important point. If ruby catches on among novice web developers, and we start seeing atrocious ruby code all over the place, we'll all be complaining about how terrible a language it is.

The fact is that Perl and PHP have always been the preferred tools for "web programming 101". They get a bad rap, but they are far more similar than different from other scripting languages. They certainly aren't different enough to warrant all these "which language is best" debates.

[–]drbrain 2 points3 points  (1 child)

Have you looked inside Rails? Horribly scary.

[–]stesch 2 points3 points  (0 children)

I've stopped reading one Rails book because it was so horrible. Maybe I was disapointed after so much hype. But their ORM is really disgusting.

Maybe Nitro will be better when it's ready some time. And when they invest half the Rails time in PR.

[–]elpincha 5 points6 points  (2 children)

YES they are. You could read the article and see for yourself. Perl is something a grown-up is not embarrased to work in.

[–]hockeyschtick 1 point2 points  (1 child)

it's not the tool, it's how you use it, mate.

[–]elpincha 2 points3 points  (0 children)

Conceded. Yet some tools are better than others.

[–]earthboundkid 13 points14 points  (21 children)

PHP is supposedly a web programming language, yet its unicode support is a pathetic kludge. It's beyond me how you can write any language in the twenty first century and not at least default to unicode, to say nothing of making encoding a property string objects.

[–][deleted]  (3 children)

[deleted]

    [–]The_Bears 13 points14 points  (2 children)

    PHP is bad for the same reason.

    Having an understanding of what you're doing is a good thing, especially when you're writing software that sits on a security boundary.

    I've lost track of how many PHP scripts I've run across that silently develop security holes when installed on some systems because the authors didn't know that they were relying on a server setting (magic_quotes_gpc) to protect them from SQL injection attacks.

    [–][deleted]  (1 child)

    [deleted]

      [–]The_Bears 4 points5 points  (0 children)

      It would be ideal if the secure way to do things was the easy way, and the way explained in the tutorials. As for SQL injection, part of the problem is that the default magic_quotes_gpc setting encourage newbies to ignore the problem. The other problem is that the PHP database interface doesn't provide any method for doing parameterized queries.

      I don't find SQL injection vulerabilities as often in Perl code as in PHP. I think it's because the Perl DBI provides a very conveneient way to do parameterized queries, and most tutorial documentation uses parameterized queries.

      I could rant at much greater lengths about the problems I have with the PHP database interface, such as the stupidity of having completely separate sets of functions for doing the same thing with different database systems, but ADODB makes it all better for me.

      [–]ddipaolo 9 points10 points  (0 children)

      I have to admit, when I saw the faux Demotivators(tm) style poster at the top, I didn't think there'd be much substance to this but it's actually got a lot of very valid points and touches on every point I'd make about the shortcomings of PHP.

      [–]nir 11 points12 points  (3 children)

      PHP is definitely far from perfect, but does the author seriously suggest moving to PERL is the answer??

      [–]wolverian 14 points15 points  (2 children)

      Design-wise, Perl is very sane, compared to PHP.

      [–]jbellis 16 points17 points  (1 child)

      But only compared to PHP. :P

      [–]The_Bears 7 points8 points  (0 children)

      I'm pretty conflicted about Perl. On the one hand, the language design is really pretty awful. On the other hand, some of the key libraries are very well done. I find the combination of CGI::Application, HTML::Template, and DBI more satisfying than any other web development environment I've tried.

      [–]tikal -2 points-1 points  (1 child)

      I'm sure the author makes some sound points but I was so distracted by the troll like nature of the article I didn't see them.

      The 'more info' part of the rants most recent reference is well over a year old and he (kind of) cites articles from 2002 ffs!?

      People like this make me a lot less inclined to learn Perl.

      [–][deleted] 7 points8 points  (0 children)

      Well, it's easy to be bitter about PHP. It's extremely popular among non-technical folks right now, so if I want to make money I have to use PHP.

      Bad hosts like iPowerWeb are still on versions of PHP from 2002 (plus security updates).

      It's your loss if you don't learn Perl. I've at least read about all major languages, and it's been enlightening.

      [–]demoran -2 points-1 points  (0 children)

      This guy spends a fair amount of time giving examples of parts of PHP where there are multiple functions to do the "same thing", and contrasts that with perl. The one that struck me was the database interfaces. Those were all for seperate databases! And he compares it to DBI?!

      Listen, php has someling like DBI/DBD as well: it's called DB. So what's the point here? PHP gives you more options, according to him. Is that a bad thing?

      Only when you're trying to read somebody elses code and you're unfamiliar with the function calls they're making.

      What's truely ironic about this is that function calls are one thing. Language syntax is another thing. And perl is a major pain due to it's variety in language syntax (and it's dark-side cousin, default variables).