Live data from Hacker News

PHP Sucks, But It Doesn't Matter

codinghorror.com

51–60 of 112 posts

Re: PHP Sucks, But It Doesn't Matter

#51

Things that don't matter: - OS - Language - Compiler - Runtime - Editor - Testing process - Deployment process - Bug management systems The thing that does matter: - Building something successful that people want Frankly, I don't care what language you used to build it. I don't care what shoddy infrastructure supports it. I don't care what hacks you put into place to scale that infrastructure. You know why? Because y…

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.

Re: PHP Sucks, But It Doesn't Matter

#52
PHP is the textbook example of worse is better. It shows two important things:

1. The success of a programming language has nothing to do with elegance and everything to do with raw capability, ie. what does the language make dramatically easier.

2. Technical warts will not prevent great things from being done in a language. It's certainly true that Haskell will not allow you write as broken a piece of software as PHP, but in many cases you can write something just as elegant in PHP as you can in Haskell (laziness/pattern-matching/type-inference notwithstanding).

Now, personally I will do my best to ever write any PHP again, and if someone asks me my opinion I'll tell them that I believe using PHP exclusively will stunt your growth as a software craftsmen. But those are just opinions. I don't feel the need to go out and advocate against PHP because the software communities where I devote my attention are doing just fine. If somebody likes PHP then more power to them, it certainly won't prevent them from doing great things.

Re: PHP Sucks, But It Doesn't Matter

#53
post #22

The article claims that YouTube is written in PHP. As someone who worked there, I can tell you it's not. YouTube is written mostly in Python plus some Go. Some of it is a mess, but that's beside the point.

Youtube was first launched using PHP but ported to Python around the time this article was written, if I recall correctly. Having trouble finding a source - best I can do it second hand on Quora - http://screencast.com/t/NZD0KIHdF / http://www.quora.com/Is-YouTube-still-written-in-PHP/answer/...

Re: PHP Sucks, But It Doesn't Matter

#54
post #13

Earlier quoted context omitted.

You're missing the point. PHP works. A priori arguments from faults in the language don't explain its success. Replaying that old record doesn't add anything to What We Already Know. Also: I didn't say that Javascript is different - I'm talking about the curmudgeons in comp.lang.js who argue that the practical benefits of using a JS library are outweighed by their flaws. This is clearly dis-proven by their popularity…

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.

Re: PHP Sucks, But It Doesn't Matter

#55
post #49
post #6

Earlier quoted context omitted.

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? They absolutely would. Building an actual application is a hard problem; a lot harder than the kinks of individual programming languages. Whichever tools you choose it is never going to be an easy ride. Anyone who has written, deployed or maintained a large scale application of the sort listed there knows this. It's the step afte…

Building an actual application is a hard problem.

It is. Which is why you can't afford to have the challenges of building something non-trivial compounded by the frustration of working in a broken language. If you're just slapping together another spaghetti CRUD app maybe you don't suffer enough to care.

I wonder if people in other engineering disciplines defend broken practices so irrationally. I suspect they don't have the luxury.

Re: PHP Sucks, But It Doesn't Matter

#56
post #37
post #34

Earlier quoted context omitted.

You chose python for its performance ? Well, I guess it's no Ruby.

[As only a novice could...] But yeah, I've only recently gotten back in to Ruby because performance be damned, it's fun in its own way (to someone who doesn't do any programming for a living at least). Edit: though I'll freely admit that for my purposes, performance has yet to be much of an issue.

There is really nothing wrong with Python performance-wise, the bigger issues will be things like the speed of your database, what kinds of caching and algorithms you use, etc.

Maybe worry about recoding the whole thing in ASM (or something equally macho) when you find that you have a good working idea which is only really hampered by time differences measured in ns.

Most web apps do not require you to carry out ray tracing. For typical cases Python can indeed be pretty fast.

If you have the most fun using Ruby then use it, life is short

Re: PHP Sucks, But It Doesn't Matter

#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 you can FTP to the server and start adding arbitrary code to a static html file by adding a single tag. Other frameworks deliberately makes this more complicated with more overhead, because they want to promote a better architecture with separation of concerns and so on. Basically these frameworks have "encoded" the waterfall-method, because they assume you know from the start that you need a complex site. PHP supports iterative improvement from the simplest site (static HTML files on a server) to arbitrary complex code, without requiring major speedbumps where you have to rethink the whole app.

This also mirrors how many web developers have learnt to code - starts out with making html/css, then gradually learn php by inserting simple snippets of code to make banner rotate and so on. (The "right way" of course would be to take a pause for a few years to get a CS degree before adding the banner rotator.)

When an app grows beyond a certain level of complexity, changing to a better platform might improve quality, but then you have already made an investment in existing code.

Re: PHP Sucks, But It Doesn't Matter

#58
PHP is like English: a mutated fugly cockroach of a language that defies logical explanation, contains more exceptions to any syntax rule than the rule covers and yet its very ugliness is also its strength: you can always, always find someone who can work in it.

Don't underestimate how useful it is that anyone can come along and hate your codebase just as much as you do in a very short period of time.

Re: PHP Sucks, But It Doesn't Matter

#59
post #49

Earlier quoted context omitted.

Ask yourself this: would the Instagram team have been as successful had they chosen PHP? They absolutely would. Building an actual application is a hard problem; a lot harder than the kinks of individual programming languages. Whichever tools you choose it is never going to be an easy ride. Anyone who has written, deployed or maintained a large scale application of the sort listed there knows this. It's the step afte…

Building an actual application is a hard problem. It is. Which is why you can't afford to have the challenges of building something non-trivial compounded by the frustration of working in a broken language. If you're just slapping together another spaghetti CRUD app maybe you don't suffer enough to care. I wonder if people in other engineering disciplines defend broken practices so irrationally. I suspect they don't…

PHP has its frustrations. It's not outright broken.

But my point was that all other programming languages suffer their own "broken" problems. I managed a team working in Ruby not long ago; they had no end of gripes and frustrations.

The key point is that compared to the challenge of building a complex application, those "difficulties" are trivial. And once you are at that stage, anyway, you're so used to the way your chosen language works it doesn't matter.

These are not constraints on what the language can achieve or do and simply require knowing about them so that you don't paint yourself into a corner.

Because application design is a hard problem it doesn't matter, given a relatively skilled team, what language is chosen.

This is identical in other engineering disciplines; a friend of mine works in motor design (electrical motor) and is constantly griping about nuances in the tools and equipment. Same issues.

Re: PHP Sucks, But It Doesn't Matter

#60
post #13

Earlier quoted context omitted.

You're missing the point. PHP works. A priori arguments from faults in the language don't explain its success. Replaying that old record doesn't add anything to What We Already Know. Also: I didn't say that Javascript is different - I'm talking about the curmudgeons in comp.lang.js who argue that the practical benefits of using a JS library are outweighed by their flaws. This is clearly dis-proven by their popularity…

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 web applications only recently became easy to install, and they didn't beat 'ftp into the site and drag files over' until cloud platforms and virtualization.

Post reply on HN