Live data from Hacker News

Coding Horror: The PHP Singularity

codinghorror.com

81–90 of 341 posts

Re: Coding Horror: The PHP Singularity

#81

Earlier quoted context omitted.

Basically, Jeff just agreed that PHP is simply better than the rest. Easier != better. Nice try.

Debatable. What's your end goal? If your primary goal is making money (through the web) and you are non-technical, easier does in fact equal better. The GP's brother isn't going to stop what he's doing and learn Ruby so he can rewrite his whole website in gloriously succinct and elegant code. He's going to tweak his site, continue making money and stop caring about whatever the hell his site is written in.

Life is full of tempting shortcuts. Take them at your peril.

Re: Coding Horror: The PHP Singularity

#82
post #65
post #48

I seriously groaned when I saw this post (title). I was expecting an elitist diatribe about PHP (because this is perennially popular amongst particular programmers) but that's not what this post is intended to be. Interestingly Jeff does take the usual potshots at PHP almost like he thinks he'll lose street cred if he doesn't but the basic message I agree with: if you want someone to stop doing something you consider…

> default to HTML escaping on output ??? Is that a joke? Don't do that! That's just as bad as magic quotes. > no register globals It hasn't existed for a quite a while now in PHP. Other than that I quite agree with what you wrote. Most of the criticism of PHP is simply a desire to be special. If lots of people are using something, you want to make sure not to, so that you feel special. Now that you've decided not to…

> > default to HTML escaping on output

> ??? Is that a joke? Don't do that! That's just as bad as magic quotes.

No, it's not. Magic quotes are a pain to reverse. HTML escaping can be built into the echo/print/ commands, so that it is:

    - A setting that can be totally turned off at run-time, if you want;
    - Easily overridden on a case-by-case basis with a 'rawecho' function that 
      does *not* escape anything.

Re: Coding Horror: The PHP Singularity

#83
post #8

Hey Jeff, let's throw down the gauntlet. You're obviously an experienced developer. I've been in the game for over 11years so should have enough experience to tackle you on this bigoted rant. You choose a problem that you think PHP can't solve[well]. You solve it using your high level language of choice and I'll solve it using PHP. Let's compare the outcome on reliability, ease of re-factoring, speed, whatever .. the…

Congratulations! You just Blub Paradox'd yourself. At this point in your knowledge cycle, you are unable to understand something more complex than what you already know.

Knowledge is power. Defending your own knowledge by refusing to expand and learn something new is cutting yourself off at the knees (or fingers, as it may be).

Re: Coding Horror: The PHP Singularity

#84
We get it, you don't like PHP. Don't use it. Nobody forces you to use it... If someone does, it's most likely a client, and that's nobodies fault but your own for seeking clients that want PHP work done. And if that's the case, you shouldn't be scolding PHP for keeping food in your mouth and a roof over your head.

But yes, we get it, you don't like it. Move the fuck on. These "This is what's wrong with PHP" articles are starting to get redundant... Everyone shouting in to a empty cave that nobody cares about.

Re: Coding Horror: The PHP Singularity

#85
post #65
post #48

I seriously groaned when I saw this post (title). I was expecting an elitist diatribe about PHP (because this is perennially popular amongst particular programmers) but that's not what this post is intended to be. Interestingly Jeff does take the usual potshots at PHP almost like he thinks he'll lose street cred if he doesn't but the basic message I agree with: if you want someone to stop doing something you consider…

> default to HTML escaping on output ??? Is that a joke? Don't do that! That's just as bad as magic quotes. > no register globals It hasn't existed for a quite a while now in PHP. Other than that I quite agree with what you wrote. Most of the criticism of PHP is simply a desire to be special. If lots of people are using something, you want to make sure not to, so that you feel special. Now that you've decided not to…

    > > default to HTML escaping on output
    > ??? Is that a joke? Don't do that! That's just as bad as magic quotes.
Microsoft's Razor and Python's Django templates have both shown that HTML-escaping-by-default can be cleanly done in a way that is not magical and that is highly reliable. I'm not honestly sure what you're protesting here.

Re: Coding Horror: The PHP Singularity

#86
post #57

Earlier quoted context omitted.

Speed isn't an issue, at least in my experience, compared to similar languages. Raw PHP usually beats Rails handsdown, and most PHP frameworks are usually comparable. PHP performance has increased markedly over the past few years, and particularly in v5.4. And if you really need a speed bump you can use the APC cache or HipHop compiler. Its never going to be as snappy as, say, C, but in the class of languages its in…

>Raw PHP usually beats Rails handsdown, and most PHP frameworks are usually comparable Being able to keep up with the slowest competitor in existence isn't very good.

The reason I cited Rails is that its usually proposed as the better alternative in these anti-PHP threads. Most "high" performance PHP doesn't use one of the usual-suspects in the framework world and can easily beat Rails (and usually plain ruby too).

Edit: I should add "in my experience" to the end of that, I have no stats to hand.

Re: Coding Horror: The PHP Singularity

#87
post #28

Cue legions of PHP drones blubbing about how it does the job just fine, it's available everywhere and how it's used by Facebook and half the internet. We get it. We used to be PHP developers too. We took the time to learn other languages and now work with them. We enjoy our jobs significantly more than we used to. You might too.

I'm a full time PHP dev. My work is in PHP, my personal projects is in PHP, I even have a PHP framework (like everyone!) that I maintain. Yet I thought this post was right on target. I'm busy cleaning and finishing up my PHP projects, and then I won't start another project in PHP. It will be ruby or python, or maybe I'll go functional. It depends on what I want to do. Yes, I can say everything that you so sarcastical…

Good for you! In my case I moved to ruby but I would imagine the transition is similar to other languages at a similar level of abstraction. I went through a long phase where I was trying to bring patterns from ruby into PHP.

It got to the point where whenever I sat down to write PHP, I would write it in ruby first as a sort of pseudo-code, then expand the brackets out into PHP after the fact.

Eventually I decided that I would be more efficient just skipping the expanding out step.

Re: Coding Horror: The PHP Singularity

#88
post #44

I agree that it's rather surprising that in this day and age, nothing comes close to the out-of-the-box ease and performance that PHP gives for web development. Install a couple of packages, and BANG, you're up and running. It's been a year since I've taken a look at the rest of the webdev landscape, but it seems that you either lose out to an overly-complex setup (by comparison), or suffer with a memory hog that mak…

Agreed. I can set up a VPS with debian/nginx/mysql/php in about 10 minutes and have a site up and running. Python? Ruby? There just doesn't seem to be an easy way of getting them running on a web server. At least, I haven't figured it out yet if it is easy to do.

For Ruby there's Passenger/Ruby Enterprise Edition, which is simple to setup IMO, but it's stuck on 1.8.x, AFAIK...

Re: Coding Horror: The PHP Singularity

#89

Earlier quoted context omitted.

Why is python or ruby too hard for your dad to learn? If anything I would think something like ruby would be even easier than php since things are a bit more consistent. I just don't see how PHP is more approachable, especially compared to the supposed ease of ruby on rails.

Try getting Django to run on various hosting sites. Dreamhost - been with them for ten years, gave up trying to get Django to work after a month of poring thru the docs, trying to get tab A into slot 3x. Mind you, I really like Python, but it's not worth the effort for a couple more years. PHP is the A-10 of languages. It's a slow, ugly and easy target. It works pretty much everywhere.

For pretty much every language these days, there is a hosted service that will handle deployment for you, and you can just push code to them and they'll take care of the rest. Better yet, they're perfect for beginners, who usually don't know much about database tuning, firewalls, etc.

Re: Coding Horror: The PHP Singularity

#90
post #5

Sorry Jeff. The only thing broken with PHP is you (and other people like you). How much PHP do you use Jeff? Lets assume none. How is PHP hurting you? I mean seriously, how much contact do you even have with PHP? PHP is easy to learn, easy to make websites with. There are a tonne of paying jobs which require PHP. PHP runs a lot of websites. I am a PHP developer. I prefer Python but my PHP job pays me just fine. There…

I don't have to deal with PHP directly but to me it just doesn't feel right when for example you learn about financial websites being built in PHP (as in an HN submission the other day). All these strings being accidentally treated as integers or floats and vice versa, without a decent way of handling errors, it feels like building a skyscraper on a fault line and not worrying about making it earthquake proof. Even if I'll never have to set foot in it, I'll still complain.
Post reply on HN