The verbosity and complexity of Java just to do something simple, compared to GoLang is one of the reasons, if not the main reason. The whole idea of declaring some verbose code such as private static class system console write line stdout () nested inside
some tree of a class, just to do something simple (i.e. hello world) can be done in much simpler Go code. The same goes for C# code which is horrendously verbose just to do basic tasks.
fmt.Println('hello world') in go, compared to the Java bloat class tree hierarchy is a major reason why people are turned off by Java. Look up some examples of Java Hello World's and you will see (or some C# ones).
Java also has the problem of exceptions that fire off rude messages when you are doing every day tasks, like accessing a file that is not found. A file not found is not an exception, it's an error. Java programs like to barf up exceptions every few lines of
code and treats exceptions as errors, and errors as exceptions, since there is no real definition or distinction of what an exception actually is. GoLang tries to solve the problem by making errors almost always recoverable, but does offer the panic feature
in emergency to stop the program, similar to how languages of the old days had "halt". Panic is more helpful than a halt, though, as you can tell where the program had the problem.
One look at a hello world in Java with a public static void or a private static void or even a public void or a static private void, or whatever the sequence is, and you realize you can omit all these useless verbose keywords. In GoLang something that is public
is Capitalized, while something that is private is not. This reduces some of the garbage verbosity that Java and C# has (and even C++, and sometimes C... in C the code is littered with useless "void"s everwhere, although C is much less obnoxious than Java
or C#).
Java programmers, for whatever reason, tend you use ReallyLongSuperVerboseFunctions and claim this makes your program more maintainable, which from experience, it doesn't - as your code becomes so hard to read as it takes hours to sift through the verbose Fiction
Novel that the code has become. GoLang programmers try to keep procedure and variable names short but helpful, to the point, concise. In this sense Java is somewhat broken not because of just the Java language itself, but the philosophy or mindset of the
Java programmers. Programming languages have philosophies or doctrines behind them, and I certainly am not a fan of the OverlyVerboseIsBetter Java doctrine.
Note: I am opinionated Go programmer, like all of them, so you may find my answer offensive, especially if you like Java or C#, which I absolutely do not like.
Wait, there is one thing good to say about Java: it has garbage collection, like Lisp, or Oberon, and it is based on Oberon. The fact that it is based on Oberon technology should mean it is good. But it's not. Also, the JVM is a pretty cool idea, which Java
stole from UCSD pascal and oberon. Sorry, I was supposed to say something good about Java. I'm thinking. Java has strings, which is good, unlike C which has pointers to characters. Java gets rid of pointer obscurities, which is good. But when you need them
you rush back to C. GoLang allows you to esscape using "unsafe" modules and escape back to dangerous code only when you need to, and also allows you to embed C code if you have to, which is rarely needed. Java doesn't offer any of this, other than linking
to C libraries.
Oh GoLang is also based on Wirth's Oberon, but does a better job of implementing a real world demo of Oberon and UCSD pascal than Java does. i.e. no one uses Oberon, but lots of people use Java and GoLang. Dot Net from Microsoft is also a copy (or based on
the ideas) of UCSD pascal and oberon.
GoLang has a really neat feature that other languages are getting rid of. Procedures. Many languages steer you away from procedures and try to put everything into an object message or class method. Earth to programmers: procedures are a useful feature, a simple
one, that sadly is seen less and less in languages these days. New does not always equal better: the good old procedure (or function) is an astoundingly good and useful programming language feature. Do not force me to use a method inside a public static class
of a class (or is it an object?), thank you very much. Let me call doSomething() like I want, when I want. Forcing programmers to use trees of trees of trees of classes is toxic.
RE: Go vs Java
Read the full post, view attachments, or reply to this post.