Java v PHP v JavaScript

A comparison of the programming languages Java, PHP and JavaScript


I am a Computer Scientist by training so have a good technical knowledge of many programming languages. However, I am not a Java developer but I do appreciate its strength and versatility. I am a budding PHP developer and an experienced JavaScript developer.


This article is not a critique of one language over the others and it is not my purpose to support for my favoured technology. Which is just as well because I cannot identify a clear all round leader out of these three. I just want to present the facts and suggest the circumstances when one language might be preferable.

The syntax of all three languages is in the style of C and all three are instrumental in the development of web application. There are even sites that employ all three with each language playing to its strength; sounds good policy to me.

Java PHP JavaScript
Primary purpose General (Web Server) Web Server Web Browser
Secondary purpose General * Web Server**
Nature Compiled to Byte code Script Script
OOP implementation Class Class Prototype
Typed Strong Strong Dynamic
Strength Numerous*** Web Server interaction Web Browser interaction

* Java used to have a role within the web browser as applets but this has since been considered poor practice as it requires the browser to integrate a JVM.
** JavaScript is making increasing in roads on the server-side through components like NodeJS and PhantomJS. It is also worth noting that JavaScript (more accurately ECMA Script-based languages) are proving to be beneficial in many other area.
*** Java is a profession development framework suitable of many applications from mobile application to enterprise solutions.

Notable exclusions

There are a vast array of other languages, too numerous to list them all, that perform competitively in the web application arena. The most well known include; Ruby on Rails, Python and Microsoft .Net.

Return to Articles


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s