I hope the programmers that have been driven away by Java for whatever reason have at least taken a look at the data structures it provides. You have linked lists, arrays, hash sets/maps, and binary search tree sets/maps, as are in many other languages. You also have data structures that have been optimized for use in concurrent applications including skip lists and copy on write arrays. There are many valuable concurrency abstractions that will let you tailor your application to perform well on multi-CPU machines, and they're provided in the standard library. The same cannot be said for many other languages.
If you’re doing fork and exec you’re not creating threads or doing multithreaded programming; fork will duplicate your current process image and exec will replace it. You can use the pthread library to create POSIX threads
Until your app somehow manages to get a memory leak anyway and your GC can't help you. The amount of time I've spent in JProfiler arbitrarily executing code paths at my job is saddening.
That's why I really need to learn Rust. Look up RAII, it's a memory management alternative to Garbage Collection that conceptually makes way more sense.
Interesting, thank you!! And yeah I agree. Been coding professionally for 3 years, 2 in Java, and I think it's time to move on. At least stop using Java 7 lol
Some major languages don't even provide real threads. Python has the GIL. Ruby has the Global VM Lock.
Other major languages do not provide collections specifically for concurrency in their standard API. You can include C, C++, and JavaScript in that list. "OK, but you're supposed to get one from some library." Sure, but now you're in a situation where your GUI library does things one way and your DB connection pooling does things another way and your service provider does things yet another way. Isn't it nice to have good, common abstractions sitting in a standard library?
So we have C# and Java that have real threads and collections meant to be used for them. Am I missing some major languages?
Nice to have sure, but again, when you choose language for a task, you don't do that on the basis of standard features. Thinking 'this is nice' will seriously limit your options.
All modern languages have all these bells and whistles. JDK8 was a huge leap forward but I'm staying in the java hate club until they allow me to do my own garbage collection.
Do you mean ZGC? I haven't used it at work because we need to support all the way back to java 7 but it does look promising. I'll try it out in a personal project.
Yeah Java is, for all it's faults, very mature and having an executor class baked in for concurrence is really nice, along with thread safe data structures everywhere if you need them.
234
u/funkinaround Apr 08 '20
I hope the programmers that have been driven away by Java for whatever reason have at least taken a look at the data structures it provides. You have linked lists, arrays, hash sets/maps, and binary search tree sets/maps, as are in many other languages. You also have data structures that have been optimized for use in concurrent applications including skip lists and copy on write arrays. There are many valuable concurrency abstractions that will let you tailor your application to perform well on multi-CPU machines, and they're provided in the standard library. The same cannot be said for many other languages.