We've got to maintain a certain level of 'street-cred'.

'PHP and Javascript: How the Web Will Be Won'

Let us give a brief and basic history of PHP and JavaScript on the internet and how these two technologies, both meant to operate on completely opposite sides of a world as far as a web page is concerned, are now butting heads with each other.

  • Long ago, as “WWW” was becoming a household abbreviation, web browsers maintained standardization and displayed content through HTML. OK, so that part hasn’t changed other than the fact that we are up to HTML5, but it is hard to convey how static the web used to be compared to now. Displaying pictures and links were considered high-tech, never mind dynamic tables, auto-updating text feeds, and embedded audio and video. An application like YouTube, Spotify, or NetFlix would have blown minds.
  • To alleviate this “static-ness,” one of the creators of NetScape developed JavaScript in order to give powerful dynamic content to a webpage on the client-side – that is within the browser application itself. On the server-side – which is the source of the web content and may involve HTML-generation, the Perl programming language was often used for this task but was eventually eclipsed by PHP: Hypertext Preprocessor (PHP). Yes the name is meant to be recursive. PHP soon became the backbone of a great deal of e-commerce, web forums, and content management systems. However, being server-side it works by generating and sending fresh HTML whenever the client requests it, still giving it some limitations.
  • For a long time Flash was the tool of choice for dynamic content, but being third party and often more resource intensive than the browser itself it has somewhat given way to advances in JavaScript. Ajax, a framework that incorporates JavaScript, has allowed many of the dynamic features we are now seeing in websites that make them work a lot like the native GUI windows that most of us are used to working with. This, by the way, is why it is significant that Windows 8 does not really have windows anymore but treats HTML5 and JavaScript as first-class UI technologies.
So now back to PHP vs. JavaScript. The former is still a leader on the server-side, and the latter is dominating client-side, and has come a long way from being an annoyance that enabled comet cursors and scrolling backgrounds. However, PHP may be giving some ground to a server-side version of JavaScript – Node.js. This technology gives developers the advantage of using the same language for both client-side and server-side, allowing them to use their developer talent more efficiently. Not only that, but many web benchmarks are finding that Node.js is scoring over PHP in terms of performance. The ability to run useful server applications entirely with JavaScript was unthinkable years ago but is now a reality.

Of course, PHP is so pervasive and powerful that it is here to stay for the time being. We could also mention Python but that is another story. Furthermore, Google’s Dart language is taking a stab at both JavaScript and PHP at the same time. However, it is very interesting to take into account how programming technologies can go in all sorts of unpredictable directions. Contact us to learn more.