Live data from Hacker News

PHP Sucks, But It Doesn't Matter

codinghorror.com

71–80 of 112 posts

Re: PHP Sucks, But It Doesn't Matter

#71
post #51

Earlier quoted context omitted.

That's absolutely right. I've established that there's a market for digging trenches for subterranean cables, and my decision to use teaspoons instead of pneumatic drills and mechanical diggers has no bearing whatsoever on my venture's prospects.

That would be a very valid analogy if no other trenches had been dug with teaspoons, but a high percentage have, including some of the largest and most successful.

The analogy wasn't particularly about PHP, it was about tools.

It might be true that the choice of tool is irrelevant to an end user, investor or other person that's not capable of or interested in judging the tool's merits, but if you're actually trying to build something the choice of tool matters quite a lot. The fact ryannielson doesn't know or care what I do all day doesn't help me get stuff done.

Epilogue: The company I work for recently bought a Content Management System / web framework for half a million bucks, then spent another half a million bucks trying to make it work, then abandoned it in favour of the system we were running before. I think the decision to go with that tool was a poor one.

Re: PHP Sucks, But It Doesn't Matter

#72
post #60

Earlier quoted context omitted.

I know why it's successful. I remember when PHP was becoming popular. It allowed for inroads to code from front end designers who hated coding in Flash at a time when academia-based Java people were running all the big websites. If you wanted to hack up and put up a website, you can do so in a few minutes with a LAMP stack where a Java stack needed some lessons in Java. Same is pretty much true today, but it's 10 lan…

I remember that PHP became popular because of mod_php. If you wanted to script a web application on Linux or UNIX your choices were either Perl with CGI or a much faster PHP with mod_php. It was incredibly easy to setup both in production and for development - hence the LAMP stack and the thousands of cheap shared hosts that had PHP enabled, which lead to a lot of pre-install applications being written in PHP. Other…

They still haven't beaten PHP in ease-of-deployment. I've been writing for the web in Python for 2 years. Deploying your own server is a full-time job.

The only thing that's getting better is that things like Heroku now exist. Heroku makes it insanely easy to deploy Python, compared to deploying on your own server. It's still harder to do than FTP + copy files, which most people know how to do.

Re: PHP Sucks, But It Doesn't Matter

#73
post #57

Many both pro and con PHP articles are missing the point about PHP. PHP is a great success in spite of its obvious shortcomings because it supports iterative development . (Saying that language choice is less important for a project than other factors doesn't explain anything - all other things being equal, a language with fewer traps and idiosyncrasies would be the better choice.) The killer feature of PHP is that y…

Thank you! Iterative development is key.

Out of any language I've ever used, PHP has most allowed me to just get stuff done fast. It certainly isn't elegant, but it works. And even as you grow and scale up, as long as you constantly refactor at critical moments, you can avoid spaghetti code just fine.

Re: PHP Sucks, But It Doesn't Matter

#74

Earlier quoted context omitted.

I know why it's successful. I remember when PHP was becoming popular. It allowed for inroads to code from front end designers who hated coding in Flash at a time when academia-based Java people were running all the big websites. If you wanted to hack up and put up a website, you can do so in a few minutes with a LAMP stack where a Java stack needed some lessons in Java. Same is pretty much true today, but it's 10 lan…

"(core dumps - a common issue in PHP)" Ummm.... I've been working with PHP for 16 years, and I could count the number of coredumps I've had in production on one hand (maybe 2). Early on, when compiling extensions by hand, I'd get some when I compiled something wrong, but that was always in test areas on dev machines. If 'core dumps' were 'a common issue', I doubt it would be as widely used as it is now.

Bahh.. it was at where I worked. It was because we relied on C libraries that PHP connected to. When PHP is slow, they make links to C libs to get speed. Java did the same with JNI. PHP simply isn't fast enough in some situations where C libs are necessary to hook up with. (private message me if you disagree.. I'll be glad to go into details)

We were typically getting up to 200 req/second on our stack. So it was pretty heavy traffic to begin with. We solved the core dumps though. And the java core dumps were for the same reason (necessary to connect to JNI).

Re: PHP Sucks, But It Doesn't Matter

#75
post #54

Earlier quoted context omitted.

I know why it's successful. I remember when PHP was becoming popular. It allowed for inroads to code from front end designers who hated coding in Flash at a time when academia-based Java people were running all the big websites. If you wanted to hack up and put up a website, you can do so in a few minutes with a LAMP stack where a Java stack needed some lessons in Java. Same is pretty much true today, but it's 10 lan…

> Tell me to code mindfuck and I will. I believe you referred to brainfuck, just for the record. > As I get older, I think I hate them all. There is some deep pessimism in the software world that I feel constructive . When engineers talk about how much they hate the tools even they don't have to use, I think it shows the care they have toward the profession.

Bahh.. Don't be so patronizing. I'm a nerd dude. I was joking when I said I hate them all. I'll fuck Java and PHP in a 3some if given the chance.

I'm saying as long as I get paid I'll do the job because I'm an hourly coder (pays more, have mouths to feed). I do plenty of "fun" work and open source work.

Re: PHP Sucks, But It Doesn't Matter

#76
When you say Wikipedia, Digg, Wordpress, Facebook, et all were all written in PHP, it doesn't mean a thing. All those use PHP simply because when they started PHP was the best thing available. Nowadays this is not a matter of "it gets the job done" anymore (e.g., Facebook paid $1b for a site that runs of Django).

Re: PHP Sucks, But It Doesn't Matter

#77
post #6
post #3

Note that this is a response to: EDIT: refer https://twitter.com/#!/codinghorror/status/18957165652253491... - Jeff's 4 year old response is still valid. http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... Jeff gets it right - the language is poorly designed, but it hasn't stopped PHP powering many of the biggest most important sites on the internet today. Banging on about the language's flaws [again] is…

This is the wrong way to think about it. Just because people can hop on one leg across the finish line doesn't mean that's a smart way to run a race. Ask yourself this: would the Instagram team have been as successful had they chosen PHP? I think not. Javascript is different because we're stuck with it for historical reasons but there are so many better choices on the back end that there is absolutely no excuse to st…

Ask yourself this: would the Instagram team have been as successful had they chosen PHP? I think not.

Instagram was only succesful (i.e. bought) because they had something (lotsa users' photo habits) that someone with lotsa money (facebook) wanted.

Re: PHP Sucks, But It Doesn't Matter

#78
post #9

Earlier quoted context omitted.

> Instagram team have been as successful had they chosen > PHP? I think not. Can you elaborate, why you think so? PHP worked OK for Facebook and Wikipedia.

The time you don't waste fighting with the language and coding around its deficiencies is time you can spend improving existing features and adding new ones. If you're trying to run a lean startup with only three backend people like Instagram these effects are very important. Those three engineers could have coded something similar in PHP but I'll guarantee you it wouldn't have been as good. Facebook can afford to th…

> Facebook can afford to throw money at the problem

Aaah the good old circular reasoning of dismissing the big guy - they did get big enough to be able to afford money by using PHP too you know.

Re: PHP Sucks, But It Doesn't Matter

#79
As someone who has written PHP for years, I would say it's starting to matter. The inability for PHP to adapt in a speedy fashion to new programming trends, the continuous implementation of features in a half-assed fashion (namespaces, anonymous functions, etc), and the unwillingness to even attempt to clean up the standard library have begun to marginalize PHP.

It's now easier and faster to get up and running with JavaScript or even Ruby, and these languages have more internal consistency than PHP, meaning that long-term they will see more skilled developers using them and thus will eventually have more and better libraries than PHP.

In addition, the JVM has reached a point where languages like Scala can compete, and apart from the initial cost, C#/.NET will actually save you money in the long term.

So, in short, while PHP is just fine as a language and I use and abuse it every day, I have a feeling that we will be seeing its twilight sooner rather than later, unless something like HPHP takes center stage, breaks backwards compatibility, and shakes up the ecosystem enough to revitalize the language.

Re: PHP Sucks, But It Doesn't Matter

#80
"If PHP sucks so profoundly, why is it powering so much of the internet?"

The same reason that Excel vba sucks so badly but is powering so much of internal company "applications."

A lot of these sites are first started by a small group of people, looking to get something working ASAP. They do what is easiest, setup LAMP and get hacking. At the time, it's the quickest way to getting something workable.

Inevitably, you end up with a similar situation as you do when your BA takes it upon himself to create an indespensible excel vba spreadsheet. The cost of redoing it in something better is hard to justify, because atleast the current application works. Even though you know it has reached a point where having it as a real application would probably be best since so much of your company relies on its information and analysis.

So here we are, stuck with a shitload of crap written in PHP and Excel VBA, but it doesn't matter. Because all that crap works, and that's the goal. Not maintainability, elegance, programming cred, etc.

Post reply on HN