3 ms·
The problem with PHP isn't merely that you can write cleaner code, or more maintainable code, in other languages. The other languages also offer abstractions th
by mechanical_fish 18y ago
The problem with PHP isn't merely that you can write cleaner code, or more maintainable code, in other languages. The other languages also offer abstractions that are difficult or impossible to make use of in PHP.
But, that said, I agree with the point of your essay. It really doesn't matter that a hacker's first language is lingustically impoverished. The entire point of being a hacker is that you go on to learn several more languages. And I don't buy the argument that your first language indelibly warps your mind -- that's an argument from the era of old-school microcomputer BASIC, the kind with line numbers, no function calls, and only global scope. That was a terrible language, far more impoverished than PHP ever was, yet I and everyone I know started with it, and we all grew out of it just fine.
The other point I'd make is that far too much attention is paid to the reasons why PHP sucks, when we should instead be trying to figure out why PHP even exists. Specifically, we should be trying to figure out why all the PHP programmers didn't learn Perl instead, and (more importantly) why Java didn't displace PHP despite its massive marketing advantages and its (supposedly) better design.
- Prrometheus 18y ago>The other point I'd make is that far too much attention is paid to the reasons why PHP sucks, when we should instead be trying to figure out why PHP even exists. Because you can go to GoDaddy today and pay $3.99 for a hosting account and start writing PHP code right next to the HTML in your site. It's simple. If all you know about web programming is HTML, then PHP is an easy next step. Also, it's widely used. Does Perl do that? I don't know. I don't think Ruby or Python come close to the simplicity. It took me way longer to set up my first Rails server than it did to write my first PHP function.
- mechanical_fish 18y agoI agree that PHP's superior usability for newbs begins in the first five minutes. But I don't think that's the whole story. You can also embed Perl, Ruby, or (I presume) Python in a simple HTML page. (Though I believe that there is no canonical, preinstalled, universally accepted way of doing so, which is a big usability problem.) And I don't know of any technical reason why Perl couldn't come installed on a $3.99 web hosting account. (Perhaps it did, back in the day. I no longer remember. I did web programming in Tcl back then.) I've also heard that Python is fairly easy to host, and even Ruby is getting there -- Heroku gives you Rails, for perhaps even less effort than it takes to use your cheap webhost's PHP. You don't even have to figure out ssh or FTP to use Heroku. But, alas, the problem is bigger than that. It's not just the first five minutes of Perl that are tough. It's the twenty hours after that. And something like Rails, which requires you to be familiar with databases and OOP, is on yet a higher plane of difficulty.