Live data from Hacker News

PHP Addiction

marco.org

171–180 of 320 posts

Re: PHP Addiction

#171
post #69

Earlier quoted context omitted.

> The only thing actually wrong with PHP, is that it's popular but not cool. Hey now, we're all human. Even engineers. As soon as something becomes popular, it is no longer cool. Cool is the next popular. Cool is being different. That's just how things work. Apache is slooooow (NGINX is cool!). MySQL is retarded (Postgres is cool!). PHP sucks (Python is cool!). Red Hat is lame (Ubuntu is cool!). See a trend? The tech…

I don't know enough about MySQL vs Postgres or RedHat vs Ubuntu to make a point with them, but sometimes it's not about being cool. Apache is a webserver from 1995. It uses a process (sometimes a thread) per request, a architectural decision which made it nearly fundamentally incapable of solving the C10K problem. Only back in January was the Event MPM added (and it's still experimental), allowing you to have many Ke…

You wrote a well thought out response. I owe you a response in kind.

People have a tendency to overrate their rational capacity to reason out a viable decision. While you listed a few solid critiques, the situation is infinitely more complex.

And by infinitely, I do mean exactly that. As in, beyond your capacity to reason it out.

In the end, the only right decision is a decision which withstands the test of time. Both Apache and PHP have done that and continue to do so.

Apache holds 65.5% of the market [1]. PHP holds 77.9% of the market [2].

Those solutions are working, right now, for all of those people. That's reality, not grand "rational, non-masochistic" theories.

[1] http://w3techs.com/technologies/details/ws-apache/all/all [2] http://w3techs.com/technologies/details/pl-php/all/all

Now that we're finished with that, I'm going to enjoy myself.

> a architectural decision which made it nearly fundamentally incapable of solving the C10K problem.

C10K is not a problem and never was. The limiting factor in the overwhelming majority of deployments is the pipe. Apache can saturate the pipe just as well as NGINX. You will saturate the pipe long before you reach 10K connections. Which is why people continue to use Apache. Being technologically superior is pointless when there are no real-world benefits to that technological superiority.

On top of that, Apache's thread model provides it with greater stability. If a worker thread crashes for whatever reason, another will simply spin up. If your NGINX process dies, you'll need to wait until your monitoring solution brings it back up. Which could be a long time.

> PHP is among the worst languages most sane programmers have ever used.

Worse than COBOL? Yes, yes, a fractal of bad design! Except that article was written by somebody who doesn't have much experience in PHP and most of those complaints don't apply to the current stable version. The rest are easily avoided with sane design.

> Python is designed with an emphasis on readability

Was that humor? Python shoves its version of readability down your throat and laughs as you choke on it. Not all of us get off on syntactically significant white-space. In fact, most of us don't. Which explains why Python is so unpopular. But I get, I get it. It's cool.

Re: PHP Addiction

#172

I think the simple problem with PHP is that its dated. Regardless of whether the language has serious flaws or not, the fact is that it takes a lot more effort and code to do the same things that new web frameworks let you do with a few lines of code. PHP is a great way to learn the basics because it doesn't have quite as many abstractions but that leads to slower development times, and plain bad code (insecure) if t…

You have it really wrong. PHP also has really neat new features and great frameworks. You can do anything with php that you can do with the other cool techs.

Re: PHP Addiction

#173
A victim must want help.

Make small incremental steps.

The investment you think you have in X (PHP) is less than you think. It's much more in how to code, how web works, etc. the PHP parts are cruft you won't miss anyway.

Re: PHP Addiction

#174
post #95
post #86

Earlier quoted context omitted.

Your example of simplicity is a bit conflated since you don't even need PHP to put hello world on a internet visible web page in the first place: echo 'hello world' > /var/www/index.html Set up something a little more useful albeit trite such as a blog and you wouldn't be able to do that in 10 minutes with PHP without using a framework either. PHP is great for "unit testing" of ideas but once it grows out of that it'…

> Installing git and installing Heroku, you're only 2 lines of code away though. Which requires you to learn git.

OK, so here we have someone who knows PHP but not Git. Knowing PHP, probably they're a web developer and have also learned the standard stack there: HTML, CSS, Javascript, MySQL, and Subversion. And with the way the HTML5 family of technologies is exploding nowadays, that's no small feat.

You're saying that learning Git is going to be the barrier to someone switching to Ruby? Naw, don't think so.

Re: PHP Addiction

#175
post #129

Earlier quoted context omitted.

> The only thing actually wrong with PHP, is that it's popular but not cool. No, what's "wrong" with PHP is that other things that are better have come along since. That's not a fault of PHP, that's the nature of language evolution. > It runs half the Internet quite well COBOL runs tons of mission critical business services quite well. It doesn't mean that nobody's improved on COBOL or that you should use it for a ne…

> No, what's "wrong" with PHP is that other things that are better have come along since. The problem is, no, nothing else has. Node.js is awesome and fun, but far harder to set up for basic webpage serving. Python is awesome, but also has a huge learning curve to learn how to serve basic webpages with. And... I can't think of anything else. Perl? ASP? Java is a huge pain to set up and maintain. What other language o…

> The problem is, no, nothing else has.

Myself and an army of other ex-PHP developers disagree.

> What other language out there is better than PHP for getting simple webpages up and running quickly?

This discussion is not just about "getting simple webpages up and running quickly". In fact, it's pretty clear people are talking about developing web applications, and not slapping together a quick and dirty page or two.

If you want to have a discussion about what language is best for inexperienced people to whip up a simple site without having to bother learning much, that's fine, but that's not this discussion. At the very least, that's certainly not what Marco was talking about, nor Jeff in the blog post Marco was responding to.

Re: PHP Addiction

#176
post #121

Is it my imagination or is Marco the king of writing blog posts that are quick reactions to whatever is trending on HN? The message you should get from this post is that familiarity with one's tools easily trumps any aesthetic flaws (consistency in parameter ordering, naming conventions, etc are really nothing more than aesthetic flaws and not "deep" [1] as the author suggests. After all, human language is inconsiste…

>I use Linux/Ubuntu at work basically because I have to. There are advantages on having your dev environment mirror your production environment and Linux (over OSX) does actually have a package system (it's a messy hack on OSX) but I certainly don't like it.

I'm very surprised that Google doesn't provide some kind of consistent dev VM environment that is similar to prod that developers can SSH into.

Re: PHP Addiction

#177
post #9

The problem is pretty much what the article he discusses mentions: I can copy up a PHP file to any old random web host, and it will Just Work. I would love to be able to not write PHP. But the language that replaces it has to be that easy to deploy.

I guess I still am lost as to what frame of reference people are discussing here. What real host [1] doesn't let you run WSGI processes, or arbitrary processes? What happens if you need to make TCP connections, or run a websocket server? [1] This does not include Dreamhost, Bluehost or any of the other oversold shared hosting (please, feel free to search G+ and see complaint after complaint about them, especially rec…

Most people don't start writing Real Sites hosted at a Real Host. They start with a stupid little static home page as a hobby hosted for free by their ISP or a $2-3 a month hosting provider. Then they want to add just one dynamic feature (maybe include a header and footer for each page), and they're obviously not going to learn Python and work out what the hell a WSGI is and get a new, probably more expensive, hosting provider just for that, so they use PHP, because it's trivial and already included. Then they need another slightly larger, feature. Fortunately there exists an Open Source php project providing just that feature, so they drop it in and it kind of just works.

A few more features get added in this way over the next few month and years and all of a sudden the sites popularity explodes. Now they have a whole bunch of stuff to deal with, and rewriting the entire site in some other language they know nothing about is not on the top of their priority list.

Re: PHP Addiction

#178
post #14

Disclaimer: I'm a Rails programmer for work and hobby. Interested in learning something that isn't PHP to code your web applications in? Ok. You have a ton of options and this is a very exciting time to be a web developer. Do you want to lean towards stability and proven concepts and work within a full application structure? Look at Django and Rails. Do you want to serve up responses from a simple script without a lo…

Do you want to provide an application that anyone can run and easily deploy on their own server with as little configuration as possible? Oh. I hate PHP as much as anyone (of course), but that's what it does.

That's the thing right? With PHP you need a server or you can't do anything. With Django, Sinatra, Rails, Flask, (Node?, Meteor?) you have all that for development as part of the application.

To deploy you just push to a free heroku instance and you are fine until you get big. Much, much easier than setting up your own Apache+PHP. And much, much cheaper than buying hosting.

Re: PHP Addiction

#179

Earlier quoted context omitted.

Apparently it's closer to 78% http://w3techs.com/technologies/details/pl-php/all/all No matter how you try to hide from it, it's blatantly clear that PHP runs at least half the entire Web. What else exactly did you think was? Surely you didn't think Python was running half the web. Obviously Ruby isn't. So what does that leave? Coldfusion? C?

> What else exactly did you think was? Well, in principle, there's no reason any one language has to run half the web by itself. And there are also static pages.

You don't agree with the notion that many tech products like web languages (or browsers, operating systems / mobile platforms, or whatever) tend to trend heavily toward a single dominant product (either due to one simply being better, and or a benefit derived from scale of use such as plugins or knowledge availability etc etc)?

Re: PHP Addiction

#180
post #96
post #69

Earlier quoted context omitted.

> The only thing actually wrong with PHP, is that it's popular but not cool. Hey now, we're all human. Even engineers. As soon as something becomes popular, it is no longer cool. Cool is the next popular. Cool is being different. That's just how things work. Apache is slooooow (NGINX is cool!). MySQL is retarded (Postgres is cool!). PHP sucks (Python is cool!). Red Hat is lame (Ubuntu is cool!). See a trend? The tech…

https://en.wikipedia.org/wiki/Association_fallacy Just because a technology is "cool" doesn't mean that you're acting like a high schooler for using it. Nor does using non-"cool" technology make you an adult.

I would think that not quoting Wikipedia articles in a conversation makes you an adult, but what do I know ...
Post reply on HN