Anyone who knows me knows that I hate Java with the fire of a thousand suns, but this is just sad. Most of these are true of any programming language. There are plenty of legitimate reasons to hate Java besides the fact that its concurrency utilities are as utterly shite as those of its 90s contemporaries, like the fact that it does not support multiple inheritance, or remote interface implementation, or any form of namespacing besides the goddamned filesystem, or unsigned integers, or string formatting. Or you could rant about the primitive type/object dichotomy and how you can’t use primitive types in generics, or the fact that type erasure is a thing and you can’t return a generic type from a method because javac is too stupid to remember what generic parameters you passed to a class, or the JVM’s atrocious memory efficiency, or the fact that it’s not backwards compatible thus requiring end users to install multiple versions of the JVM for different projects, or
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.
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 pretty much anything except JS.
Arguably there’s Typescript now, too.
Could be worse, could be programming Javascript (or Typescript).
A 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>
By that logic we should all program with .bat files
Bash and bat scripts are really useful for that reason. You’re making a bad generalization from my comment. But the premise from OP seems to be that a language’s value is how hard it is to get started.
I think you forgot to pollyfill your console.log and now you have some error in some script in some callback
I love javascript. Shit. Just. Works.
Even if you, the programmer, are a complete fucking moron, by god javascript will try to make your program run as long as possible.
Even if you, the programmer, are a complete fucking moron, by god javascript will try to make your program run as long as possible.
I mean it might not work as intended but it’ll run and not complain!
god damn right
Javascript doesn’t “just work”. It’s a language originally designed to glue actions to html elements and it is fundamentally broken in ways that will be never be fixed. Weird syntax, weird type coercion, horrible base types & functions, surprises galore. Even Typescript, which is basically a precompiler, is just JS with some type checking. The only reason anyone uses either is because it is ubiquitous - people have to use it.
It’s the greatest language on the planet.
Javascript is a beautiful language where ‘3’ - 1 = 2 but ‘3’ + 1 = ‘31’.
Exactly
Trying to print hello world is actually pretty easy
public static void main[Args]{ SystemPrintOutLn("Helli world"); }
That’s should be it. But I can devinetively agree. For simple tasks Java is to complex because you need to do to much stuff prior to it. If you have more complex things its actually not that bad since if you have a good polished infrastructure it can be quite good.
Java
Thats your first mistake bucko
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 can’t tell if you are making a joke but I can believe it could happen if it’s Java
I mean… they have them. And
unsafe
. You’re just not supposed to use them
C# has
NullReferenceException
and it actually makes sense.
Am I weird for liking Java? I feel like it just makes so much more sense than other languages.
C# is nearly the same, but much, much better.
- It doesn’t (usually) come with the Java culture 8 layers of abstraction. This isn’t in the Java language. This isn’t in OO. Yet nearly every Java programmer makes things way more complicated than it needs to be.
- It’s a prettier language. Similar syntax with less bullshit.
- It’s open source
- It’s still multiplatform. Modern dotnet / C# works on anything.
- Both Visual Studio and Visual Studio code are great IDEs that blow Eclipse out of the water
- It’s one of the most common business languages.
- It’s going to be supported forever.
If I could restrict the world of programming to two languages, it’d be C# and Rust. C# for most things and Rust for a lower level language.
Isn’t Visual Studio Code just a fancy editor and not an IDE?
Kids will never understand this. The same is with
JScript
.
Nah, C# suffers from a lot of the same shit Java does. Needing everything to be a class is just no longer a good design choice (if it ever was). AOT support is still lacking. I don’t get, why it does not have typdefs. I think the solution / project structure is unnecessary and I could probably think of more stuff I dislike about C#. But imho, it still beats Java.
Golang is my choice over C# any time. I strongly prefer how interfaces are handled and I actually like the error handling.
Is there anything I can read about how we’re moving away from everything being a class?
No sorry, but try literally any other language ;-)
Needing everything to be a class
In 2015 they added scripting. If you’re making a real project, you should absolutely use classes. (It’s not that hard. Don’t do the Java shit.) But you can absolutely write one off scripts just fine.
AOT support is still lacking.
Publishing your app as Native AOT produces an app that’s self-contained and that has been ahead-of-time (AOT) compiled to native code. Source.
I think you misunderstood my post. I am quite proficient with C#. I just think other languages do it better.
AOT is not where it should be yet, because not all libraries have full stripping support.
I strongly prefer how interfaces are handled
It’s better than Java, but they still chose to walk headfirst into the same trap that bites Java developers in the ass: associating interface implementations with the struct/class rather than the interface itself.
When you have two interfaces that each require you to implement a function with the same name but a different signature, you’re in for a bad time featuring an abomination of wrapper types.
Edit: Clarity.
On that last note, can’t you use the explicit interface implementation in C#?
e.g.
public class SampleClass : IControl, ISurface { void IControl.Paint() { System.Console.WriteLine("IControl.Paint"); } void ISurface.Paint() { System.Console.WriteLine("ISurface.Paint"); } }
Edit: I misread your comment as “like in C#” and wrote this as an answer to the non-existent question of “can’t you use explicit interfaces like in C#”
I haven’t kept up with recent Java developments, but with Go, you’re out of luck. Interface implementations are completely implicit. You don’t even have an
implements
keyword.Edit: For Java, a cursory search suggests that they haven’t yet added explicit interfaces: https://stackoverflow.com/questions/19111090/does-java-support-explicit-interface-implementation-like-c
He mentioned C#, which does let you explicitly choose to implement same-name functions of two interfaces with different code
For some reason, my brain inserted a “like” before “in C#”, and answered the question of “can’t you use explicit interfaces like in C#.”
just one more oop bro I swear
Pure oopium. All oop ‘design patterns’ exist solely to overcome the inherent flaws of oop.
just one more oop bro I swear
Didn’t understand my criticisms of Go and Java’s interfaces, or do you just enjoy LARPing as a senior programmer while living in a small world where the term “interface” strictly means object-oriented programming and not the broader idea of being a specification describing how systems can interact with each other?
I’ll take Python and Fortran, thank you very much
Python should be burning in hell
Nah, that’s Java and JavaScript.
I only had one job that used C#, and it was the worst job I ever had. Even with the worst possible way to be introduced to the language, I still love it.
I like how straight-forward the syntax is. And it also seems orderly to have everything be a class. There’s a system to it.
I’m using C++ for a project now and I like it in a similar way, but there’s more freedom (everything doesn’t HAVE to be a class). So with C++ I’ll never go back to Java (unless it’s for a job).
No. Every language has its haters. There’s a reason Java is so widely used. If you like it, keep at it.
Yes and the reason is because millions of lines of production code were written and it isn’t worth rewriting them.
Plenty of languages around now that don’t have 30 years of baggage and the specter of Oracle hanging over it.
Now a days many businesses choose Go.
I don’t really like Go either, but it’s better than Java, and it’s pretty good for Big Software ™. In the end, every language has some problems. Java just has all of them.
Now a days many businesses choose Go.
Many companies may choose something other than Java, but Java is still the behemoth.
Such a decision is taken when the company is completely new or if it is a green field project.
Even in the case of the latter, companies just choose to stick with their existing tech (read: expertise and experience of their tech teams)…
The only reason not to choose Go is legacy systems with SOAP. That shit will never die.
I thought I like Java until I tried Kotlin. It’s everything I liked about Java, but with everything wrong with it fixed.
I used to be very into Java and Kotlin looks nice. What’s your favorite IDE?
I use IntelliJ Idea. The free Community Edition is all you need.
Thanks.
I am a certified Java hater, but you’re allowed to like it. If simple and objected oriented is what you want, I can see the attraction, and it has a good and mature ecosystem.
Honestly I would consider that a bit weird. At the very least, old-fashioned. If you like Java, it makes me think you haven’t tried a better more modern language to compare it with.
The first language I learned was Python and I hated it. I have not tried Rust yet but I have tried all the Cs.
Edit: added missing not
(I assume you left out a “not” there)
You should definitely give Rust a shot. It is only conceptually similar to C++ but otherwise very different.
Which would you suggest? (And if you say python, I will attack you with a pointed stick)
Definitely not Python. Rust is very nice though.
No, Java has lots of merits. For example, once you know layout managers, you can have a resizable GUI app in no time. It’s the exact opposite of arranging things pixel by pixel. You just define “I want a grid of these buttons south and a big text field in the center” and Java will do the rest. I whip up apps like this for the silliest things, like noting which dungeon has what rotating boss this week in a game, so it’s more convinient than noting it in a text file.
And GUI is even easier and faster with Compose.
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
It’s like 5 lines of trivial code
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.
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.
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.
My old boss is one of the 3 initial creators of Java. He ran our department the same way this greentext reads.
He was also a paedo. You can figure out the rest if you dig.
Known for : the Java programming language, internet sex crime and the fantasy defense.
Are you saying OP is…
No.
It’s written pedo. I don’t know where the “paedo” thing came from.
From PIE root “pau-” (few, little), to Latin-transliterated via Greek “paed” (boy, child), and spelled thusly to distinguish from “ped-” (foot), circa 1600AD. Reduced to “pedo” from “paedo” as part of the shift in Americanization of accents and spelling in the late 1700s early 1800s.
Confidently incorrect.
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+.
My inner mathematician respects Java. The first step in any problem is defining your universe
You may find JML interesting. https://www.openjml.org/
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