Developers are faced with a bewildering array of programming languages to choose from. The languages they decide to learn largely depend on the tasks they are best suited for.
In this case, we're examining Java and Go, which are both aimed at the server side of web applications (although Java is now a popular choice for devices).
Java developers in the UK can expect to draw in an average salary of £55,000 a year while Go developers earn on average £62,500.
What is Java programming language?
Java is a general-purpose programming language developed in 1995 by James Gosling at Sun Microsystems, the company later acquired by Oracle in 2009. The language is designed to let developers 'write once, run anywhere', meaning it can run on all platforms that support Java without needing to be recompiled.
Pros of Java programming language
Java is one of the most popular programming languages in use today, and it's not hard to see why.
Apps for Android, the world's leading mobile platform, are predominantly built using Java, and it is a staple of enterprise computing, used by 90 percent of Fortune 500 companies.
It is relatively easy to learn with plenty of reusable code already available. It is also platform-independent, thus can easily move from one computer system to another or run the same program on lots of different systems.
Java is reliable, with plenty of emphasis on early checking for potential errors. It is also constantly evolving, with the latest version – Java 9 – released in September 2017.
Cons of Java programming language
Inevitably for a language that's been around for over two decades, Java's competition is only increasing. Newer, more up-and-coming languages (such as Go) are starting to draw away the attention of developers.
Java has also had a long history of security flaws, and Oracle has faced criticism for not taking these seriously enough.
One common bugbear with Java is that it is relatively slow. It also takes up more memory space than other programming languages.
Another drawback is that Java is not permitted on the iPhone or iPad, meaning Java developers are effectively locked out of the iOS ecosystem.
What is Go programming language?
Go, often referred to as golang, is a programming language developed at Google in 2009 by Robert Griesemer, Rob Pike and Ken Thompson. Like Java, it is concurrent and statically typed. It is also free and open source.
Pros of Go programming language
Go is fast compared to other languages and compiles very quickly. It includes garbage collection, automating memory management so it isn't a task the developer has to do manually.
Go has documentation as a standard feature, making it easier for developers to document their code. It also has a rich standard library covering a wide range of areas.
Go supports concurrency at the language level, meaning it permits parallelism more easily than other languages. It was designed with scalability in mind.
Finally, many developers say they like Go's elegance and simplicity. It is easy to understand and strives to be easy to both read and write.
Cons of Go programming language
Go is a relatively young language which can be an advantage. It was written for today's web standards and lacks the hangovers of other languages. However it can also be a drawback, as it means there aren't many libraries for it yet, plus a shortage of books and online courses to support learning it.
Go has strict rules – which some like and others do not. It is difficult to handle errors in it and it can be daunting to pick up as a new language.
Go also has poor support for generic programming and requires a high level of explicitness from programmers.