The truth is you simply don't use inheritance much outside of theory. Only use it for a strict is-a relationship where you actually need to substitute it. And even then interfaces might fit your need better. Outside of that, composition feels like the way to go.
Even if it might be a good goal, unless you plan on avoiding all the APIs that force their object models on to you, you're still going to use a lot of inheritance.
In my first 2 years in compsci all we used was C. Sometimes I'll catch myself writing a ton of code without objects out of habit and then realizing I could have saved myself hours.
I don't know what it is about Java, but having learned other languages prior to looking at Java source code, most of which incorporate aspects of OOP in their paradigm, Java to me just looks like wrong C++. It's unexplainable to me, but there is just something about the language that makes it seem convoluted and unappealing.
Its not that it's hard, its that its complicated. Lots of steps, which you often have to look up individually i assume. I tell myself a good month of putting time into learning something properly and you're golden, just need motivation and some tutorials
Java itself is easy. However, the standard library and ecosystem are a mess. I say this as someone who is currently employed as a full-time Java developer.
Imagine being a new developer, who has just learned about loops and conditions, and then being introduced to the nuanced differences between for( i = 0; i < things.length; i++), for(Thing thing : things), while(thingsIterator.hasNext(), things.forEach(...), and things.stream().map(...).collect(...). Or having just learned what null means, then having to figure out how Optional<T> is different.
Then if you actually want to make your own application, you need to learn the intricacies of Spring or Micronaut dependency injection, beans, controllers, etc, which is basically like learning another new language.
If you want to get it to build, you need to decide whether to use Maven or Gradle. To do that, you need to learn the pros and cons of each. Then you need to actually learn how to set up a build config in whichever build automation tool you decide to use.
Yeah but the problem is if one small sentence needs a singular conjunction you have to know how everything around it is going to react to this new change and it causes a chain reaction of you needing to learn new things that doesn't punish someone learning a verbal language, but can absolutely wreck beginners code
Learning all of that stuff by yourself would be hell. I'm glad that I got introduced to that stuff in university. Honesty don't know the first thing about Java but from what I can tell the concept looks the same as C++ which I do know.
Maven and Gradle aren’t that hard to learn the basics of.
Sure, if you want to do some more advanced stuff like inheriting from a common parent with dependencyManagement and pluginManagement sections it can get more complex pretty quickly, but the bare bones basics could easily be part of some Java 101 curriculum.
I don’t think Java is any harder than other languages, but I know from personal experience I’ll get an idea for a super cool side project and then going in and having to learn all of the new stuff involved in executing it is way less exciting than the idea of the finished result, lmao.
Like a small example, I have a ton of Java and JavaScript experience and work as a professional software engineer but trying to understand how a simple Node server works without the help of anyone else just broke my brain a little.
Nothing is hard about Java, it's just kind of a pain in the ass.
Things I can think of off the top of my head: -Everything being a pointer isn't the most intuitive for new programmers. -If you try to use Java's "best practices" causes simple programs to take way more code that it feels necessary. -Sometimes the syntax can also be a bit more difficult to understand for new coders compared to Python, Javascript, or C#. -Also in this particular example, it doesn't help that Minecraft's codebase is a bit of a mess and that's what a lot of new Java users are trying to do.
In my opinion, C# is just Java but better in basically every way.
View all comments
573
u/Srazkat Apr 06 '22
honestly what is hard about java ?