Why nodejs is better than java Subscribe Pub

The simple fact is that the JVM refuses to wake up (or rather it can't without becoming something else) and is still stuck in the dark ages of programming, where you had to write a lot of fluff, compile it separately, just to get something out of it.

Consider printing "Software is Stupid".

In Node.js

Create a file called js1.js with the contents:

console.log("Software is stupid");

Then simply invoke node to execute it:

$ node js1.js
Software is stupid

In Java

Create a file j1.java with this super verbose content:

class j1 {
  public static void main(String[] argv) {
   System.out.println("software is stupid");

Then compile it:

$ javac j1.java

Only then can you run it:

$ java j1
software is stupid

Note how much fluff you have to write and get all of it right, which if you're using notepad to quickly write a 12+56 calculation is... well... ummm... bad?


Since the scala interpreter supports "expression mode" you don't even have to create a file containing the "program":

$ scala -e 'println("software is stupid")'
software is stupid

Was this useful?    

By: Razie | 2014-05-13 .. 2016-10-06 | Tags: post , javascript , node , java , scala

See more in: Cool Scala Subscribe

Viewed 1802 times ( | Print ) this page.

You need to log in to post a comment!