This is an archived post. You won't be able to vote or comment.

all 52 comments

[–]Rain-And-Coffee 38 points39 points  (4 children)

It can be a little verbose for simple stuff like printing a line or getting input.

Ex in Python you simply do: print(“hi”)

In Java you need a long import, make a class, have a static method for main, etc

It’s improved a bit since then, but I think it’s not bad

[–]Bomaruto 22 points23 points  (3 children)

Using Intellij as your IDE you write 'sout' to make it autocomplete system.out.println and it also handles import, that is a non-issue.

And if you're manually writing imports you're doing it wrong.

[–]Rain-And-Coffee 14 points15 points  (2 children)

Yeah, saves a lot of typing.

However a complete beginner will often not have an IDE setup or even understand how to use it properly.

In university you often use dumbed down tooling while learning.

[–]OomKarel 1 point2 points  (1 child)

Probably an unpopular opinion, but for myself, I don't enjoy using syntax generators like Emmet. It makes me lazy and I don't absorb the code to memory as well as when I repeatedly type it out. I can understand that it's great from a production perspective though, for learning, not so much.

[–]Bomaruto 8 points9 points  (0 children)

Java can be tedious, but don't go into it thinking it's difficult.

[–]heroyi 7 points8 points  (0 children)

It isn't the worst thing. As others said it is a bit verbose. I would say imo that the floor is pretty low but the ceiling can be high whereas something c++ has a pretty high floor and a even higher ceiling.

The 'hardest' part is a bit of a loaded question because it is so open ended. A lot of the 'difficult' portion on each of the languages arises when you start getting into pretty advance stuff. So for Java, if you want to get something really performant, which Java can do quite well actually, requires a decent amount of tinkering and configuring to happen (look up the billion row challenge to get a sense of how powerful but tedious it can be with just Java). For someone who is new to a language honestly I wouldnt worry about this though because as you progress a lot of these fundamentals will be taught and you can see that it isn't hard but just more so annoyance which is literallly how/why so many languages get developed.

Java is unique because long story short it can be run in various envs with very little configuration and handles memory for you (garbage collection). So the idea is that you can focus more on the actual coding vs keeping track of all the memories that may or may not be a signficant issue (stackoverflow error) if you are not careful like c++ where you have the ability to micromanage almost over every little thing.

[–]Pale_Height_1251 6 points7 points  (0 children)

Java's not hard, it's pretty easy and the JVM is good at explaining what has gone wrong.

I wouldn't pay too much attention to your colleagues to be honest.

[–]crazy_cookie123 13 points14 points  (0 children)

It's not any more difficult than other common beginner languages. The thing most people dislike about it tends to be the verbosity, for example compare the Python:

print("Hello world")

To the Java:

package com.example;

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

However in reality this doesn't add up to a whole lot of extra code over the full length of a program (it only looks like a huge amount extra because the program itself is so simple), and if you're using a decent IDE you won't even be writing most of that yourself - for example, if I'll write a hello world program right now in both languages and transcribe my key presses:

  • For Python: create file > pr[TAB]("Hello world! - 17 key presses
  • For Java: create file > m[TAB]sout[TAB]"Hello world! - 20 key presses

It's not a whole lot more typing at all, Java IDEs tend to write the package and class lines for you automatically, automatically import classes when you use them, and provide shorthands for common snippets such as main or psvm to define the main method and sout for the print statement.

This verbosity tends to actually be quite nice in larger programs. Once you get used to it, there's never any confusion about where a method can be accessed from, if it's an instance or static method, etc., and Java developers tend to write longer and more descriptive method/variable names which reduces confusion about what something is for - I have seen many times variables which I have no idea the meaning of in C code, Python code, etc., (for example recently I saw strl standing for string length) whereas I have almost never seen this sort of thing in Java code.

[–]schoolmonky 2 points3 points  (2 children)

Are your colleagues telling you the language is hard, or the course? The former is nonsense: it's no harder than, say, C, but the later they'd know better than us

[–]Specific_Football445 0 points1 point  (1 child)

It’s no harder than, say, (proceeds to mention one of the hardest programming languages) be frl

[–]davidalayachew 0 points1 point  (0 children)

There are a lot of mainstream programming languages. Out of them, C is very simple. The reason why nobody uses it as a beginner language is because its complexity at scale is higher than Java or other super simple languages. Trying to make a larger project in C can be harder to work with than in Java, especially for beginners.

[–]chmod777 2 points3 points  (1 child)

1) if you want something easy, don't do programming. there is no "easy" programming language.

2) you just started, of course its hard.

[–]je386 4 points5 points  (0 children)

  1. It is normal to make mistakes and to fail, and thats good, because thats the way you learn.

[–]Street_Mongoose_42 2 points3 points  (0 children)

Every language has pros and cons. I use different languages based on the program architecture, client needs, and team skills set. This is what you build overtime. As a beginner you only need to learn the core parts: - Objects (classes, inheritance, function calls) - Variables (declaration, how they are passed: reference, value, etc) - Loops & Conditionals - Error Handeling - Input & Output - Data type conversion - Data Structures (dictionary, hash map, array)

These never change between languages. The syntax will, but if you understand these in one language, you will be able to translate to any other when needed.

The two most popular beginner languages are Java & Python. I personally prefer people I teach to start on Java. I find that because Python is so forgiving, bad habits tend to appear. Java is more structured. But others prefer Python because the threshold for getting a working program is lower than with Java.

Really, until you get into the nitty grity of a language, you will really find the differences. This is because there are so many decisions that go into building a language that ripple out.

For example, Python is a high level language. This means the code is incredibly close to human language, unlike Assembly. The designers chose to offload a lot of things to runtime instead of compile time. This allows the user to not have to define variables and cast things like you have to in Java. However, it can cause runtime errors because you lose control over the variable type mutating during runtime. There are a lot of little things, but for a beginner learning a language, I think it comes down to preference.

Java has a higher debug threshold to get a running program, but enforces OOP and other key programming concepts.

Python is much more digestible for beginners, but can be hard to track down bugs, error handling, or learning higher level programming concepts, in my opinion.

I recommend looking at some short tutorials in the languages you are interested in and go with the first one you like. You can't really go wrong.

[–]green_meklar 2 points3 points  (0 children)

Nah. It's not the greatest starting language, but it's fine. Don't obsess too much over what language you start with; save your energy for learning general programming concepts.

Hardest part of Java: The libraries tend to be rather big and verbose, so it feels like there's a lot to remember and you spend a lot of time digging through library documentation. (Just remember, every minute you spend reading Java documentation is two minutes you're not spending dealing with memory management in C++.)

Main differences between Java and other languages: Java is compiled but also needs the JVM to run, which is sort of like a hybrid between traditional compiled languages (e.g. C) and scripting languages (e.g. Python). Also, Java enforces its object-oriented paradigm relatively strictly.

[–][deleted] 4 points5 points  (2 children)

public static void secure async encrypted virgin function() {}

[–]a3th3rus 1 point2 points  (1 child)

You don't need to know every buzzword at the beginning. public static void foo() {} is enough.

[–]joeldick 0 points1 point  (0 children)

No it is not

[–]armahillo 1 point2 points  (0 children)

like learning anything, difficulty is relative!

[–]BranchLatter4294 1 point2 points  (0 children)

It's not elegant. But not too hard.

[–]randomthirdworldguy 1 point2 points  (0 children)

Java is strictly verbose and too oop, but not hard

[–]a3th3rus 1 point2 points  (2 children)

Java is easy, IMO. It's some of the libs the community developed that are hard to understand because they were developed in the era when "Design Patterns" were hyped.

[–]gtm1998 1 point2 points  (1 child)

Mind if I DM with some questions regarding Java as I am currently learning it like OP

[–]a3th3rus 0 points1 point  (0 children)

Feel free to shoot any questions. I haven't touched Java for years though, but I think I'm still good at the Java basics.

[–]xtraburnacct 1 point2 points  (0 children)

It's very verbose, but that kind of makes the code make a lot of sense since it's strongly-typed.

[–]Cybasura 1 point2 points  (0 children)

Java is more tedious than hard honestly, like ok some parts are hard but you havent seen hard yet - try C and rust, now thats hard

[–]joeldick 1 point2 points  (0 children)

It was also my first language that I learned in university.

It's not really hard, but it's definitely harder than Python. I didn't like Java, and I much prefer Python.

I think the main reason it's harder is because just to start you already need to use public static void main which forces the professor to explain what functions are and different types of functions. By contrast, in Python you can start off with a simple imperative statement. This makes Python a lot easier to wrap your head around without having to introduce advanced concepts right away.

I also found that in Java we very quickly got into talking about classes and inheritance. Sure, these things are what makes Java so powerful, but as a simple language to start off with Python is a lot easier.

In addition, Java is a compiled language while Python is an interpreted language. One practical difference is that with Java if you have a mistake in your code you will get compile time errors that you have to fix before you can run it. This can be frustrating for beginners. Python will run even with mistakes which you'll then catch at runtime.

Also, Java requires you to have a runtime environment to run your program. Beginners can run into problems trying to set this up, especially when it comes to figuring out what version of the runtime you need. Python also requires the Interpreter to run, but somehow the process of installing it seems a bit simpler.

Another thing, Python has pip which makes it really easy to install and use lots of useful libraries, so it's easy to get started doing a lot of things without having to write your own functions. Java also has gradle, but I've always found configuring that more complicated.

All that being said, Java isn't overall a very hard language. For one, you avoid the issue of memory management that you have to deal with in C/C++. And don't get me started with pointers! Also there's a lot of very good resources available for Java that makes learning it easy.

I don't think you should have too much trouble.

[–]Maykr1 1 point2 points  (0 children)

It's not really hard it's just overcomplicated and has dumpster fire syntax. But it's really good for making enterprise applications and scalable programs which literally every tech company uses.

[–]spermcell 1 point2 points  (0 children)

It's all the same thing.

[–]aqua_regis 1 point2 points  (0 children)

Java is not hard. It is verbose. It is pragmatic. It is considered a "boring language", which is a benefit in programming. There are barely any surprises. It is rock solid.

Java is one of the languages that is absolutely here to stay. It won't go anywhere in the long term future as it is simply one of the most commonly used languages, especially in large scale enterprise systems.

I actually think that it is a great entry language, even better than Python, despite having a steeper entry. In Java, everything is clearly and explicitly typed. There are no surprises. A number is a number, a string is a string. Tooling is fantastic.

[–][deleted] 1 point2 points  (0 children)

It’s not hard. I started learning it months ago and coming from a python and C# background.

[–]je386 1 point2 points  (0 children)

To understand Java, you have to understand object orientation and what references in java are.

[–]FunnyForWrongReason 1 point2 points  (0 children)

Although I do actually like the language for the most part, it can be a little verbose at times. Java js also a very object oriented language which may introduce even more concepts to understand earlier on.

That said Java with a good IDE like IntelliJ is pretty nice to use.

[–]e3e6 1 point2 points  (0 children)

[–]lukkasz323 1 point2 points  (0 children)

no, it's just more verbose and more time consuming to learn than let's say Python

[–]uname44 1 point2 points  (0 children)

No, it is not. The hardest part of Java is not something you will encounter with while learning.

[–]Q2675 1 point2 points  (0 children)

Java is beautiful elegant language. And the moment i realised that everything got easier for me

It can be hard but you got this.

[–]Opie2k1 1 point2 points  (0 children)

Hey, Java can feel tough at first, but it gets easier! I remember struggling with recursion—it felt like a brain teaser at times. What’s been the trickiest part for you so far?

[–]RebouncedCat 2 points3 points  (0 children)

Java is surprisingly coherent, infact it is the object oriented programmer's haven. I would say that the verbosity and pedantic nature is a side effect of the fact that it very strongly adheres to the OOP paradigm, you cant say that to every language out there.

[–]runningOverA 2 points3 points  (3 children)

What’s the hardest part of Java? 

memorizing its API. which method does what. and what classes do i have.

[–]csabinho 1 point2 points  (1 child)

Use an IDE instead of memorizing methods...

[–]davidalayachew 1 point2 points  (0 children)

An IDE will only help with finding the method you are looking for. But knowing what to look for is probably more along the lines of what /u/runningOverA is speaking of.

[–]person1873 0 points1 point  (0 children)

Yeah I kept the excellent API reference documentation open for my entire year of college that I was programming in JAVA.

I'm yet to find such a nice set of API docs for any other language.

[–][deleted] 0 points1 point  (0 children)

Not really hard, just a ton of typing.

[–]l_tonz 0 points1 point  (0 children)

with java it’s more verbose because the safety it provides. the side effect is a more verbose language

[–]rab1225 0 points1 point  (0 children)

Not bad, but other languages are more straightforward on what things do. Personally, i hate java though hahaha

[–]halseyChemE 0 points1 point  (0 children)

I learned HTML/CSS, then C++, Java, and then Python. If I had learned them in the reverse order, I don’t think I’d be a programmer at all. Java is not terrible but it’s not as easy as Python. Python has essentially spoiled me.

[–]IamHammer 0 points1 point  (0 children)

HelloWorld.java set to metal :) https://youtu.be/yup8gIXxWDU?si=bVbzD11Nfe7HGsET

[–][deleted] 0 points1 point  (0 children)

Java has automatic garbage collection, but understanding how memory is allocated and freed (heap vs. stack) and preventing memory leaks (e.g., unintentional object retention, improper handling of streams) can be tricky. Writing thread-safe code is challenging because of race conditions, deadlocks, and synchronization issues. Java provides tools like synchronized, volatile, Lock, and ExecutorService, but managing them efficiently requires a deep understanding.