Live data from Hacker News

PHP: the quiet powerhouse

blog.appfog.com

101–110 of 140 posts

Re: PHP: the quiet powerhouse

#101

Earlier quoted context omitted.

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.

Remember that Google already launched a second language for the browser - Dart. But no other browser vendor seem to want to support it...

This is true now, but Dart is also less than a year old. I don't have strong feelings toward Dart either way, but these things have a gestation period. Internet Explorer didn't support JavaScript at first either, and Safari and Chrome didn't exist in 1995. So it really remains to be seen.

Re: PHP: the quiet powerhouse

#102
There's no denying PHP's popular, but that doesn't mean it's the best tool for the job.

Most of the arguments I see against it though are really problems with the programmers using it. "Look at this horrible code I have to put up with! The comments are inane and useless, there's no structure at all, and I'm stuck in a chain of nested if statements 10 layers deep and I have no idea what's going on. PHP sucks!"

As Jeff Atwood said, "sufficiently incompetent coders can write FORTRAN in any language."

"But the converse is also true: sufficiently talented coders can write great applications in terrible languages, too."

PHP wasn't exactly designed… it was formed, like a ball of mud picking up various debris as it grew. It shows, too, especially if you've had the pleasure of working with PHP 4. (I can only imagine what earlier versions were like.) I can't for the life of me think of a language with more brain-dead "reference" semantics. It's just bizarre. Their date functions miraculously manage to be worse than their C counterparts. I could go on and on.

But in the end, using PHP doesn't doom your project to failure any more than using the current flavor of the week guarantees your success. Jeff Atwood, again: "The only conclusion I can draw is that building a compelling application is far more important than choice of language."

So why are we still comparing programming languages instead of writing code?

Re: PHP: the quiet powerhouse

#103
post #80

Earlier quoted context omitted.

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 l…

@1. When the project is only a couple of pages.

Re: PHP: the quiet powerhouse

#104
post #88

If you are just starting out as a web developer and aren't planning on changing careers anytime soon, the #1 language you should learn is JavaScript. It, or languages that compile to it, will still be in fashion in 5 or even 10 years. That's because the web is shifting to thick clients, and JavaScript is the only choice in browsers. JavaScript is also finding its way into server-side code (Node.js). "I think PHP is t…

> Server-side view rendering is on its way out. So this is not a real advantage. server side is "on its way out" the way relational databases were "on their way out" when everyone was hysterical about NoSQL 18 months ago. That is, while client side rendering will become much more prominent, server side will remain quite popular as well. Hybrid approaches will likely become the norm. We've written an app here with 100…

Agreed, it will be hybrid for a long time, but I expect the trend toward view logic being more on the client and less on the server to continue, simply because the web is less and less about "pages" and more and more about "apps" and "resources".

Re: PHP: the quiet powerhouse

#105

Earlier quoted context omitted.

> Server-side view rendering is on its way out. So this is not a real advantage. No it isn't, client side view rendering is just experiencing a faddish phase; it'll fade. It'll never overtake server side rendering on the web.

It's not a fad. It's driven by the increasing growth of mobile devices ( see http://www.digitalbuzzblog.com/2011-mobile-statistics-stats-... ) The Internet is becoming more ubiquitous. Being "on the Internet" will mean less and less being in front of your computer. The proliferation of devices you can access a web app from is increasing (smartphones, tablets, more coming in the future) so it is becoming more useful f…

I'm really not sure why this is being downvoted. It's not trollish. I believe what I'm saying to be true: mobile is increasing, and this is leading to thicker clients and more JavaScript and therefore less server-side view logic. Please correct me if I'm wrong, but downvoting me is confusing.

Re: PHP: the quiet powerhouse

#106
post #31

Earlier quoted context omitted.

> Server-side view rendering is on its way out. So this is not a real advantage. No it isn't, client side view rendering is just experiencing a faddish phase; it'll fade. It'll never overtake server side rendering on the web.

The realities of roundtrip time won't go away. Serverside rendering will always delivers worse responsiveness. Blame physics.

http://engineering.twitter.com/2012/05/improving-performance...

Discuss.

Re: PHP: the quiet powerhouse

#107
post #88

Earlier quoted context omitted.

> Server-side view rendering is on its way out. So this is not a real advantage. server side is "on its way out" the way relational databases were "on their way out" when everyone was hysterical about NoSQL 18 months ago. That is, while client side rendering will become much more prominent, server side will remain quite popular as well. Hybrid approaches will likely become the norm. We've written an app here with 100…

Agreed, it will be hybrid for a long time, but I expect the trend toward view logic being more on the client and less on the server to continue, simply because the web is less and less about "pages" and more and more about "apps" and "resources".

I don't understand this argument. The way I use server side templates is much simpler and more powerful than any demo of client side templating I've seen. I think you're reading a little too much into the hype, otherwise maybe you can share an example of superior Javascript templating patterns because I can't find them.

Re: PHP: the quiet powerhouse

#108
post #34

Earlier quoted context omitted.

> Server-side view rendering is on its way out. So this is not a real advantage. No it isn't, client side view rendering is just experiencing a faddish phase; it'll fade. It'll never overtake server side rendering on the web.

The seductive advantage of server side rendering is centralized control of what all clients see. Whenever you push too much business logic down to the clients you have to contend with how to ensure all of those clients are using the same logic at all times.

This is just a result of loose architecture. If your models are cleanly abstracted using REST principles on the server-side, then server templating becomes much more appealing.

I say this because I am doing it -- building apps with REST interfaces on the server side. It's not a common pattern yet but I think this is where things will actually go (as opposed to the client), because it's actually easier to use, understand and iterate on.

If you can write Javascript templates that interface with your back-end using REST calls like "GET /accounts", you can do the exact same thing in a server side template with better performance and dramatically simpler security.

Re: PHP: the quiet powerhouse

#109

Earlier quoted context omitted.

It's not a fad. It's driven by the increasing growth of mobile devices ( see http://www.digitalbuzzblog.com/2011-mobile-statistics-stats-... ) The Internet is becoming more ubiquitous. Being "on the Internet" will mean less and less being in front of your computer. The proliferation of devices you can access a web app from is increasing (smartphones, tablets, more coming in the future) so it is becoming more useful f…

I'm really not sure why this is being downvoted. It's not trollish. I believe what I'm saying to be true: mobile is increasing, and this is leading to thicker clients and more JavaScript and therefore less server-side view logic. Please correct me if I'm wrong, but downvoting me is confusing.

Mobile devices can cope with even less client-side logic than real computers can. Why would mobile devices lead to pushing more work onto the client?

Disclaimer: I'm not one of the downvoters.

Re: PHP: the quiet powerhouse

#110

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 language or framework can be tough to scale. Didn't twitter find this out in the early days?
Post reply on HN