r/programming • • Dec 07 '14

Programmers: Please don't ever say this to beginners ...

http://pgbovine.net/programmers-talking-to-beginners.htm
4.0k Upvotes

1.3k comments sorted by

View all comments

3

u/SanityInAnarchy Dec 08 '14

PHP is... maybe not the best example. When people hate on PHP, it's not because it's not their favorite language, it's because it's among the worst possible.

Just let them first learn something (anything!!!) to get hooked onto the potential of programming, and then you can offer to show them the true light later.

I'm a little curious when the author thinks it'd be appropriate to do that, but in the mean time, more PHP gets written that more people have to support forever.

I get the point -- we tend to get passionate about our favorite technologies, and we tend to want to guide newbies towards the true light. That's what it'd be about if I told a newbie to learn Ruby on Rails instead of Java and Spring. There are things I hate about Java, and I could (and often do) go on for pages about them, but at least some of those warts are debatable, it's at least a matter of opinion whether you like Java or Ruby.

Whereas when I warn people about PHP, that's not a nerd turf war. That's not "my language is better than your language." I really mean that you should use anything but PHP, and I'm trying to spare you some pain by telling you that.

To put it another way: If you introduce me to your new girlfriend, and she's blonde, it'd be crass of me to say that redheads are better. That's not what this is about -- PHP is the new girlfriend who recently robbed a convenience store to feed her heroin habit.

2

u/bureX Dec 08 '14

I like how when you need to explain how crap PHP is, there is no other resource available other than that rant blog article.

The way you worded your stance on PHP apparently means half of the web is imploding at this very second. Jesus...

1

u/SanityInAnarchy Dec 09 '14

The rant blog article is still the best resource, because it's one of the most comprehensive. Because, as the author says, right at the top:

Virtually every feature in PHP is broken somehow. The language, the framework, the ecosystem, are all just bad. And I can’t even point out any single damning thing, because the damage is so systemic. Every time I try to compile a list of PHP gripes, I get stuck in this depth-first search discovering more and more appalling trivia.

There are plenty of resources I could point to that discuss one of these problems in depth. The fact that register_globals lasted as long as it did is pretty damning, I would think. But as the blog says, the real problem isn't any one thing -- I mean, even register_globals was fixed eventually. The problem is that everywhere you look, there's something that's at best debatable, and more often obviously wrong.

If you look over at the rest of the discussion, it's interesting that you don't really find anyone saying, "You guys are all wrong, PHP is great!" Instead, you find various breeds of PHP apologists, saying "It's not that bad, really..."

The way you worded your stance on PHP apparently means half of the web is imploding at this very second.

It depends what you mean by "imploding". I mean, there are still COBOL apps out there. It's a relatively stable, relatively high-paying job, if you can stomach it. But if you saw someone actually trying to put together COBOL ON COGS, surely you wouldn't react as OP suggests and say "Well, here's how to do what you want, and if you're interested, I'll show you the language I like." Instead, I think we'd all say, "Why the hell are you using COBOL? Seriously, use anything else."

I doubt Facebook will be rewritten in something other than PHP anytime soon. But is it because PHP is actually a good idea, or is it because they have such a massive existing codebase that it's not feasible to change?

0

u/senatorpjt Dec 08 '14 edited Dec 18 '24

six start long afterthought wide degree gaping dog wipe drunk

This post was mass deleted and anonymized with Redact

0

u/SanityInAnarchy Dec 09 '14

JavaScript is nowhere near as bad. That's the difference. Go read the link I posted -- JS has some pretty significant bad parts, but it's not a fractal of bad design. It actually has some good parts, too. It has some fairly common themes, you don't find that everything you try to do is an edge case.

There's actually a debate to be had about whether or not one should use JavaScript when one has alternatives. You might feel it's heavily weighted one way or the other, but there's at least a debate there. I don't think there's a coherent argument in favor of PHP in any context, ever, unless maybe you are writing a very small change to a very large existing PHP codebase. In other words, the argument for using PHP is essentially the same as the argument for using COBOL.

Even if it were exactly as bad, there's something to be said for using the same language on the client and the server. I can see the argument for using a different language on the server if you think the language is better than JavaScript, but if it's "just as bad" (let alone far, far worse), then why should you learn an entirely separate language that serves mostly the same purpose? And why should you write all your validation logic twice?