3

Sorry Java, Write Once Run Anywhere (WORA) Is Now JavaScript

 3 years ago
source link: https://medium.com/swlh/sorry-java-write-once-run-anywhere-wora-is-now-javascript-92641161a73f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Sorry Java, Write Once Run Anywhere (WORA) Is Now JavaScript

Java started its journey with the slogan: Write once, run anywhere. But now, It’s JavaScript — not you, Java.

Image for post
Image for post
Photo by cottonbro from Pexels

Before James Gosling created Java, platform-specific compiled languages like C/C++ were dominant high-level languages. Programmers had to write codes for each platform by using platform-specific APIs. Some programmers created a single codebase for all platforms by separating code with conditional statements. On the other hand, some programmers wrote codebases for each platform separately. Even though writing platform-specific brings a lot of benefits such as flexibility, customizability, and performance — the business side of the software development needed a way to ship cross-platform software products fast.

From the business perspective, making a software product is about making it correct and making it fast by using human resources efficiently. Java took this opportunity to enter the software development market. It’s not about OOP (Java is not the first OOP-based language), and it’s not about performance (C/C++ languages are undoubtedly faster than Java). It’s all about making software fast and shipping products fast.

After that, we saw Java everywhere. Java helped programmers to create desktop applications, web servers, mobile applications, Smart TV applications, and web applications (via Applets). But now, JavaScript is doing all these things better than Java.

JavaScript is immortal. Java is slowly dying.

What can you do with a web browser that doesn’t support JavaScript? Nothing right? Nowadays, almost all websites are dynamic; they heavily depend on JavaScript. Without JavaScript, you will not be able to use your favorite websites properly. But you will be able to view the plain text and some graphics as you did many years ago with your 56k modem.

Due to this fact, JavaScript is immortal unless someone will make a different browser that supports X script and force everyone to use it. On the other hand, Java is slowly dying. Applets are dead, the majority doesn’t make desktop applications with Java, Java EE has impressive competitors, and JavaScript is used over Java to make Android apps. Besides, Java’s new licensing model is not attractive for everyone. On the other side, JavaScript has no commercial restriction at all.

Anything is possible with JavaScript.

You can make the following things with JavaScript better than Java,

  • Web applications: Vanilla JavaScript, React, Angular, etc.
  • Web backends: Nodejs and Deno.
  • Desktop applications: Electron, NW.js, and Neutralinojs.
  • Mobile applications: Ionic, React Native, and NativeScript.
  • IoT/Robotics programming: NodeMCU, NoDuino, etc.

The great thing is that JavaScript truly supports the business perspective that I mentioned earlier. The development is so easy because the language syntax offers a very good abstraction, and the setting up is also pretty fast. Human resource utilization is impressive. For example, If you can make websites, you could work with web backends, desktop applications, and literally anything.

The true WORA is JavaScript.

Nowadays, everything is moving towards the cloud. Very first, the WORA slogan told us about platforms. It’s about writing the same code for all platforms. However, WORA should consider the web browser as all because of the modern cloud movement. You can write JavaScript and execute it in the browser and the platforms.

Java has the Java Virtual Machine (JVM) to execute compiled instructions known as bytecode. Therefore, if a particular platform can run JVM, it can run Java as well. Similarly, JavaScript also has a virtual machine known as the JavaScript engine to execute intermediate code or machine code. In fact, the JavaScript engine is a key part of the web browser, but it is a separate component. Therefore, JavaScript came out from the web browser to other places with the concept of Nodejs.

On the other hand, Java was there already in other places. But, it tried to enter the web browser via the Applet concept and failed.

Conclusion

JavaScript has bad parts as well, like any other programming language. The main issue is related to bloatware, which consumes a lot of resources over usability. For example, we often identify the desktop applications built with JavaScript becomes bloatware. That’s not an issue created by JavaScript, but it’s an issue created by programmers. The following piece of writing explains more about this bloatware problem.

Also, you may argue that Web Assembly will make Java immortal. Because then programmers will be able to make web applications by using Java without worrying about JavaScript. I don’t think new programmers will learn Java to make web applications without stepping into JavaScript.

Now we know why they renamed LiveScript to JavaScript.

WORA is now JavaScript, not Java.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK