3 Reasons Web Development Languages are Interperted

Have you ever wondered why the most development languages are interpreted languages? I'm talking about languages like PHP, Python, Ruby and JavaScript which seem to dominate the web development industry. Why is it that  backends are constructed with these languages, compared to Java or C++?

Bandwidth

Now that web browsers like Chrome and Firefox have made major strides in rendering and computers have achieved good processing speeds, the main concern anymore in the web development industry is not execution time but rather bandwidth cost.  No, not the cost of your outrageous internet provider (especially if you host anything from your house), but rather the time it takes to download a website and display it to the user. In fact Google favors websites with faster load times. For example a hello world (not very valuable) web page made in Java, without any valid HTML would cost you 426 byes once compiles into a class file, as compared to the JavaScript version coming out at 21 byes. That's over 20 times the amount of size. Now imagine a program that does something useful like display valid HTML, provide styling and modern functionality. With a Java program this can start adding up real quick especially after you start including graphics libraries into Java. Now of you course we have completely removed the need to send compiled programs across the wire, and that's why Apache Tomcat was invented.  So by reducing the amount of data needed for the web page and by placing the runtime responsibility on the client side we have reduced the amount of bandwidth use, causing our site to "load" more quickly.

Changes on the fly

Another things that comes up in the world of web apps is bugs; bugs that can occur in production environments overnight. Interpreted languages allowing making changes to these errors only a matter of quick edits once found. For example if a bug existed in a Python script, and you have identified the problem (which could be a task all in its own from the lack of logging) you can simply make your edits and restart the script. Again with PHP you can make the changes and allow the server to serve up the new version of the code. With compiled languages, you'd have to make the changes, recompile the code and then replace the old one. If your running your web app with an interpreted language, and you're also using Docker, then Docker will pick up the changes of the file if you are using WORKDIR. How ever if you are using a compiled executable then it's more than likely you will have to rebuild your container creating an even longer process of fixing your bugs.

Scalable

Scalability is a required component of languages used for web apps and data analytics applications (which tend to be attached to web apps for information viewing). In this case scaling a compiled language app means also scaling the technology to run the app. If you are you using Tomcat and Java, you'd also need to run multiple instances of Tomcat and store multiple copies of Tomcat on each machine, horizontally, as well as running a load balancer. Where as an interpreted language just needs to store the processor and a copy of the source. Of course a reverse proxy will be needed if doing load balancing.

Conclusion

From JavaScript and the world of objects to Python and it's unique data structures, they make building web applications easier. Of course they will never replace Java, C++ and new languages like Go in desktop applications and low level server programs. Web technologies will continue to evolve, but interpreted languages are here to stay.