Live data from Hacker News

Coding Horror: The PHP Singularity

codinghorror.com

31–40 of 341 posts

Re: Coding Horror: The PHP Singularity

#31

Do the PHP frameworks help at all?

To a certain extent yes.

It helps to mitigate some common security holes, and sometimes prevents the coder from doing blatantly stupid like using unfiltered user input in queries.

Unfortunately the basic PHP structure is borked, and even within the context of a framework noob coders can do incredibly stupid things.

Re: Coding Horror: The PHP Singularity

#32

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.

That's nice, if you get lucky and/or you are young and able and willing to move anywhere you want. I have a CS degree, am reasonably proficient in Python, want to be better with Java, but ever since an internship in college have worked, at least professionally, exclusively with PHP.

You (General you) get companies to hire experienced PHP Devs , even as entry level for other languages and I'll be there in seconds. However, all the jobs I see require 3+ years with that language.

Re: Coding Horror: The PHP Singularity

#33
post #17
post #15

Earlier quoted context omitted.

The "problem" is that PHP's popularity breeds more popularity, uninformed choice, and single-language programmers that only know PHP (a real tragedy!). Bashing PHP is in a serious sense a public service if it can reduce any of these outcomes.

So, the problem with PHP is that it is popular? I guess it was the same crime that Java committed 10 years ago. And C++ before that. Makes sense - There's definitely a pattern of bashing the popular languages.

The problem isn't that it's popular - television programs about Bigfoot are popular, too. The problem is that PHP is extremely useful and easy to use in addition to being widely used.

Reading the article, I was struck by its similarity in structure and language to classic Windows bashing rants of the past two decades - i.e. "the problem with PHP is that it has no taste." In fairness, the call to action is radically different; to build rather than to buy something.

Re: Coding Horror: The PHP Singularity

#35
I've been coding for nearly 30 years and have seen this rant for every major language I've coded in. The reality is there is no perfect tool even in construction as Jeff tries to draw parallels to you will find that many different tools are required for many different situations. Often a hammer can be used to make a hole in a wall and other times you use a saw to cut a nail head off and just pound it into the wall because your hammer has a broken claw!

Tools evolve over time and saying screw drivers are useless and everyone should use a battery powered screw driver doesn't change the fact that a screw driver drives screws.

If you don't like the tool move on to other tools or make your own and get people to adopt them. Don't bash the brilliant people who worked hard to make the tool in the first place.

My father is 71 years old and codes in PHP! He was never going to learn python, ruby or anything else but PHP was approachable for him. Provide a language with that low barrier to entry and let's talk. Meanwhile I love my dad but we won't be writing the next google and that's ok by him and I both. If he wants that he'll ask me to write it in COBOL! :-)

Re: Coding Horror: The PHP Singularity

#36
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…

It's true that PHP gets the job done, that it's easy to learn and very easy to set up. This makes for a perfect "introduction to the web" language.

Which is why I began developping websites with it. But at some point, I felt like it was preventing me from really understanding what was going on behind the scenes, and I moved away from GRails and now nodejs.

I don't hate PHP but I think Jeff's last point is good: we need framework as easy to learn and setup, but that lets you understand how the web really works.

Re: Coding Horror: The PHP Singularity

#37

Oh great. Another PHP article, where we get to watch all of the defenders of Rasmussen's misbegotten spawn come out from under their rocks... "PHP works great for me! It runs tons of websites! I don't know what you're complaining about..." To address the article's point somewhat - there are already easy to deploy frameworks and languages for the web, and everybody who cares about development is already using them.

everybody who cares about development is already using them.

Even if we take that statement as given, what about everybody who doesn't care about development? Most modern frameworks take it as given that you are (or at least aspire to be) a fairly serious web developer interested in serious web development and are willing to learn a bunch of fairly abstract concepts up front about structuring and deploying apps. Until a framework comes along that assumes non of those things, php won't be replaced. Imagine your user is a domain expert in an area totally unconnected to computers or programming, but has managed to learn a bit of HTML and now needs to put together a site. What current framework targets this particular use case?

Re: Coding Horror: The PHP Singularity

#38
post #19

PHP is broken in many little aspects but if you use a high quality framework, it's quite enjoyable to work with. The main gripes I have with it are in the details, like: You can't do: $something->doStuff()[0] if(empty($something->doStuff())) Overload fucking functions. Fuck. What sucks: The namespace separator. The naming conventions of the core functions. The speed. But, overall it works and elegant solutions can be…

PHP has array dereferencing, closures, and array short syntax since 5.4.

  $func = function() { return ['a', 'b', 'c']; };
  echo $func()[0];

Re: Coding Horror: The PHP Singularity

#39
post #6

Earlier quoted context omitted.

Hey, at least he's not just ranting like everyone else; he's trying to bring forward a better alternative. I'm also a PHP dev and I think Python is the safest bet, since it has good support on all platforms already (including Windows).

It read like a pretty vanilla rant to me.

Probably because you did not read the last part of the article where he says that he's trying to build a better alternative.

Re: Coding Horror: The PHP Singularity

#40
From the post:

> build compelling alternatives and make sure these alternatives are equally pervasive, as easy to set up and use as possible.

A bite later:

> We've got a long way to go. [...] The best way to fix the PHP problem at this point is to make the alternatives so outstanding that the choice of the better hammer becomes obvious.

Basically, Jeff just agreed that PHP is simply better than the rest. The problem is that he cannot accept that thanks to PHP anybody can code something pretty fast. I am always amazed when I see my brother, without programming knowledge improving his wife website like gardening. Small changes here and there. End at the end the website is making money. He never complained about the "awfulness of PHP".

Post reply on HN