why i like java

How many languages do I speak? If you only count oral languages it would be two. But if you count code, well there’s quite a few more. In this article, I want to focus on my favorite language for writing back end applications: Java.

Every year, Github and Stack Overflow come out with a list of the most popular development languages. Java has been on the list for as far as I can remember. Other languages grow in popularity but most eventually fade. Ruby is one fairly recent example of a language that exploded and now is on its way down. I think there is a reason why Java is at or near the top most years and I will explain why.

A few years ago one of my favorite bloggers Steve Yegge posted an ode to Kotlin, a language that runs on the same virtual machine as Java (the JVM). From the article:

Kotlin allows multiple classes per file, top-level functions, operator overloading, extension methods, type aliasing, string templating, and a whole bunch of other bog-standard language features that for whatever reason Java just never adopted even though everyone wanted them.

I have to respectfully object.

One of the great things about Java is its minimizing of syntactic sugar and other things that I believe can get a developer into trouble. For example: operator overloading and type aliasing, while allowing for smaller and easier to write code, can lead to debugging and adding features taking more time. Take for example this Kotlin code:

fun myfunc(a: MyAlias) {
   a.doSomething()
}

In the above code, MyAlias is a type alias that is referencing.. actually I don’t know by looking at it. If I came across this code on Github I would have no idea what it does.

Too many developers focus on getting their first iteration of code to be small and fast to write without thinking of the ramifications later on. I would take verbose, readable, and understandable code over one liners any day of the week. Yes, it takes longer to type and yes it may not be sexy, but when you have to fix a bug you can look at the code and know exactly what it does.

Integrated Development Environments like IntelliJ take away some of the pain of typing verbose parts of Java like Getter and Setter methods. Using an IDE, I get the best of both worlds: a fast way to write code and code that is readable.

Java may be a dinosaur language and I may be a dinosaur developer. But when it comes to being productive, I think simplicity wins every time.