News for hackers. Stuff that matters.
Re:PHP, the web’s most popular programming language, is comi... by danso on Tuesday October 02, 2012 @02:07PM (#4603325)
I'd love to see you write a detailed case study defense of PhP...even though I realize it's kind of a raw deal to be expected to mount a formal defense for your own profession, especially given how much it gets trolled. But from the non-PHP fan's perspective, PHP persists because it has a strong foothold, not because it is clearly a more secure and enjoyable language.

It doesn't help that PHP's ubiquity has attracted its fair share of bad programmers. Maybe not more than other languages, but the human mind, when lacking available data, will make judgments based on absolute count (I.e. I know more terrible PhP programmers than I know terrible Go coders) rather than by ratio.

I started with PHP and did not enjoy the syntax, though I doubt I would be in web dev had PHP's stack on Dreamhost made it easy to make my first interactive apps. But I could never say that its conventions are conducive to good coding habits...but I have no place to judge, as I was a bad coder when I learned PhP and I may have been just as bad were I to start out with Python.

Re:PHP, the web’s most popular programming language, is comi... by maratd on Tuesday October 02, 2012 @04:43PM (#4604158)
> PHP persists because it has a strong foothold, not because it is clearly a more secure and enjoyable language.

It is still immensely satisfying to write in any text editor <?php echo (2 + 2); ?> and then see 4 on your screen. And then to wrap that in HTML and really get going. No compiling, no libraries to include, that's it. After writing code in Java and C (12 years ago), that is a breath of fresh air, and that's what got developers of my generation interested in PHP.

Do you have more options today? Absolutely. Python and Ruby were extremely obscure back then. No longer. You have Node.JS and of course, good templating libraries for all of the above.

But PHP is a templating language at heart and it's still the easiest to embed into HTML and see immediate results. That's pure joy.

Funny part? None of my production PHP code touches HTML or any client side stuff in any way. It just pumps data from the database to the client-side JavaScript.

And it's still immensely enjoyable. Why? Because PHP is aimed at the lowest common denominator. It has to work for that dude in India and it has to work for the 50 year old guy who just decided to switch careers. Which means the base language has to be dead simple. And it is. It's pretty much C with a few web-centric functions thrown in. That simplicity is enjoyable.

Re:PHP, the web’s most popular programming language, is comi... by modarts on Tuesday October 02, 2012 @05:40PM (#4604504)
I'm sure it's all fun and enjoyment while you're writing the code; but what about going back 2-3 months later, or worse, hiring additional developers on the project? How enjoyable is it to have reams of inline server script across multiple pages with no clear structure or intent?
Re:PHP, the web’s most popular programming language, is comi... by danso on Tuesday October 02, 2012 @05:41PM (#4604508)
Thanks for the answer. I agree with the ease part. And not touching the HTML, if that's how the app is arranged, is also good...I think my worst memories involved maintaining PHP that I (not knowing better) just threw into HTML when it seemed right.