Live data from Hacker News

PHP Addiction

marco.org

121–130 of 320 posts

Re: PHP Addiction

#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 inconsistent. After awhile you just get used to it and don't think about it anymore. Programming languages are no different.

I agree with Marco that it will take "years to master" whatever he chooses next. I always scratch my head at these "I learnt Python in a day" claims you often see around here. No, you didn't learn Python in a day. You learnt the syntax for a for loop in a day. Idiomatic Python takes much longer.

I don't agree that choice is the reason people don't use Linux on the desktop. Desktop Linux is the reason people don't use Linux on the desktop. I'm sorry but it's truly awful and probably won't ever get better. In the absence of product direction you have us geeks making everything configurable because, you never know, you may want to write your own window manager (and knowing us geeks, no two will agree on what's right) so you have no consistency, no grand UI/UX design and it's just terrible.

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.

The only computers I use that I truly enjoy using are my iPad and my Macbook Air.

Fear of the wrong choice isn't I believe what motivates most people. Fear of looking like an idiot? Sure. But that's different and will probably be the case with anything new.

People don't tend to weight up two or more options, decide which is best and go with it. They tend to use the first thing they come across until its flaws (perceived or actual) outweigh the "cost" of transition and appearing like an idiot for awhile.

[1]: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...

Re: PHP Addiction

#122
post #106

"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -Bjarne Stroustrup

Sure, but the pain-to-usefulness ratio is important, and does vary from language to language.

Re: PHP Addiction

#123
post #99
post #87

Earlier quoted context omitted.

Common sense. Calculate how much traffic Wikipedia + Facebook + Wordpress + All The Rest generate. Calculate in the fact that most services talk to other services and more importantly, talk to Facebook. Click on a link? I promise, at some point, PHP is involved.

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?

Re: PHP Addiction

#124
post #120

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…

Uh, it's actively being worked on and it grows at a very rapid pace. What you read about or use with PHP is dated. Most PHP applications are 5 years behind where PHP is currently. THAT is the real problem. You obviously have not seen any modern PHP code. RoR is dead dude. Have you been hibernating for a few years?

This comment just made me want to view Hacker News more often. Maybe. 24 hours in a day--there's lots of things I could be doing.

Re: PHP Addiction

#125
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 recently).

I guess I don't see any "real" sites being deployed in environments where only PHP is available. A random script that you want to let someone else use for a few minutes, sure, upload that to randomphphost.com, but a real life public webapp??

If you take the time to learn it, deploying C#, python, ruby apps can be insanely easy. And to be my usual self, deploying Golang apps are beyond insanely simple. (I cross compile from my Mac to my Linux 64bit target, upload and run `sudo ./server -host=:80` and I'm deployed).

Re: PHP Addiction

#126
post #85

Earlier quoted context omitted.

The choice does matter. A lot. When I started with ruby, I had to decide between 1.8, or 1.9, or jruby, or several other choices. Then I had to pick sinatra or rails or merb or whatever. mongrel or passenger or thin or unicorn. It didn't really seem like the choice would matter, but then you run into some tiny annoyance, do a bit of research and find out that some other framework doesn't have that problem. So you swi…

"... run into some tiny annoyance, do a bit of research ... So you switch ..." If you pick a solution and run into a tiny annoyance learn to work around it in some way. It is a tiny annoyance . Best case scenario, learn why it's happening, how you can fix it, and (in a dreamland) submit a patch that fixes this for everyone else in the future. Worst-case scenario just find a workaround.

If it's early in the life of a project and you don't have much experience with the framework, tiny annoyances are a warning sign. If the easy things don't work the way I like, what happens when I try to do something hard? The cost of switching is low.

I used merb for all of about 10 minutes before giving up on it. I fooled around, created a couple very basic crud pages, and it worked for a bit, then I got nothing but error pages. root cause: I had created a new class called 'fish'. That opened my eyes to the fact that were was so much automagic fairy dust sprinkled about, if anything serious ever went wrong I would never figure it out.

Re: PHP Addiction

#127
post #33

Here is another point that highlights the problem: If I want to write a hello world application in PHP, it's neither as long as nor as short as Rather it's simply: hello world. Just type in those 11 characters in a text file and save it as hello.php. Now load it on your browser [or run it from command line] and it will print hello world. I don't think it can get any more simpler than that in other languages. PHP was…

> Rather it's simply: hello world

Wouldn't that also apply to jsp, cfm, gsp, jsf and asp?

Re: PHP Addiction

#128
post #67
post #33

Here is another point that highlights the problem: If I want to write a hello world application in PHP, it's neither as long as nor as short as Rather it's simply: hello world. Just type in those 11 characters in a text file and save it as hello.php. Now load it on your browser [or run it from command line] and it will print hello world. I don't think it can get any more simpler than that in other languages. PHP was…

I'm not convinced this is true. You see, way back in the day in 1997 when I was doing web dev, everything worked the way PHP does. ColdFusion, ASP ( not ASP.net, ASP), PHP, and almost everything else that was seriously trying to do web pages worked that way. It took the community collectively a long time to stop seeing URLs as identifying anything but specific files. This is back when having those files be programs w…

The page-is-program model still works as well as ever. It's just that, if your problem is so simple that the page-is-program pattern is most appropriate -- for example, if you are eight years old and you want to build a page that serves up a different picture of a dinosaur every time it gets reloaded -- you should just use PHP. Why choose anything else?

It's true that other languages have not wasted a lot of time trying to displace PHP as the language of choice for anonymous random dinosaur servers. That's because there's no money in fighting PHP on its home turf. The turf just isn't worth enough.

"Vestigial" is the wrong word. That's like describing a screwdriver as "vestigial" because the impact driver has been invented. Sure, impact drivers can accomplish many things that mere screwdrivers cannot, but that doesn't mean that screwdrivers aren't still useful, and numerous, and popular.

Re: PHP Addiction

#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 new project today.

Re: PHP Addiction

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

It's pretty easy to do so with Python, at least. I don't know about Ruby.

The only advantage PHP has in terms of deployment is that there are more cheap, crappy shared hosts that support it.

Post reply on HN