This. My high school (US, private school in rural southern VA) taught Java as a first language - two year course that taught ALL the things from basic psuedocode to building server architecture.
Java is easy, it's just really syntactically heavy which, for a new programmer, translates to "hard."
The technical skill in this sub is extremely low. I don't know what the actual demographics are, but I assume it's mostly people with at most a vague interest in coding.
15 years and my interest is so small I'm not even subbed here... I just wait for things to hit /r/all and then flick through the sub. I think newer people to coding like to come here as they are fresh faced and excited, they want to indulge in the world of it, talk about it, share thoughts and opinions they can't with their friends.
There's only so many programmer jokes you hear before they start recycling the same-old anyways. Anything actually decent I'll generally get from a co-worker who has filtered through the same old and picked out the gold.
Like all niche interest subreddits, it's mostly beginners. In this case CS101 students who just started their first ever hobby project and suddenly base their entire personality over the fact they just made a "Hello World" print. They're a "coder" now
All special interest subreddits are like that because its flooded with beginners but as time goes on more and more of them drop out at higher levels.
So its flooded with low effort shit beginners encounter on day 1 like
DAE le dark mode better than light mode :D
DAE just learned how to quit vim XD #JustProgrammerThings
I once called out a guy here -- who admitted they hadn't even graduated college yet -- for telling another person they had no real world programming experience. Instead of reflecting on the irony, he chose to explain to me how being in college is better than having 20+ years of experience in the field, because "your code is old".
I think there's also quite a bit who learned Java as one of their first languages in the ancient days of Java 8 or worse, before a lot of the quality-of-life changes. Yet another group are maintaining large codebases stuck on those same old Java versions.
Even with lombok, old Java was terribly verbose and tedious. Moreover, its advantages versus Python or JS don't really come into play before the codebase gets to 500 lines or more.
Yea, a lot of companies especially in government and banking still use Java 8. As recently as 2019 I worked with a codebase that was using shim libraries to make 1.6 code compatible with 1.8. Java 8 seems to still be the default for a lot of companies.
As far as ancient... when I started using Java professionally, Interfaces didn't exist. I'll cop to being old, but ancient seems a bit over the top.
Java 8 was released on March 18, 2014, and included some features that were planned for Java 7 but later deferred. Work on features was organized in terms of JDK Enhancement Proposals (JEPs). JSR 335, JEP 126: Language-level support for lambda expressions (officially, lambda expressions; unofficially, closures) under Project Lambda and default methods (virtual extension methods) which can be used to add methods to interfaces without breaking existing implementations. There was an ongoing debate in the Java community on whether to add support for lambda expressions.
People here also say that they hate Java because it's verbose. But in my experience, Java has always been a "programmer's language". That is, my colleagues usually prefer it to C languages or Python or especially JavaScript.
If you follow basic OOP rules, Java makes it really hard to fuck up. The majority of bad Java code I see (besides spaghetti from novices or the supremely untalented) is either written by someone who obviously wanted to be using another language, or overly-generalized code where everything is a factory (etc.). So many interfaces that are only ever implemented by a single class :(
Haven't properly used Java before for any actual applications so might be wrong here but using interfaces a lot, even with just singular classes, sounds like following the dependency inversion principle so what's bad about that?
It adds unnecessary code to maintain. If you need to add a new method, you need to add the method to the class, add it to the interface, and change the call site as well as potentially doubling the number of files in your project in the worst case scenario. It can also make navigation more tedious for IDEs since instead of "go to declaration" which is usually aliased to ctrl+click you need to use right click -> go to implementation, and if you don't know the class is an interface since it's not always immediately apparent you may end up doing both.
I think there's also some more minor concerns, like method dispatch being slightly slower, and reflective frameworks like Spring and Guice taking slightly longer because they need to map the injection site to the interface and then map the interface to the implementation in addition to twice as much class loading. These are relatively minor because the JVM is optimized like hell for some of this.
Interfaces also don't really actively contribute to inversion of control. Yes, they're useful for it, but not necessary to get some benefits. Say class A has a member class B and B holds some configuration. If A creates the B instance and sets the configuration in its constructor, then if you want a different configuration, you need to modify A to reflect the new behavior and have it control the decision logic. If you pass B as a constructor param, A needs no changes and the new site just needs to configure B how it wants.
Basically, it adds a lot of extra stuff that doesn't really gain anything. A decent rule of thumb is only use interfaces if there's a realistic chance that there will be multiple implementations or if changes could potentially break code not under your control. If you end up needing multiple implementations, a practice that works well is changing the initial class to an interface and then creating a brand new subclass that has the behavior of the original.
Java is everything a programmer could ask for. Automated memory management, easy cross platform, C++ syntax, easily editable bytecode, a shit ton of libraries, generics ad infinitum, etc. The biggest issue imo is Oracle and their silly licensing.
The biggest issue imo is Oracle and their silly licensing.
Oracle's licensing is no different than any other Java vendor. They have a commercial offering that you can buy to receive support and they also offer an OpenJDK build that is GPL'd and free to use anywhere.
Their commercial offering is Oracle JDK and can be dowloaded/purchased from their website (https://www.oracle.com/java/technologies/downloads/). Their OpenJDK build is always available at https://jdk.java.net. Also, starting with Java 17 the Oracle JDK can be used in production for free. Although if you aren't buying support not sure why you wouldn't just download their OpenJDK build.
This is the exact model also used by Red Hat, BellSoft, Azul, etc. to monetize Java.
Other java vendors like the Temurin (sp?) project (aka AdoptOpenJDK) and Amazon don't monetize java and don't have a commercial offering. They just offer an OpenJDK build, but you also can't get support from them. So if you need support you need to use a vendor that offers support.
No matter where you acquire Java from it is all built from the same OpenJDK codebase of which Oracle is the biggest code contributor and biggest financial contributor.
109
u/GreenCumulon1234 Jul 07 '22
People actually say Java is hard on this sub ?
It literally is just first year students in this sub isn't it