Live data from Hacker News

Coding Horror: The PHP Singularity

codinghorror.com

161–170 of 341 posts

Re: Coding Horror: The PHP Singularity

#161
post #124

Earlier quoted context omitted.

Hey. I work on Facebook's PHP toolchain, HipHop, which these days includes a debugger, interpreter, JIT compiler, and the ahead-of-time compiler. The fact that the AoT compiler uses C++ as a target doesn't change the input language, which really is PHP. E.g., $i = 0; $a[$i] = $i++; makes a different array than $i = 0; $a[$i + 0] = $i++;. We have to get all the nooks and crannies right because we use significant open…

I have to ask, because it's really been getting at me for a while honestly. How do your developers react to that? I mean, you guys are known for going after the best and the brightest. People who have worked hard to perfect their craft. These people tend to have strong opinions when it comes to language design. How do you get them from that point to "ok, now write some php code" ?

That's easy: the best recognize languages are just a means to an end. Language snobbery, in my experience, tends to be highly correlated with being a "wannabe" rather than "great" and a useful filter.

You will find any number of C/C++ programmers who think you can't write anything in Java. Many Java programmers think you can't write anything (beyond 100 lines) in Python. Many Python programmers think you can't (or simply shouldn't) write anything in PHP. And so on.

Some people are insecure.

Some people can't separate their language from themselves (and see a criticism of their language as a criticism of them as people).

Some people exemplify the Dunning-Kruger effect [1].

Some, like teenagers, are just asserting their identities.

Some simply have biases that are mental blocks.

[1]: http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

Re: Coding Horror: The PHP Singularity

#162
post #124

Earlier quoted context omitted.

Hey. I work on Facebook's PHP toolchain, HipHop, which these days includes a debugger, interpreter, JIT compiler, and the ahead-of-time compiler. The fact that the AoT compiler uses C++ as a target doesn't change the input language, which really is PHP. E.g., $i = 0; $a[$i] = $i++; makes a different array than $i = 0; $a[$i + 0] = $i++;. We have to get all the nooks and crannies right because we use significant open…

I have to ask, because it's really been getting at me for a while honestly. How do your developers react to that? I mean, you guys are known for going after the best and the brightest. People who have worked hard to perfect their craft. These people tend to have strong opinions when it comes to language design. How do you get them from that point to "ok, now write some php code" ?

I'm not the best and the brightest, but I'm sure the people they are going after are more excited and concerned with the quality and quantity of problems that facebook is in the unique position to solve. They could probably care less what they use to solve said problems.

Re: Coding Horror: The PHP Singularity

#163
post #50

Earlier quoted context omitted.

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 d…

Well, I doubt it would ever become popular if it wasn't useful and easy to use. Actually, I think it is exactly because it's popular. All languages have odd ends, but you rarely hear people rant over Pythons lack of lambdas and weird explicit "self" parameter or Ruby's incomprehensible scoping rules. I'm betting that once they fall out of fashion, we will. And no, I disagree. The main sentiment of the article is nega…

>"Well, I doubt it would ever become popular if it wasn't useful and easy to use."

Like Windows 3.1?

Re: Coding Horror: The PHP Singularity

#164
post #50

Earlier quoted context omitted.

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 d…

Well, I doubt it would ever become popular if it wasn't useful and easy to use. Actually, I think it is exactly because it's popular. All languages have odd ends, but you rarely hear people rant over Pythons lack of lambdas and weird explicit "self" parameter or Ruby's incomprehensible scoping rules. I'm betting that once they fall out of fashion, we will. And no, I disagree. The main sentiment of the article is nega…

I hear about them a lot. The difference is that PHP is so much worse. Yes, every language has warts. But PHP is the only popular language I know of which is essentially nothing but warts.

Of course that's subjective, and people disagree, but there really does seem to be a real, qualitative difference between the warts on a mostly nice language like Python, and the ubiquitous bizarro world that makes up just about the entirety of PHP.

Re: Coding Horror: The PHP Singularity

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

"And people find all sorts of real criticisms in the process - yet none of them matter!"

I'd like to mention something similar that I found in human behavior with respect to manufacturing jobs that we used to do for customers at a company that I was at. What we found was that people had 1 or 3 major complaints about something that were pretty valid. But what they did then was feel that they needed to build a strong case so they ended up coming up with as many nits as they could to build their case as if that somehow made the true concerns stronger. Just my experience but I have found that if you have a true concern about something to simply focus on trying to get that fixed. If you throw everything in the other party sometimes feels that they will never be able to please you and then they don't even try to fix anything. YEMV.

Re: Coding Horror: The PHP Singularity

#166
post #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 be…

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.

He's been an HTML coder for about 10 years doing sites with front page and other html authoring tools.

Him figuring out is fairly easy when he already understands html.

Re: Coding Horror: The PHP Singularity

#167

PHP is basically the latest example of "Worse is better"( http://en.wikipedia.org/wiki/Worse_is_better ). ---- Simplicity: The design must be simple, both in implementation and interface. It is more important for the implementation to be simple than the interface. Simplicity is the most important consideration in a design. Correctness: The design must be correct in all observable aspects. It is slightly better to be…

The API is what it is, but the real biggest problem with PHP is also it's biggest feature: it's got the lowest barrier to entry of any server-side language.

The result is that a lot of PHP is awful, cargo-cult stuff glued together by people who have no idea what they are doing.

It's possible for talented developers to create really good programs in PHP, but I don't see how a new language is going to solve the essential problem. People who don't really know how to program and just want to accomplish some simple goal are going to use whatever language is the quickest means to their ends.

Copy/paste spaghetti is a nightmare to maintain in any language. And the people creating it are the same people who are /not/ going to read Atwoods post, don't understand very much about how programming works in general, and will continue to create cruddy programs no matter what language it is written in.

Re: Coding Horror: The PHP Singularity

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

Write a multi-threaded program in PHP, I will write one in ... well pretty much anything else.

That's not a problem though, is it.

Re: Coding Horror: The PHP Singularity

#169
post #124

Earlier quoted context omitted.

Please don't use Facebook as an example, the fact they gave in and built HipHop to get it into C++ spoils it. Are they coding in PHP? Sure! Are they actually using it like it's meant to be used? Not quite!

Hey. I work on Facebook's PHP toolchain, HipHop, which these days includes a debugger, interpreter, JIT compiler, and the ahead-of-time compiler. The fact that the AoT compiler uses C++ as a target doesn't change the input language, which really is PHP. E.g., $i = 0; $a[$i] = $i++; makes a different array than $i = 0; $a[$i + 0] = $i++;. We have to get all the nooks and crannies right because we use significant open…

I should have expected someone with more knowledge of the system on HackerNews :)

What I mean is that whilst you guys at Facebook are using PHP you're not using it in the sense of 'we write code anywhere and deploy it anywhere'. There's an additional build step in between the developers and the final product, rather than just straight up serving PHP as is which is one of the biggest PHP recommendations. Although HipHop is open source so I guess you could still say it's within reach of all developers.

Re: Coding Horror: The PHP Singularity

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

> One thing that's wrong with PHP is all the bloated OO mega-frameworks people create on top of it to try and make it Java, Rails, whatever...

The thing that really fries my brain is templating systems built over frameworks -- PHP is already a templating system, and building another one in PHP is just silliness of the highest order. I mean, sure, separate out the gnarlies and include or require them as necessary (but, please, don't nest includes so deeply that you can't find anything anymore), but don't throw away what the environment provides just so that you can reinvent that particular wheel.

Post reply on HN