Software brevity, and "Hello, World" in Java, Ruby, and Scala

I was just reading Treating Code as an Essay in the book Beautiful Code, and saw this paragraph:

After that, I saw two versions of the famous, “Hello, world” program, one written in Java:

public class Hello {

  public static void main(String[] args) {
    System.out.println("Hello, world");
  }

}

and a second program written in Ruby:

print "Hello, world\n"

Of course the Ruby version is much shorter than Java.

Java was great when it first came out, but as the years have gone on, most developers think it is verbose, and to the point of the paragraph shown above, verbose code is harder to read and harder to maintain. That’s one reason I love Scala.

So, to complete the “Hello, world” examples, here is a “Hello, world” program written in Scala:

println("Hello, world")

You can write the code just like that in the Scala REPL, or in a Scala shell script, and it will work just fine.

For many more examples of how brevity is a virtue in Scala, search this website for Scala, or go to alvinalexander.com/scala and browse through the examples.