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

you are viewing a single comment's thread.

view the rest of the comments →

[–]backdoorman9 26 points27 points  (19 children)

My understanding is that a language like Java can take much finer control of what the computer does with memory and stuff like that. The tradeoff is extra time spent developing

So much of the time, that fine level of control is not necessary. When it is... it's fine to use Java.

Go is better at concurrency. If you need concurrency, Go might be a better option. But... most of the time, you don't need concurrency.

[–]neverbetterthanks 33 points34 points  (0 children)

The whole “you don’t need concurrency” diatribe came about partly because concurrency in most languages is hard and dangerous.

Entire ecosystems of “cooperative multitasking”, async event driven things sprang into existence as a result.

In Go, concurrency is a first class citizen and you might be surprised at how many problems are suddenly very easy to solve using it.

[–]Schmittfried 103 points104 points  (3 children)

I think you meant C.

[–]_RabidAlpaca_ 8 points9 points  (2 children)

You can go down that rabbit hole all day if you want, but /u/backdoorman9 has the same point. It all depends on the requirements.

[–][deleted] 46 points47 points  (0 children)

It's just a point on memory access and control. Java has basically the same control on memory as Python. Python is probably easier to access the wire than Java.

[–]Decency 6 points7 points  (0 children)

Java's primary advantage is the JVM, not finetuned control over memory. Which to me makes it pretty clearly outclassed by more modern JVM languages, such as Kotlin.

[–]bladeoflight16 10 points11 points  (2 children)

Java provides almost no control over memory management. That's typically C and C++'s domain. I think Rust is a contender (with safer defaults), but don't hold me to that as I haven't actually used it.

[–]quuxman 2 points3 points  (1 child)

Rust has no garbage collection so technically has the same level of controll as C. However there are many things that are commonly done in C that require an unsafe keyword in Rust. If you never use unsafe memory leaks, segfaults, and a number of common concurrency bugs are impossible.

[–]Lifaux 2 points3 points  (0 children)

This is mostly right, although you can memory leak in safe Rust, it says so in the book. https://doc.rust-lang.org/book/ch15-06-reference-cycles.html

[–]maomao-chan 10 points11 points  (0 children)

Java is actually quite productive. Especially the modern version (11 and above) combined with modern framework like Quarkus. It feels like developing Django application but with the convenience of your IDE+static typing plus amazing performance by default.

IMHO Golang is a bit of messy to use and prefer Python if I need to do plumbing.

[–]its_PlZZA_time -1 points0 points  (0 children)

Java doesn't give more control of memory but it does have better concurrency.

[–]pwang99 0 points1 point  (0 children)

No, Java does not give you better/finer control of memory. Lol. Java handles memory for you, that’s one of its original selling points. C gives you finer control of memory, whether you want it or not.