Forgot the JVM eating the entire machine’s RAM for breakfast
JVM is like a gas. It expands to fit it’s container, however large that is.
My inner mathematician respects Java. The first step in any problem is defining your universe
You may find JML interesting. https://www.openjml.org/
Java is terrible and I hated it but I feel like this stuff is not why, this mostly just seems like stuff that most powerful object oriented languages do.
Java is amazing and I love it, and I agree that this is not really a good list of problems. (Not that I expect green texts to be well thought out, rational, real, fair, or anything other than hyperbolic rants lol.) There are good reasons to critique it and the ways people use it, but this isn’t it.
Particularly funny is the one about race conditions. That’s something you’d have to deal with in any sort of multi threaded environment.
I still think Java is good for teaching newbies precisely because it will throw an error quickly if they are doing it wrong.
Rust over there like
Hey kid, tired of putting off your problems?
So will so many better languages, more so actually.
So will pretty much anything except JS.
Could be worse, could be programming Javascript (or Typescript).
An text file with a <script> block and nothing else, containing a console log, is all you need. You already have all the boilerplate to run it in any computer. No extra dependencies, no installing anything. Literally just a notes editor app. This is a valid HTML file:
<script> console.log("Hello World") </script>
Hello World
30 minutes of boilerplate
writing imports
$ cat <<EOF > Hello.java public class Hello { public static void main(String args[]) { System.out.println("Hello world!"); } } EOF $ java Hello.java Hello world!
ok
This is getting a little better nowadays.
> cat Hello.java void main() { System.out.println("Hello, World!"); } > java --enable-preview Hello.java Hello, World!
Things to notice:
- No compilation step.
- No class declaration.
- Main method is not
public static
- No
String[] args
.
This still uses preview features though. However, like you demonstrated already, compilation is no longer a required step for simplistic programs like this.
Python:
print("Hello world!")
C:
#include <stdio.h> int main() { printf("Hello World!"); return(0); }
EDIT: POSIX-compatible shell:
echo "Hello World!"
Python2 is only one character longer:
print “Hello world!”
And you get proper data types too.
Shell is only meant for duct tape scripts, you know to tie two regular compiled programs together
Welcome to java, we have a couple unconventional ways of doing things, but overall I’m like every other mainstream oo language.
People: AHH! Scary!
Welcome to python. your knowledge of me wont help you elsewhere as my syntax is purposefully obtuse and unique. Forget about semicolons, one missed space and your code is as worthless as you after learning this language.
People: Hello based department
**kwargs
“No, I don’t use type annotations because they don’t actually do anything. In fact I purposefully give this parameter different types for different behaviors. How is that confusing?”
Oh my god I got fucked by a python script once because of a single space. It took forever to figure out what went wrong
Python has its drawbacks but it also has a pretty useful standard library so as a language for small scripts, one can do much worse
It is possible to dislike both. For me SmallTalk-like languages are peak. Message passing for life!
I got the impression they skipped the hello world cause it was too easy and they wanted to get right to writing their app, so they moved on to more advanced stuff without having a real grasp of the basics
He types REALLY slow.
I really enjoyed the text.
From the perspective of a python programmer it all seems valid.
A Java-Dev would probably write the same about an embedded engineer.
Honestly, I prefer C to Java, it’s incredibly simple without all the BS that Java throws at you:
- interfaces - compiler will fail if you provide the wrong types; w/ Java, figuring out what types to pass is an effort unto itself
- functions - everything needs to be in a class; even callback functions are wrapped in a class (behind the scenes if you use modern Java); in C, you just pass a function
- performance - Java uses a stop the world GC, which can cause issues if you have enough data churn; in C, you decide when/if you want to allocate or free memory, no surprises
There are certainly some bad parts, but all in all, when I run into an issue in C, I know it’s my fault, whereas in Java, there are a million reasons why my assumptions could be considered valid, and I have to dig around the docs to find that one sentence that tells me where I went wrong w/ the stuff I chose.
That said, I prefer Rust to both because:
- get fancy stack traces like I do in Java (I really miss stack traces in C)
- compiler catches most of my stupid mistakes, Java will just throw exceptions
- still no stupid interface hell, I just satisfy a specific trait and we’re good
- generally pretty concise for what it is; I can rarely point to a piece of syntax and say it’s unnecessary
I use:
- Python - scripting and small projects
- Rust - serious projects or things that need to be fast
- Go - relatively simple IO-heavy projects that need to be pretty fast
- C - embedded stuff where I don’t want to mess w/ the Rust toolchain
Java has been absent from my toolbox for well over a decade, and I actively avoid it to this day because it causes me to break out in hives.
As embedded dev, the stack trace alone scares me. It would be funny to watch the Java runtime blow the 8 frame deep stack on a PIC18 tho
Sorry, you had a small error in the spacings of your post; Therefore I cannot parse a thing you’re saying. Didn’t mean to scare you with a semicolon either. It’s just a tool in language’s to end a clause and begin a related, independent clause. That could be useful somewhere…
Must be several years old - otherwise, javafx deserves quite a bit more ire.
Aside from the general stupidity, Java is a heavily front-loaded language in my experience. I’m not going to engage in any tribalism about it or claim that it’s better or worse than others. As a matter of personal taste, I have come to like it, but I had to learn a lot until I reached a level of proficiency where I started considering it usable.
Likewise, there is a level of preparation on the target machines: “Platform-independent” just means you don’t have to compile the program itself for different platforms and architectures like you would with C and its kin, as long as the target machines have an appropriate runtime installed.
Libraries and library management is a whole thing in every general-purpose language I’ve dealt with so far. DSLs get away with including everything domain-specific, but non-specific languages can’t possibly cover everything. Again, Java has a steep learning curve for things like Maven - I find it to be powerful for the things I’ve used it in, but it’s a lot to wrap your head around.
It definitely isn’t beginner-friendly and I still think my university was wrong to start right into it with the first programming classes. Part of it was the teacher (Technically excellent, didactically atrocious), but it also wasn’t a great entry point into programming in general.
I’m not a Java dev, but I know enough of it to fix simple bugs in the backends I work with. My main issue with it is that 99% of the code doesn’t seem to do anything. The clear, obvious place that looks like it handles the feature you’re looking for? None of it does anything! It just instantiates another class from God knows where to actually do the work. I swear I spend most of my time in Java projects just looking for the damn implementation in a sea of AbstractSingletonFactoryBean shit.
The dev culture certainly contributes to the problem. In the attempt to modularize, isolate functionality from expectations and create reusable code, a mess of abstraction patterns have sprung up.
I get the point: Your logic shouldn’t be tightly coupled to your data storage, nor to the presentation, so you can swap out your persistence method without touching your business logic and use the same business logic for multiple frontends. You can reuse parts of your frontend (like some corporate design default structures) for different business apps.
But you can also go overboard with it, and while it’s technically a dev culture issue rather than a language one, it practically creates another hurdle to jump if you want to use Java in an enterprise context. And since that hurdle is placed at the summit of the mountain that is Inheritance, Abstraction and Generics… well, like I said, massively front-loaded.
Once you have a decent intuition for it, the sheer ubiquity makes it easier to find your way around other projects built on the same patterns, but getting there can be a confusing slog.
I’m sorry just as a matter of policy I’m going to have to downvote you for saying you like java. Nothing personal.
I think some things that were novel when java came out are such old hat at this point the 1990s benefits just aren’t benefits anymore. Run anywhere? I’m in a html app right now. As is my IDE and my chat app. Strong interfaces and sane types are only in comparison to the bizarroland of c++ which visibly always seems to basically be word vomit. JIT compilation is in python which is both easier to use and has way better tooling and libraries…making python today run in the “fast enough” category that java was kinda in. I’ve literally never seen a usable java UI tho.
So you’re going to stride past the part where I say “I’m not going to […] claim that it’s better or worse than others”, ignore the bulk of my comment on Java being hard to get into, make a point of declaring you’ll downvote for stating a personal opinion, then pretend it’s “nothing personal”? I’d be curious how that makes sense in your mind.
Anyway, like I said, I see no point in petty tribalism. I like Python and C too - that’s not mutually exclusive. I hope you have a pleasant, Java-less day :)
I was attempting to combine my genuine belief that nobody has ever written a java app that is any good along with humor. As an end user java has always been the scourge of human existence. I’ve never written a line of java code and have no opinion on that.
I’m not sure you’d even notice all apps that are made with Java, particularly Enterprise Web apps. But yeah, if you’re going for humour, maybe jokingly shitting on people’s opinions isn’t the safest bet.
“not going to engage in tribalism”
Moments later, engages in tribalism
You’ve really got to lighten up, don’t feed the trolls
What came across as tribalistic there? Pointing out that you might not immediately see the tech stack of every Web app you use is hardly saying “Java is better”, and suggesting to not shit on others’ opinions is kinda the opposite: I’m saying your opinion disliking it is fine, just as mine liking it is.
don’t feed the trolls
Fuck me for trying to take people in good faith and have constructive conversations
Minecraft is a decent example of a good java program. People jump to the first silly reason to disregard it. Cope.
You seem very butthurt over a joke, be chill
Have to admit I didn’t know Minecraft was in java. Explains the graphics ;p
Python and Java are barely comparable. I adore both languages equally and use them about the same amount at work. They are just different tools better suited to different tasks.
Care to expound? Why barely comparable? I’d say 90s java and today’s python fill a similar niche of barely functional apps with performance issues.
I’m sure that’s Fireship, without clicking the link.
Nah it’s not you should check it out
You made me expect a Rickroll
All I hear is I brightened someone’s day ;)
My experience with Java over the last 2 decades or so. Shame Android gave it extra life, thankfully Kotlin exists now.
Yup, I swore off Android dev almost entirely because of Java, and then Kotlin came out and Android programming was tolerable again. Not fun, tolerable, lipstick can only make a pig so appealing…
I might have agreed a decade or two ago, when I knew no better. But today, I find the tribalism surrounding programming languages comical.
I don’t particularly like Java, but I use it because it pays the bills. Similarly, I use C++ (which I prefer) when my work requires it.
I don’t particularly like Java, but I use it because it pays the bills. Similarly, I use C++ (which I prefer) when my work requires it.
I mean, anon is not arguing against that. They’re saying the language is shit regardless of how much it is used in business. I don’t think they are entirely wrong.
Tell us more ancient one, your heroic tale of “giving up against the endless weight of capitalism” is fascinating.
“giving up against the endless weight of capitalism”
We just call it “having a job” nowadays
Lol I always forget how conservative software devs are, oop
Love the dramatics.
This ancient one has learned the art of pragmatism. A little time in the trenches of enterprise development can do that – turn passionate ideals into practical choices.
Some days it’s C++, some days it’s Java, Python and so on. In the end, the code compiles, and the ancient one get paid.
Dramatics are my main form of communication so thank you for your appreciation
If it took anon 30 minutes to write hello world in java, programming is not for anon.
We bow to your wisdom, wise gatekeeper
Thank you. If you bothered to read a 5 minutes tutorial instead of posting to 4chan, you could also reach this level of knowledge.
Don’t be mad, you’re the one that commented lol. It’s like you’re choosing to be upset
I thanked you for your reply and suggested reading a tutorial. How does that make me mad and upset? You’re acting weird.
It’s like 5 lines of trivial code
Some of us try to understand what we’re doing, rather than just copy/paste. It’s easy to discount how difficult learning the basics of something is when you’re already past it.
And most IDEs will autogenerate it for you.
That said, I think it highlights everything I hate about Java:
public class MyClass {
Why does it need to be a class? I’m not constructing anything?
public static void main(String[] args) {
Why is this a method? It should be a top-level function. Also, in most cases, I don’t care about the arguments, so those should be left out.
System.out.println(“Hello world!”);
Excuse me, what? Where did System come from, and why does it have an “out” static member? Also, how would I format it if I felt so inclined? So many questions.
And here are examples from languages I prefer:
C:
#include “stdio.h”
Ok, makes sense, I start with nothing.
int main() {
Makes sense that we’d have an entrypoint.
printf(“Hello world”);
Again, pretty simple.
Python:
print(“Hello world”)
Ok, Python cheats.
Rust:
fn main() {
Ooh, entrypoint.
println!(“Hello world”);
I have to understand macros enough to realize this is special, but that’s it.
In C, Python, and Rust, complexity starts later, whereas Java shoves it down your throat.
C# masterrace and I’m tired of pretending it’s not
C# is nicer Java, but I think it’s still fundamentally a poor language.
Rust master race:
fn main() { println!("Hello world!"); }
Unfortunately, the time you save typing you’ll spend compiling, so there’s that…
After close to two decades of programming, C# is still the best language I’ve used. While some of the newer features seem a bit weird, I’d say it’s one of the few languages that has never got in the way and has just let me write code that made sense. Even with all the improvements Java has made over the years it’s still nowhere near as good as what C# was like maybe 15 years ago.
The same goes for everyone’s other “fav” language, Python. Ruby has been a better beginner scripting language than Python for many years, and while Rails is definitely a ghetto, as a language Ruby is great at teaching great programming fundamentals.
C# is pretty good generally - I know it far better than any other and it pays my bills! - but it certainly has its weak points. Particularly around the newer features, a lot of them feel really rushed and just kind of shitty.
The one I hate the most is the whole “nullable” pattern. It’s a total mess. Having to mark up files as
nullable enable
, having to mark methods with a bunch of attributes, and the way that it works differently if it’s a value type or a reference type, it’s just so half-baked.If you spend some time with a more modern language like Rust or Swift then you’ll quickly start to notice C#’s weaknesses.
I feel like you’re doing something wrong with the nullables… I’m pretty sure you don’t need to mark up files, you can just enable it on the whole project? I’m not sure about the attributes, you might have a point there, but it just makes sense for value vs reference types IMO, since value types are already implicitly different in terms of nullability.
But yeah, I can imagine it’s half-baked, since nullable reference types (that’s the name, previously reference types were just nullable by default with no extra features) are a more recent addition to the language, one that wasn’t built with them in mind.
If you create a new project from scratch, yes, you can enable it project-wide. If you have a project which has a bunch of code predates nullable reference types, and you enable it project wide, you’ll have a billion warnings about it. Also, they’re warnings and not errors by default, which just encourages developers to either ignore or suppress them.
So the reality is that you need to remember when you’re making new classes to add the attribute, and then deal with external stuff - which isn’t always clearly marked whether it’s nullable or not unless it’s using attributes, by the way… just such a total mess.
They should have just gone with something more like Rust’s “Option” type. Would have been clearer for codebases that have to deal with a mix. They also could have clearly and decisively deprecated non-nullable reference types and just told people they were going to remove support in some future version so we could all migrate to them properly like we’ve done for .NET Core/.NET 5+.
C# has had string interpolation for, what - nearly a decade, now? It arrived with C# v6, which was released in 2015.
Meanwhile Java just pulled their implementation out of the latest beta earlier this year because they couldn’t get it to work right.
Don’t know about you, but I think that Java is largely resting on its laurels as of late. That the only real reason to go for it is it’s third-party library system, and not much more.
Not using Eclipse helps. Using Scala helps even more
Really want to go to La Scala one day but I looked it up and the tickets are like 500 euros. An eclipse is much cheaper
I also think Java is shit, but if you manage to get a NullPointerException while writing a hello world program, maybe anon is just not cut out for computers?
I always loved that Java has a NullPointerException but doesn’t have the concept of pointers in the language (only references).
That is because they planed to add pointers and then gave up.
I mean… they have them. And
unsafe
. You’re just not supposed to use themI can’t tell if you are making a joke but I can believe it could happen if it’s Java