Live data from Hacker News

PHP Addiction

marco.org

161–170 of 320 posts

Re: PHP Addiction

#161
post #99

Earlier quoted context omitted.

When you actually have a real source or numbers, let me know.

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.

Re: PHP Addiction

#162
post #7

I'll sound like a broken record, but I'm convinced Flask is the perfect transition. It's built for smaller web apps, and rapid prototyping. The system of mapping endpoints to functions is incredibly intuitive -- if you've used Python before, learning Flask is incredibly easy.

i'm on PHP now as well. I would probably choose Bottle simply because it runs on Python 3 while Flask does not. I would go with Flask otherwise.

I just did a comparison of bottle and flask for my job. My recommendation: go with flask. Flask has a bigger community, more built-in functionality, some really cool tools (the debugging functionality is far better than bottle), and is essentially the same as bottle in all other respects that matter.

As far as python 3 support is concerned: this is a minor annoyance, but it will probably be rectified by the time python 3 is relevant in production environments.

Re: PHP Addiction

#163
At two extremes 1) You want to develop something fast and dirty - Go for scripting language. Out of them PHP is the dirtiest and fastest out of gate and thus the best choice. 2) Want someting battle hard with lots of extendability - Go for a stuctured language - Java or C# will work best here.

Between these two extremes run all others with their fair share of incongruencies and imperfections. They are just not popular and probably never will be. So I don't care. Let me know when there is a language that slaps me on the wrist for bad design and coding!

Re: PHP Addiction

#164
post #18

Earlier quoted context omitted.

So Java then?

I've never seen a web host include java, and no shared host has enough resources to support the JVM in the first place. It's a similar problem as Ruby and Python, believe it or not.

Actually, the GP was talking about running on your own server. Ruby, Python, Java, PHP, they're all close enough in terms of setup time that it need not factor into the decision. Or you can run any of them on dotCloud, EC2, Rackspace, lots of places. Deployability just isn't a differentiator nowadays.

Re: PHP Addiction

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

PHP stands for letting amateurs code effectively.

I hear this a lot. I think people assume that because lots of amateurs use PHP, it must be helping them be effective. This is not a safe assumption. A shoe does not help amateurs drive nails effectively, no matter how many amateurs you see using one.

For a better of idea of how amateurs interact with PHP, see http://stackoverflow.com/questions/tagged/php

Re: PHP Addiction

#167
post #142

Earlier quoted context omitted.

> If you've never seen anything other than PHP, you won't understand two thirds of the list or why they're problems. Two thirds of that list are actually incorrect. But I programmed in Java, C++, C, VB, and so on before I started coding in PHP many years ago. So many years ago, in fact, that PHP was easily the best choice. The problem with lists like that is they obscure the truth -- and that is -- that solving a pro…

> Two thirds of that list are actually incorrect. Got a link to a good rebuttal?

Anthony Ferrara did a rebuttal here:

http://blog.ircmaxell.com/2012/04/php-sucks-but-i-like-it.ht...

Not a good rebuttal but I've done my own here:

http://news.ycombinator.com/item?id=4177516

Re: PHP Addiction

#168
post #129

The only thing actually wrong with PHP, is that it's popular but not cool. And that's a terrible place to sit for any product. It runs half the Internet quite well, but if you went by the posting on HN, you'd think it was Windows Vista. I've probably read every article critical of PHP that has hit the front page of HN in the last few years, and the one thing they all have in common is the vague refrain that PHP is a…

> 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 out there is better than PHP for getting simple webpages up and running quickly? I wish there were one, but when you consider practical aspects instead of just theoretical ones, there really isn't. Sadly.

Re: PHP Addiction

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

Well that's the thing... most of the PHP popularity is for the sites that get installed on Dreamhost etc.

I've deployed C# apps; I did .NET exclusively for about 8 years. It's great! But telling Joe's Washer Warehouse that they have to pay for the .NET stack, and that they can't just find a random PHP guy to do any further development is kind of tough pill to swallow.

Yes, PHP sites are usually the lowest common denominator, but on the other hand there are lots of people that are only willing to pay for that. There's a reason the PHP market is as big as it is. Thankfully for those of us in PHP-land there are starting to be lots of quality frameworks like Drupal and Symfony so that it's not such a horrible experience as it used to be.

And the other part is really the market. You want a large CMS-driven website? PHP is where it's at. That's where the code and communities are. There's a reason that lots of very large websites use Drupal. Sure, if I was going to try and make some sort of big-backend web app that did a lot of services and whatever, I'd want to do .NET. But as a freelance web developer, those projects just aren't there. Like it or not, I'm in PHP land.

(And RoR used to be a total nightmare to deploy. That whole community needs to send a collective giant cardboard check to the mod_passenger guy.)

Re: PHP Addiction

#170
post #18

Earlier quoted context omitted.

So Java then?

I've never seen a web host include java, and no shared host has enough resources to support the JVM in the first place. It's a similar problem as Ruby and Python, believe it or not.

Is PHP really more memory efficient than the competition? I know it scores better on the computer benchmark game but the non-existent concurrency support and general leakyness of most the extensions (unless they've fixed that these days?) seems like the difference could actually be a lot narrower in practice.
Post reply on HN