Live data from Hacker News

PHP Sucks, But It Doesn't Matter

codinghorror.com

91–100 of 112 posts

Re: PHP Sucks, But It Doesn't Matter

#91

Earlier quoted context omitted.

> Ask yourself this: would the Instagram team have been as successful had they chosen PHP? I think not. I chuckled a little bit when I read this. I like video games, so I'll make a video game analogy. I'm playing a lot of BF3 right now, so let's run with that. A website called Symthic publishes a list of damage and ballistics information [1] for all the weapons in BF3. They also publishes TTK (time-to-kill) informati…

In every field of human endeavor where competition is extremely intense you'll find professionals optimizing their gear down to the last trivial detail. I very much doubt at professional gaming tournaments you'll find serious contestants using anything but the optimal weapons. Nobody's saying you can't build app X in PHP, but it's likely that your competitor using a better language will get there first. If you disagr…

Nobody disputes "that a good tool can give you a competitive advantage". What's at dispute is whether other things, such as skill or tacit knowledge in a field, give you greater advantages than this possibly over-optimized tool selection.

Also, why should anyone take your unproven assertion up with Paul Graham? His essays don't support your insistence that the "better" tool wins. On the contrary, I'd argue PG believes a whole host of factors contribute to success before optimizing tool selection down to the last detail.

Re: PHP Sucks, But It Doesn't Matter

#92
post #86

The religious wars over the interpretation of languages needs some serious self-reflection. There is so much confusion between a language and a framework. Blindingly. The religions of one language compare their experience, due to a framework, with another language without using a framework. How does this make sense? As a non day to day PHP developer: - The Web, as a platform is relatively a baby, compared to platform…

[deleted]

Re: PHP Sucks, But It Doesn't Matter

#93
post #48

Earlier quoted context omitted.

Are you serious? PHP is not "tray full of old rusty instruments". Please give me one concrete example what is wrong with a blog running on PHP. Or a small store? How is the END result differ between say Magento or something running on Django? Could you tell the difference? No, you could not. And while the PHP version would have been up and ready, you would still try to figure out how to properly run WSGI server in sh…

> Please give me one concrete example what is wrong with a blog running on PHP. Or a small store? How is the END result differ between say Magento or something running on Django? Could you tell the difference? No, you could not. I think I could, pretty often at least: http://duckduckgo.com/?q=wordpress+%22hacked+by%22

Right, because no other language is hackable.

https://github.com/rails/rails/commit/b83965785db1eec019edf1...

Re: PHP Sucks, But It Doesn't Matter

#94
post #48

Earlier quoted context omitted.

Are you serious? PHP is not "tray full of old rusty instruments". Please give me one concrete example what is wrong with a blog running on PHP. Or a small store? How is the END result differ between say Magento or something running on Django? Could you tell the difference? No, you could not. And while the PHP version would have been up and ready, you would still try to figure out how to properly run WSGI server in sh…

> Please give me one concrete example what is wrong with a blog running on PHP. Or a small store? How is the END result differ between say Magento or something running on Django? Could you tell the difference? No, you could not. I think I could, pretty often at least: http://duckduckgo.com/?q=wordpress+%22hacked+by%22

Should languages be required to ensure the security of the code produced for them?

IMHO this is more of a complaint about the security of Wordpress, not the PHP core. People love to bring up phpBB or Wordpress in these discussions, but there are many, many more systems using large-scale PHP about whose security you just don't hear, because they are coded by professionals who know how to produce secure code in PHP.

Re: PHP Sucks, But It Doesn't Matter

#95
post #81
post #32

Earlier quoted context omitted.

Ask yourself this: would the Instagram team have been as successful had they chosen PHP? I think not. Why not? You do realize the "team", facebook, that acquired them (worth many multiples of them at the time of acquisition) is a PHP-based company right?

The interesting thing to ask should be if Facebook or Wikipedia's engineers would use PHP if they had to start from scratch. I used PHP for a big project before for legacy reasons but I wouldn't choose it for anything new even with a machine gun pointed to my manly parts. Neither would I use Java or VB for that matter.

Facebook and Wikipedia (and Wordpress) were born outside the software engineering establishment using lowest common denominator tools [1]. There's a reason for that: LAMP/WAMP has an extremely lower barrier to entry. A billion monkeys banging away on typewriters can make world-beating products, even if they don't compare to the works of Shakespeare in terms of literary quality.

Once these products prove themselves in the market then "professionals" are brought in to handle them, and these people probably know and like more refined tools such as Python or Java or something. It doesn't matter what language these new caretakers would choose for a rewrite though; PHP gave their system its first breath and that's how it stays long past the point in the lifecycle where PHP is a competitive advantage.

[1] http://en.wikipedia.org/wiki/MediaWiki#History

Re: PHP Sucks, But It Doesn't Matter

#96

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…

What exactly is the argument that we're having?

If somebody were arguing that a website loses value by virtue of having been made in PHP, all else being equal, you're right, but nobody's arguing that.

If somebody were arguing that PHP should fall off the face of the earth, you would be right to say that this is an awful argument because so many people are already used to PHP and are productive, and learning a new language takes time. And I think not many people are arguing this either.

The relevant argument is, for the sake of maximizing the potential to Build Something Successful that People Want, PHP should rarely be advocated, because better languages and platforms exist. If you come back to me by pointing to Facebook and Wikipedia, I would ask you to explain to me how, given the challenges leveled againste PHP as a language, it could possibly be a preferable language to Python or Ruby.

The only redeeming value of PHP that I can think of is the easy setup. And I don't think that would help Facebook or Wikipedia if they started today (I'll grant you that PHP may have been the right choice given a lack of web frameworks at the time they started, I actually don't know why they chose what they did).

So by this reasoning, unless there can be a list of benefits to PHP that would lead you to believe that it would help lead to Facebook's and Wikipedia's success if they started today, the rest of us are left with the conclusion that, based on these ridiculous deficiencies, there's no reason it could possibly help them and it would probably hamper them. But more importantly, it's a losing proposition to learn and use to start a new project, other than something that's starting small and needs to get off the ground really quick.

Is that unreasonable? Imagine everybody was "doing just fine" making successful websites in assembly? How about a realistic case study: Ok Cupid wrote their own webserver in C++. They still use it because it's not worth redoing their whole infrastructure. But if they started today, they would have used Apache. They don't advocate anybody, themselves included, to write a web server in C++ (edit: today), despite the fact that they're "doing just fine" with it.

So if somebody is criticized for using PHP, and their response is, "Yeah, I know, but it's what I know" that's perfectly fine, learning a new language takes time and it may not be worth it, it's not my place to make judgement calls like that for people. If their response is "Hey man, I'm plenty productive with this, to each his own" imagine if they said that about assembly. Yeah, I guess they could be wired in such a way that it's more productive for them, but it's got to be such an oddball case that it doesn't justify the existence of the language. Yes, part of me wants to live and let live. But I can't sit back and accept this subjectivist attitude toward languages, there's actual reasons a language is good or not.

Re: PHP Sucks, But It Doesn't Matter

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

> What would be fascinating would be an attempt to understand why PHP remains so dominant despite the well-known flaws.

I've actually put a fair amount of thought into this. I've arrived at the conclusion that it's because it ships with the Big Three parts of any web app in a single package: Request/response handler, scripting engine, and template engine. To the novice, there is no distance between the query string in the URL and the parameters available in $_GET and the ability to write those parameters back to the page via . They're all wrapped up in a handy mod_php binary that runs in Apache, and you probably don't even have to do any extra work to get it to run. It Just Works. This has nothing to do with PHP as a language, but it has everything to do with PHP as a web-oriented product. PHP isn't for systems administration, or generalized scripting, or embedding in your game to serve as its scripting engine. It assumes it's web-facing, and that removes a lot of the friction that otherwise trips people up.

What this means is that it's trivial to deploy full-blown applications like Wordpress, phpBB, Joomla, Drupal, and a host of others. They are literally as simple as "unzip this file and go to http://yoursite.com/package. That's huge! As a Ruby web developer, I'm envious of that. I wish I could give people a zip, say "drop this here and unpack it and you're up and running".

PHP is the lowest-user-overhead "make things happen on webpages" language in use right now. This comes with all kinds of downsides which many of us are familiar with here, but PHP's success has nothing to do with the language itself, and everything to do with how easy it is to deploy a full PHP stack itself, and then any PHP application on top of that.

Re: PHP Sucks, But It Doesn't Matter

#98

Earlier quoted context omitted.

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

Sure... when dealing with custom C code and hand-rolled non-vanilla PHP, I can see that happening. Understand that your experience was in the realm of the .01% of PHP usage. 200/req second isn't all that outrageous for run of the mill PHP (depending on hardware) but when you're throwing in custom connector stuff on top of that, yeah, you'll get core dumps. :/

That's all I said though, is that it reminded me of my Java years.

And yeah, connecting to C libs is commonplace in large PHP places. In fact, that's how PHP gets a lot of it's work done to be quick. Your ".01%" is a number you're throwing out of your ass and you know it.

I'm not surveying PHP usage, merely telling my experience. If you work on a website and need to connect to an external system that only has a C lib, guess what? You're going to connect using C libs.

Re: PHP Sucks, But It Doesn't Matter

#99
post #62
post #54

Earlier quoted context omitted.

> 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.

It's the same reason people in any field put down things - they like to feel superior by putting down the tools that others use, thereby increasing their own relative stature.

I hate people who put down people. They're assholes and stupid.

Just kidding dude. I was just joking when I said that. I love coding. I'd fuck a node.js program and even let XML lick my balls at the same time.

Re: PHP Sucks, But It Doesn't Matter

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

90 % of end users wont be even knowing if they used Python/ Django or anything.
Post reply on HN