4 ms·
> If you truly believe that learning PHP as a first language is bad for a new programmer, then you shouldn't bite your tongue. But you should be prepared to exp
by asuffield 12y ago
> If you truly believe that learning PHP as a first language is bad for a new programmer, then you shouldn't bite your tongue. But you should be prepared to explain why and present a good alternative and maybe even offer some hands-on instruction.
I routinely recommend python for this, and somewhat more aggressively to people who are making php noises. Not because I'm a massive fan of python, but because it has relatively little syntax and tends to fail in very obvious ways, which is exactly what you want here. On rare occasions I'll offer some direct tuition, but usually I just point people to http://learnpythonthehardway.org/book/ http://learnpythonthehardway.org/book/ because it really works.
For the most part, it's not all that important where you start - I recommend against people starting out with java or C++, but it's not a tragedy if they do. However, PHP is an exception. I have seen too many new programmers latch on to PHP because "it's easy", and it breaks them. They never manage to learn any other language because "it's too hard to get going, and I can do everything in PHP anyway"; they leave a trail of half-finished projects that hit the 20,000-line wall and couldn't figure out how to get past it. Whenever you try to introduce them to something else they just say "but it's hard, and I don't see why it's useful". You can't teach them how to do software engineering because PHP is too broken and the internet is full of terrible advice about writing PHP code.
Learning PHP first makes it harder to learn your second language, not easier, because of all the bad things you have to unlearn.
Yes, Facebook has a lot of PHP code. That's because they've made a business decision that rewriting it all would cost more than developing highly customised tools to make PHP somewhat manageable and then burning engineering costs on managing it. That cost analysis is very unlikely to apply to anybody else.