Share On Twitter Facebook Google+ LinkedIn Pinterest Tumblr Reddit

Why is Java considered a hard programming language?

Tags: Java
Question Id:68

Actually, compared to other languages, learning Java is about middling difficulty.

Pascal used to be used for teaching — it was designed to be a pedagogical language — and it was easy to learn. It wasn’t easy to use to build real things, until Turbo Pascal came along — and Delphi later — but those were no longer as easy to learn.

Practicality, it seems, is somewhat at odds with being easy.

BASIC used to be used for teaching, but had soooo many flaws and gotchas and general unpleasantness that it was best avoided, really. Now it’s essentially gone, and good riddance.

Python is the modern equivalent to BASIC. Everybody wants to learn Python, the same way everybody wanted to learn BASIC in the 1980s. Python seems easy to learn, but its simplicity is deceptive. Fundamental concepts like value representations, how types are handled, and pointers are mostly hidden.

If you never need to know them, you’re ok, but if you do need to know them, that lack of foundation knowledge can hold you back and cause confusion for years.

Likewise for JavaScript. Deceptive early simplicity gives way to acres of potholes and stumbling blocks and weirdness that hinder real understanding of programming.

Then there are languages that are more difficult. Haskell and Lisp are sometimes taught as first languages, and they do seem to work for that — if you’re of a particular mindset. The temptation is to say “mathematical mindset”, but that’s not really accurate; they’re no more “mathematical” than other programming languages, but beginners often find them difficult.

So… Java.

Though the Java libraries are complex, the essential language is simple. It’s less fraught with the perils of deceptive simplicity than BASIC, Python, JavaScript, Ruby, PHP, and similar languages, but it forces the learner to tackle object-orientation — encapsulation, inheritance, and polymorphism — and programming fundamentals — sequence, selection, iteration, expression evaluation, variables — at the same time as learning essential library mechanisms.

It’s a lot to take in all at once.

Therefore, I suggest starting with C.

I like C for learning. It’s like looking into the machine with all the covers off, so you can see the moving parts. The standard library is simple, it doesn’t hide pointers and value representations, and it doesn’t occlude programming fundamentals behind a veneer of object orientation. When you learn C, you really learn the fundamentals of programming and only the fundamentals of programming, along with a good dose of machine foundations.

But once you’ve used C to learn programming, unless you plan to be a systems programmer, switch to something like Java or C#.

C has many gotchas that will eventually bite you if you’re not a systems programmer. More than anything, don’t use C as a business application development language. For that, it is the wrong tool for the job.

And having learned C, picking up Java or C# is easy.

By the way, Java and C# are so similar that they’re effectively different versions of the same language. C# has a few more language features and C# people really like them. Java people think they add unnecessary noise, but we’re really comparing apples to slightly different kinds of apples here.

Think of C# and Java as the same thing.

I’d argue that learning C first, followed by learning Java or C#, is easier than learning either Java or C# on its own.

So why is Java considered a hard programming language?

In short, it’s because Java has hugely extensive libraries and object orientation and all the complexity of a fully statically-typed programming language. It’s made for building industrial-quality software machinery, which means it’s an industrial tool that requires an industrial-level commitment to learning it.

That makes it inherently complex, and complexity makes anything hard.

But don’t let that scare you. As I pointed out, alternatives like Python and JavaScript might seem easier, but they aren’t. Learn some C to begin with, then switch to Java. Then it won’t seem as complex — indeed, you’ll see how the features of Java make a lot of C easier and simpler — and you’ll be ready to learn to use it for what it was made to do: develop industrial-strength enterprise software.


It's probably because its very verbose. It means that reading Java code is tedious. In contrast, languages like Python are easier.

Think of it as reading complex Latin characters (with all their extra symbols) vs reading plain English.

However, this problem is exacerbated by the way Java is taught. I can give almost the entire basic essence of Java below. After that, it's easier to digest from whichever online course / bootcamp you follow. All other code is some combination of the below syntax:

List<String> myList = new ArrayList<String>();

The left hand side means myList is a list of strings, something like, “Mercury",”Venus",”Earth". The right hand side with the keyword “new” instructs the computer to allocate memory for this.

The line of code below is similar to the previous one.

List<Integer> myNumbers = new ArrayList<Integer>();

It means myNumbers is a list of integers like 1,2,24,5678 etc.

You can also have something like this, which is self-explanatory:

List<Employee> myEmployeeList = new ArrayList<Employee>();

Then, you can do simple things like:

System.out.print(“The total number of employees in my company is”+ myEmployeeList.size());

This will actually print the sentence: “The total number of employees in my company is 20” (or 30, or whatever number of employees you have). Size(), with the brackets () calculates that.

If I want to find out the total salaries of all employees, I write this code:


totalSalary =0;

while(i < myEmployeeList.size())


totalSalary = totalSalary + myEmployeeList.get(i).getSalary();



System.out.print(“The total salary of all employees is”+ totalSalary);

Basically i is 0 initially. Then it reads the salary of the ith item in myEmployeeList and adds it totalSalary. Then i is incremented by 1 to read the i+1 th employee. And when does it read the i+1 th employee ? When it loops back to while(I< myEmployeeList.size()).

It's not necessary to understand all of it the first time. As you can see, it's quite verbose with the additional symbology, and can be difficult to follow at first. But as one practices, one can read, understand and write complex Java code much faster.


Java (The language) isn’t considered hard. It’s your average everyday C style language. Lots of languages out there are C style, and they’re all easy-ish to learn just from pure language point of view.

The complexity then regarding Java is the implementation.

As far as I know, no tooling offered in the world of Java, which encompasses a lot is as good as something like Visual Studio from Microsoft.

You can do a lot with Java, and so knowing Java alone isn’t enough. Same could be said about other languages, but the actual implementation of what you’re doing can differ vastly depending on the exact project.

The short answer is somewhat lacking tooling and complex implementations and frameworks.


I think it is only considered hard by people who didn’t actually study the language. The Oracle certificate consisted of OCA / OCP (which have recently been combined to a single certificate as I’ve heard from the company I work for), each consisting of a good 600+ pages.

Learning the language by itself isn’t all that useful though, if you don’t build experience in the industry using the common frameworks like Spring and implementations of the Java EE standard. There is a leap of difference working on hobby projects of code bases that you built yourself, and working on legacy code bases that have been maintained and extended for decades by different developers of variable experience. There is also a difference between working on client apps (like eg Android) and backends that implement very complex business flows that you may not always understand business-wise when starting a new job. The Java isn’t always the only thing that makes it complex, but more so the understanding what the backend intends to do; often mixed with illogical or bureaucratic decisions that have been made in the past. There is also orders of magnitude more complexity in working for badly maintained monoliths based on old Java technologies that aren’t really taught anymore, and fresh microservices built with Spring boot.

Depending on the projects you work, you may have positive or negative experience with Java applications. In the industry it is common that junior consultants get stuck for the first few years in these monoliths that implement a lot of older technologies, and that may be supported by very complex configuration options. Consultants come and go, and it has been my observation that at times, certain tasks are ‘delegated’ to newly hired people at low budget, often under the guidance of some senior who has been sitting there for a decade and who just knows how the spaghetti works by mere experience with that specific tool. Sometimes the guidance is good, sometimes it is near inexistant; it sort of depends on the senior’s character, willingness and own workload. Whether this is a beneficial experience for the junior is something that could go both ways depending on the developer’s persistence and general character, I believe.

If you compare how for example web development is being promoted online based on modern frameworks (JS, PHP, Python, Java it doesn’t really matter); apps that get deployed on localhost and later on simple platforms like Heroku, self learning hobbyists can study incrementally with fairly minimal complexity. An hour of study gets you something running by following the api doc and some examples without really needing to dig into anything. There are so many services today that don’t give you a lot of headache anymore (like Firebase, auth libraries etc). New developers can write, run, it just works so that’s very nice. But of course I can imagine people will say Java is hard if you come from this background, and get thrown in very complex legacy Java applications you have no experience with. I can imagine your first reaction will be ‘wtf is this’, and that is probably normal.


java isn’t hard. It’s big. Java was built for industrial use. But the language itself is much smaller and easier than C++ with roughly the same capability. And it not really much more difficult as Python (but orders of magnitude faster).

Java has literally hundreds of libraries that are included as part of it’s distribution. Far more than C++, or Python. Learning the libraries seems like a never ending adventure and I think this makes it seem Java is hard. But learning library code is always hard because they generally have quirk, and learning those quirks is part of learning proper usage of the library.


I learnt Java programming about 2 years ago. It was one of my first year computer science course. I did not find the introductory parts of Java programming to be that difficult. However there was one project to be done in the final days of that course. We had to write java code for the client and server side of the socket in our local pc. Man that project was so so hard!

Basic syntax and introductory parts are very easy. When time comes to write complex code for sophisticated tasks, then we start sweating.

Your Answer

Review Your Answer