Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

291–300 of 346 posts

Re: PHP is much better than what you think

#291

Earlier quoted context omitted.

Not to be a hater, but what's funny about that? The point is exactly that. Most people don't care about "blazing fast".

Right, most people who decide to use PHP aren't overly concerned about performance. And the folks who are concerned about it tend to choose other solutions (say, node.js, for example). The funny part is that it's fairly easy to take even bloated PHP apps like wordpress and turn them into high performance sites on very modest hardware.

When you're putting Varnish in front of static content, it doesn't really matter what the backend is, it's going to fly.

Re: PHP is much better than what you think

#292
post #109

Earlier quoted context omitted.

What's wrong with array_keys? It's extremely useful. Java has keySet(), Ruby has hash.keys, etc. Your second argument is even dumber. Yes, PHP lets you do lots of things, which improve the speed of development. If you don't like it, don't write it that way.

I wouldn't pick on the example, but you've made me curious: how does it improve the speed of development to have array("a" => "green", "red", "blue") ?

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.

Re: PHP is much better than what you think

#293
post #54
post #49

Earlier quoted context omitted.

It's a bit of a Catch22 as well. We switched to using PHP for our agency client work because it was easier to hire developers. Not only that, but clients actually ask for it by name (and we lost a number of jobs because we didn't want to use PHP). The cycle continues.

I don't mean to belittle you or anything like that, but isn't it your job to consult the client on the best tool for the project? If they are adamant on using PHP, when it's clear PHP isn't suited, perhaps that implied an awkward client.

Choosing the "best" platform for the client has both a technical aspect and a financial aspect. In most cases that I've seen in my 20 year career we probably could have gotten the job done with nearly any technology. The choice was ultimately down to whatever platform was most comfortable for the developers or, to be honest, just plain snobbery on the part of one or more of the team.

Of course there may be an ideal platform from a technical sense. I may have a project and I decide that it's 100% ideally suited for Scala. Using PHP may be only 85% ideal. However, is that really best for the client? Are they going to be forced to blaze new trails for things that are already solved in PHP? Is the client going to be able to find Scala developers when we leave? How about in 5 years? How much are they going to pay for that? Is it worth the 15% of efficiency that was gained?

There is no real correct answer here, but I guess my point is that when you are talking about what's "best" for the client, it's not always just a technical question.

Re: PHP is much better than what you think

#294
post #135

Earlier quoted context omitted.

> Moreover, it should not take you more than a couple of weeks to learn any language This is why I find the "you can't find Ruby/Python/whatever developers" argument unconvincing. If you're a good software developer, you can learn new languages. You like learning new languages. It's only the crap developers who typecast themselves in one role throughout their career. And while I don't believe in all the nonsense abou…

You can, but I think the benefits are vastly overestimated. Languages are tools and the purpose of engineering is building, not having a tool fetish. This doesn't mean one should use bad tools, but when learning new frameworks or languages I almost always feel like I am wasting time. The innovative ideas in programming language design are few and have been known for many years. Learning Ruby or Python instead of let'…

The innovative ideas in programming languages design may have been known for many years, but at least half are cleverly not incorporated into mainstream languages like Python or Ruby, and don't get me started on Java.

Language design, more than anything, seems to be a field where using actual academic research is passé. C# seems to be the one rare exception among the popular languages. On other platforms, the innovative ideas are all stuck in less popular languages like Scala, OCaml or Haskell.

Re: PHP is much better than what you think

#295
post #64

Earlier quoted context omitted.

A couple people I know well spent the summer there (I actually visited one at the old headquarters; it was pretty cool). One now works there full time (the other hasn't graduated yet). I also talked to some fulltime engineers who were not using PHP. Now, it's reasonable that I did not get the full picture, but the people I did talk did not use PHP themselves and claimed that new projects didn't either. Perhaps this v…

Interesting. What were they using, C++? I've heard about D...

The particular people I talked to were using C++. But I think there is even a team using Haskell for some internal tools :).

Re: PHP is much better than what you think

#296
post #12

I'd stay away from a language that has function names like array_keys or allows you to write array("a" => "green", "red", "blue");

I find PHP's arrays amusing. It's as if Rasmus couldn't decide whether they should be associative or indexed, so he made them both. Although I suppose, strictly speaking, JavaScript has the same thing. (not intentionally, but you can make an array that is both if you really want to)

It's not a bad thing itself to make "arrays" work like that, except, you can't call them arrays then.

For example, Lua uses a similar approach ("tables") and works just fine. AFAIK, it does certain optimizations under the hood to make sure numerically indexed tables behave efficiently (like arrays). Maybe PHP does the same thing, but its terminology is confusing.

P.S.: I dream of a future where Lua is the primary tool for web development. It's perfect for that purpose as a language, but unfortunately, lacks the necessary ecosystem :(

Re: PHP is much better than what you think

#297

"PHP is the best web platform ever", because it (finally) has a decent package manager. And don't mind that far fetched statement, the author will surely delete any rude comments. Congrats, PHP has a package manager. This does nothing to shake my feeling that PHP's most ardent advocates have little hands-on experience with the more full-featured alternatives. You know, like the ones that also have decent package mana…

What do you mean by "more full-featured alternatives". To me the main webdev languages look about the same when it comes to the major features that have a noticeable impact on a project. e.g: few projects are affected by the lack of closures And all the talk about real this and real that. I don't think projects become more real when they're written in Ruby or Clojure. They're real when they work and are useful to the…

> To me the main webdev languages look about the same when it comes to the major features that have a noticeable impact on a project. e.g: few projects are affected by the lack of closures

Someone needs to read Paul Graham's essay about "the blub paradox"

I can tell you that the quality and ease of use of your web framework/libraries is highly affected by the lack of closures and other higher level language features. Even if you don't use them, your library developers have more tools and more flexibility.

Re: PHP is much better than what you think

#298

Hacker News really doesn't like PHP. There's a whole lot of blind prejudice in this thread Arguments against PHP are as futile as arguments in support of PHP. It's a programming language. The only thing that matters is the person using it. I'm sure Ruby, Node and Go are super duper awesome in a lot of academic ways, but unless we're talking about awesome things that have been made with them, it's just blah blah blah…

> I'm sure Ruby, Node and Go are super duper awesome in a lot of academic ways

I find Hacker News loves PHP in comparison to most places developers hang out. Mostly because of the prevalence of the kind of anti-intellectualism on display in your comment.

Some of us have used PHP for years AND many other languages and have a basis for comparison.

Re: PHP is much better than what you think

#299
post #255

Earlier quoted context omitted.

>Hacker News really doesn't like PHP. There's a whole lot of blind prejudice in this thread PHP apologists make this claim every time PHP is mentioned here. And yet the threads are always full of these apologists, claiming PHP is awesome because facebook uses it, or because every cheap shitty webhost has it installed. Never making any actual argument that PHP is good, or rebuttal to the numerous arguments that PHP is…

> And yet the threads are always full of these apologists, claiming PHP is awesome because facebook uses it, or because every cheap shitty webhost has it installed. Never making any actual argument that PHP is good That is the argument. PHP is good b/c it allows a lot of people to be productive. C is probably a better written language then Ruby, but it doesn't matter b/c if you're doing web development you're not goi…

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?

Re: PHP is much better than what you think

#300
post #31

I am so sick of this kind of talk. What language do you like to code in? Really? That's great. Now shut up and go code in it. What difference does it make to you that I use PHP, Ruby or original ASP? My website achieves the result I desire. I chose the programming language I use because of reasons that made sense to me and my project, not because I want the approval of a bunch of hipster start-up kids.

Mate, nail on the head. The way I see it, is if the final item is as you've envisioned it, what difference does it make what it's written in?

> what difference does it make what it's written in

Tell me you believe that after you've both maintained a project for years as it evolves and had to hire a team to maintain and extend it.

And done this multiple times with different languages.

Damn, the language ecosystem and surrounding community are in the top 3 things that matter most.

Post reply on HN