Live data from Hacker News

PHP: the quiet powerhouse

blog.appfog.com

71–80 of 140 posts

Re: PHP: the quiet powerhouse

#71
Back when all you had for choices were Perl, Java, and C++ it was easy to see why PHP got big. However there are issues with starting out on PHP now:

1) It's really only meant for web development.

2) There are other languages now that are simple to learn, flexible (more than just for web apps), and powerful (Python, Ruby, and now even Javascript)

Unless PHP has another major evolution, like its move to OO; (or unless I just missed something else big) I just don't see the point of using it unless you or your company been using it for years already. This article doesn't have any real compelling arguments.

Maybe all of this will change once Facebook releases Hiphop VM AND people actually start using it. To this day, I'm not sure why no one started using Hiphop enmass and why people love using the inefficient eval method. O yeah there's also an issue with PHP and logic dealing with concurrency, in that there isn't a good way to distribute work within an app. Then again I could be completely wrong.

Re: PHP: the quiet powerhouse

#72

Here's an idea.. If PHP is so bad.. Don't use it. Simple as that. Let the people who want to use it... There's absolutely very minimal things wrong with the language. Everyone's quick to compare it with Python or Rails or something else saying "PHP does this wrong that Python does right" well, if PHP did everything the same way as Python, Rails, or something else, when what makes it different? Who wants to use a lang…

PHP has all the beauty of Perl with none of the power.

I think part of the reason folks pillory PHP is their annoyance that people are using it as their first language and may never move beyond it to the better alternatives available.

Re: PHP: the quiet powerhouse

#73
post #46

This does not justify chosing PHP for a new project. There are hundreds of examples that show how bad PHP really is. Why make the choice of using a broken language when there are so many better alternatives? I strongly believe that using a complex, non consistent and hard to debug language actually slows down development and is even dangerous. Being "absolutly everywhere" is not an argument. COBOL, PASCAL and FORTRAN…

No, "absolutely everywhere" is not an argument by itself. But sometimes ubiquity is earned. If Facebook powered its front end using FORTRAN, I would call it a quiet powerhouse, too!

You can always build things with at scale, even with flawed languages (look at javascript).

The thing is, why choose a flawded language when there are others less flawed (nothing is perfect) for new code?

Re: PHP: the quiet powerhouse

#74

I don't think MediaWiki or Wordpress are good examples of how PHP scales. Those are the two examples of extremely bloated pieces of software that require a lot of hackage to get to scale. I've done deployments of those on mid sized VPS'es and it's always a pain getting it responsive while still able to hold a good number of concurrent connections. The only way anyone gets Wordpress to scale is to put caching in front…

The only way to get mediawiki to scale is to do the same. :)

Re: PHP: the quiet powerhouse

#75
post #49

Earlier quoted context omitted.

"JavaScript. It, or languages that compile to it, will still be in fashion in 5 or even 10 years." How in the world can you predict what will be in fashion 5 and especially 10 years from now? "That's because the web is shifting to thick clients, and JavaScript is the only choice in browsers." How do you know that won't change?

It's hard to predict 10 years out, but not too hard to see 5 years ahead. Generally speaking, what's popular now existed in some form 5 years ago. JavaScript has a monopoly as the only language that runs in browsers. If this were to change, it will take years, not months, for browsers to start supporting another language (or go to a bytecode model). Then it will take more time for developers to start using these new…

I agree, but just out of curiosity: what do you think would be the language of choice beyond JS for the browsers of the future?

I honestly don't have a clue. I might guess Python because it's so big at Google and Chrome is already more or less the industry standard.

Re: PHP: the quiet powerhouse

#76
post #57

Earlier quoted context omitted.

I certainly didn't mean to say that languages like Python and Ruby are inflexible! What I meant to say is that you can't use either of them in direct conjunction with HTML the way that you can use PHP. This was what I meant when I said "genuine functionality from scratch." Would I prefer Python+Django/Flask for lots of use cases. Absolutely. As for the "useless overhead," there are things like the command line (which…

What advantages does this "direct conjunction with HTML" have over templating solutions? Why do most PHP frameworks implement templates then? Also, if command line is a barrier for an aspiring (web) programmer, he/she should start looking for a new career path.

1. I wouldn't want to do anything at a meaningful level of complexity without templates. No question about it. And I think that having so many templating frameworks is wonderful (ERB, Jade, haml, etc.). I was only arguing that PHP lets you dive in without NECESSARILY needing to jump through a templating hoop.

2. Is it unthinkable that a person could start learning web dev and pick up the command line along the way? I started out learning PHP/MySQL on my old Windows machine, terrified of the CLI, and now I do almost everything on it (and have converted my old PC to Linux). If the command line were a barrier at all points in the learning trajectory, then you might have a point. But I also don't think that command line mastery should be held up as a sine qua non of learning web dev.

Re: PHP: the quiet powerhouse

#77

Earlier quoted context omitted.

It's hard to predict 10 years out, but not too hard to see 5 years ahead. Generally speaking, what's popular now existed in some form 5 years ago. JavaScript has a monopoly as the only language that runs in browsers. If this were to change, it will take years, not months, for browsers to start supporting another language (or go to a bytecode model). Then it will take more time for developers to start using these new…

I agree, but just out of curiosity: what do you think would be the language of choice beyond JS for the browsers of the future? I honestly don't have a clue. I might guess Python because it's so big at Google and Chrome is already more or less the industry standard.

We really need a quantum leap in language technology. Currently the Internet technologies have grown organically and because of this, most of what we use to program has been repurposed.

HTML was meant to describe text, now it describes regions of the screen to be repainted as well as the "content" to be repainted.

CSS was meant to add simple effects like bold, italic and simple newspaper-like positioning (float this image left). It's been repurposed to describe visual rendering and even animations.

JavaScript was meant to add some scriptability to the DOM, and now it's morphed into a full-fledged programming language.

So the state of the web is a depressing mishmash of old, repurposed technologies.

It would be nice if there were a programming language that "knew" about the web. It would realize that the programming effort would be shared between two computers, client and server, and would have appropriate security and other conveniences baked in. For example, you should only have to describe your business logic once (as opposed to once on the server and once on the client). Also, this programming language should no longer be tied to the anachronistic concept of rendering a "document" with "styles".

But alas, it's very hard to simply go into an academic tower and design a language and release it into the wild and expect it to catch on. These things tend to grow organically and incrementally. So whatever next step there is has to embrace where we currently are. This is why you see not merely new client-side languages, but new languages that compile to JavaScript. If they didn't compile to JavaScript, how could they ever be used?

Re: PHP: the quiet powerhouse

#78

I don't think MediaWiki or Wordpress are good examples of how PHP scales. Those are the two examples of extremely bloated pieces of software that require a lot of hackage to get to scale. I've done deployments of those on mid sized VPS'es and it's always a pain getting it responsive while still able to hold a good number of concurrent connections. The only way anyone gets Wordpress to scale is to put caching in front…

Any sort of scaling is a hack (not always bad). Good luck if you expect to scale to Wikipedia or Wordpress(.com) levels without using external tools such as Memcache and Varnish.

Re: PHP: the quiet powerhouse

#79

Back when all you had for choices were Perl, Java, and C++ it was easy to see why PHP got big. However there are issues with starting out on PHP now: 1) It's really only meant for web development. 2) There are other languages now that are simple to learn, flexible (more than just for web apps), and powerful (Python, Ruby, and now even Javascript) Unless PHP has another major evolution, like its move to OO; (or unless…

Agree with all your points except this one.

>> Maybe all of this will change once Facebook releases Hiphop VM AND people actually start using it.

The argument that PHP doesn't scale is a strawman. To scale anything to the likes of Facebook or Google you have to have serious architecture in place regardless of the language you choose.

Re: PHP: the quiet powerhouse

#80
post #57

Earlier quoted context omitted.

What advantages does this "direct conjunction with HTML" have over templating solutions? Why do most PHP frameworks implement templates then? Also, if command line is a barrier for an aspiring (web) programmer, he/she should start looking for a new career path.

1. I wouldn't want to do anything at a meaningful level of complexity without templates. No question about it. And I think that having so many templating frameworks is wonderful (ERB, Jade, haml, etc.). I was only arguing that PHP lets you dive in without NECESSARILY needing to jump through a templating hoop. 2. Is it unthinkable that a person could start learning web dev and pick up the command line along the way? I…

1. Ok so when is it appropriate/useful to use the power of embedded php (in html) instead of templates? Just for learning the first couple of hello worlds? In my experience it becomes a mess to manage when you start having more than one commiter and more than a couple of lines of code.

2. You don't have to be a command line expert to start using it. All the books at http://learncodethehardway.org/ show that command line can be integrated in the language learning process seamlessly. No reason to be terrified of it, on the contrary, new coders should embrace it as soon as possible.

Post reply on HN