Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

311–320 of 346 posts

Re: PHP is much better than what you think

#311

Earlier quoted context omitted.

PHP allows a lot of people to be productive. Python/Ruby/whatever language higher up the power curve allows fewer people to be more productive. Is it really that hard to understand that different levels of expertise suit different tools?

Then these threads are like carpenters arguing that hammers are stupid because we've invented nailguns.

They are, a bit. There are also poorly made hammers in this analogy as well.

The big difference is you don't have people in professional carpentry forums arguing that hammers are better or just as good as nailguns and if you disagree then you are an anti-hammer elitist. But our professional is a young one in more than one way.

Re: PHP is much better than what you think

#312

Earlier quoted context omitted.

> (heck, why do I need to call 'php composer.phar' instead of 'composer'?) You can. http://getcomposer.org/doc/00-intro.md#globally $ curl -s http://getcomposer.org/installer | php $ sudo mv composer.phar /usr/local/bin/composer $ composer --version Composer version 6573fd3

right. I could write a short shell wrapper as well - but why do I have to? I don't have to with pip or bundler.

Uh, no. See, those instructions are from the getting started page. Why do you have to? Because, you can install composer just by downloading it and running it. You dont need to "install" it. This is handy on shared hosting environments where you won't have root.

How can I install bundler on a shared hosting environment like composer?

Re: PHP is much better than what you think

#313

Earlier quoted context omitted.

Honestly, and with complete sincerity, that just means you're a bad programmer. It has nothing to do with the language. And trying to correlate the two is makes you look even worse.

Did you mean to reply to a different comment?

No. Why do you think the parents sample code is an example of quality code?

Re: PHP is much better than what you think

#314
post #227

Earlier quoted context omitted.

Ummm... I think you are missing my point. That's an SGML document. It doesn't matter where the PI tag is, or what is in it, it's an SGML document. ' fun stuff here ' ?> That's still an SGML document. # logic goes here ?> That's an SGML document. This is not splitting hairs. The reason is relatively subtle.... When you are doing SGML stuff an extra newline or a space in front of the opening tag really doesn't have any…

You are making little to no sense. Sorry, but I've got to give up on this thread.

You are looking at it from the interpreter's perspective. I am looking at it from a document semantics perspective and what this means for more complex application environments.

Let me give you an example.

Suppose I have a GUI application that prints some XML fragments to standard output. The most natural way to do this in PHP is to write an XML pre-processor which happens to make decisions based upon operations in the GUI. In other languages you would print to standard output explicitly and the GUI would be primary. In PHP the XML output would be primary and the GUI would be secondary.

In fact your entire GUI is sort of contained in XML fragments to start with.

Re: PHP is much better than what you think

#315

Earlier quoted context omitted.

I'll be intellectually honest and admit that, no, I haven't really touched PHP for anything near a production app in the last 5 years. But to be absolutely clear: before PHP used to be the only language I wielded for money. I have enough lines of PHP on my back to claim the right to an opinion. That said, last time I looked into PHP, modus operandi seemed to being focusing on making things easy, not making it easy to…

HTML also chugs along at all costs: You don't have to close tags,. You can add(misspell) unknown attributes to tags. works the same as You can have multiple tags with the same ID field. You can do ALL that and your page will still render, and probably look just fine. That's a major reason why the web took off. Because it didn't take perfection to get something done. Anyone that wanted to make a webpage could fumble a…

Hey now, I still have my CueCat... I hacked it to work as a standard barcode scanner.

Re: PHP is much better than what you think

#316
post #305

Earlier quoted context omitted.

Using intern developers to write PHP. I really hope you're using a framework, because that above sentence is a recipe for disaster.

No, we're using careful project management, code reviews, the interns are very happy because they're learning a lot, and the code is tolerable. Code elegance doesn't put food on the table, anyway.

Actually that sounds fine. Good they are learning.

Re: PHP is much better than what you think

#317

Earlier quoted context omitted.

Did you mean to reply to a different comment?

No. Why do you think the parents sample code is an example of quality code?

I think there's a grammar problem with "that means you're a bad programmer".

Anyway, that's a joke implementation of the Y combinator[1] in PHP.

[1] http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combin...

Re: PHP is much better than what you think

#318
post #24

Earlier quoted context omitted.

I very specifically didn't say that PHP couldn't be used to build real products, but that still doesn't (at least on it's own) make it good or make it the best.

I guess the worlds most popular websites, and the vast millions of PHP programmers must all not really exist. They can't exist, and can't be making good stuff, because PHP is just doesn't work. Here is a list of template languages people on 'real' platforms use: Python. Airspeed, Castalian, Chameleon, Cheetah, CubicTemp, Django template system, Elements, EmPy, Evoque, HRL Powerful macro preprocessor for HTML, Genshi,…

> You could walk outside now, and start yelling "I NEED A PHP PROGRAMMER!" and you'd probably find someone pretty quickly.

This is something that I point out as a negative. Yes, you can get a PHP programmer just about anywhere. But being that there are so many, it's harder to find those few truly talented programmers.

My own complaint about this is that if you bring in cheap PHP programmers, you end up with cheaply-written PHP. And the result is inevitably an unmaintainable mess. If you want well-written, maintainable code, you have to be willing to hire talented and experienced programmers. And in doing so, you give up that so vaunted "advantage" of PHP's mindshare.

Moreover, it seems to me that the truly talented programmers that would produce good software have a tendency to distance themselves from PHP.

So it seems to me: Choose PHP for cheap, quick projects on a budget for which quality is irrelevant; or choose a "harder" language for solid applications that will stand the test of customer interaction.

Re: PHP is much better than what you think

#319
post #292

Earlier quoted context omitted.

This is just a side-effect of the fact that arrays in PHP are also hash-maps. That improves the speed of development, not your example.

And you think it's a good idea to have arrays be also hash maps?

As long as you're aware of it.

Re: PHP is much better than what you think

#320

Earlier quoted context omitted.

See my clarification. I think I may have been a bit unclear and/or you may have misunderstood my post.

Talking about the PHP of 2006 and then blasting the PHP of 2012 is like talking about George W Bush and then blasting President Obama. They're almost completely different language, and while PHP 5.3 certainly has warts it's vastly better than PHP 5.0.

Surprisingly, out of all the comments, this one caught my eye. I've been hiring programmers since 2005 that have to maintain or extend PHP systems. In 2005, it was difficult to find programmers that knew only PHP (or Perl, which was still used) who had any familiarity with object-oriented programming. Over time, PHP has bolted on features, and at each point, the vast numbers of available PHP programmers are (understandably) not familiar with those features. And obviously the systems that have to be maintained don't have these features. So the armies of PHP programmers are well matched to the old systems. This eliminates a huge risk to the business -- finding relatively inexpensive developers. This is an often cited advantage of PHP. But only the PHP of 2007 (or so) is relevant.

The PHP of 2009 might be worthwhile for the creation of business value (and possibly the reduction of maintenance-related risks), but as I said, the easily available programmers have no experience in those features or concepts. The more common scenario is that a particular programmer has experience in some other language that already included those features and doesn't mind working on old PHP systems. Believe me, there are not legions of these people.

And regarding the 'PHP of 2012', the major problem isn't the availability of programmers who have experience in the new features (they almost don't exist). It is the availability on distros stable enough to support an SLA or provide a modicum of security assurances. This problem applies to all languages though. I'm just pointing out that the 'PHP of 2012' is not as much of an option as it may appear.

Post reply on HN