5 ms·
Java was: 1. Wow, this program runs on any platform! 2. Wow, no need to free memory! 3. Wow, threads and locks are so easy to do! Then many years later 4.
by gtrubetskoy 10y ago
Java was:
1. Wow, this program runs on any platform!
2. Wow, no need to free memory!
3. Wow, threads and locks are so easy to do!
Then many years later
4. Who really cares about cross-platform code if all I do is on Linux?
5. Why does this program require 4GB of ram?
6. Must I really download and install the JVM all the time, and what is it good for anyway?
Go:
1. Wow, I can write stuff that previously could only be done in C/C++, and I can do it almost as easily as writing Python or Ruby.
2. Wow, I don't need anything installed for my program to run, it just runs!
- peteretep 10y agoYou're in stage 2, then.
- dig1 10y ago2. Yea, right. Obviously you haven't run enough Go binaries
- gizzlon 10y agoReally? I also find that to be true for the go stuff I run. The last example is nsq[1]: Download, unzip and run the binaries .. aahh :) Obviously this can be true for non-golang programs as well, but I can't think of any right now. 1: http://nsq.io/deployment/installing.html http://nsq.io/deployment/installing.html
- incepted 10y ago> 4. Who really cares about cross-platform code if all I do is on Linux? Most developers write their code on Windows and MacOS and then deploy on Linux. I'd say this "Write once run anywhere" thing was and still is a pretty big deal. > 5. Why does this program require 4GB of ram? Oh no! I need to buy a $5 piece of hardware to run this Java code? What kind of nonsense is that? > 6. Must I really download and install the JVM all the time, and what is it good for anyway? Once or twice a year, if you really want to. You update your browser much more often.
- m_mueller 10y ago> What kind of nonsense is that? .. and then someone gets the idea that your application should now run natively on Android phones, since they all run Java anyway, right?
- incepted 10y agoYes, they all run Java. What's your point?
- frankzinger 10y agoI'm guessing his point is that "4 GB" is a big problem on a phone.
- incepted 10y agoYes it is, but his number was an exaggeration in the first place. There are hundreds of millions of phones running Java today, what does that tell you?
- m_mueller 10y agoThe point is that memory still matters, not that Java is inherently a problem. You're shifting the goalpost here - earlier your claim was that 4GB is not a big deal since we can just buy more memory, now it's that 4GB is a ridiculous number anyway. It's not if you meet one of these typical "don't do any premature optimisations (even in the design phase of my data structures), because some important CS person said so"-designs. There's all too many programmers who think they should never have to care about hardware anymore.
- goodplay 10y ago> Oh no! I need to buy a $5 piece of hardware to run this Java code? What kind of nonsense is that? Funny. That's Microsoft line of thought with Vista.
- 10y ago
- catnaroek 10y ago> threads and locks are so easy to do! I don't think concurrent programming was ever particularly easy in Java. If you're talking about `synchronized` methods, well, they are of limited usefulness (to put it mildly) when you need to lock objects in an interleaved fashion: "lock A, lock B, unlock A, lock C, unlock B, lock D, unlock C, etc.", which isn't too uncommon a user case. > stuff that previously could only be done in C/C++ (...) almost as easily as writing Python or Ruby Metaprogramming, any? C++ has templates. Python and Ruby have metaclasses. What does Go have?
- spriggan3 10y ago> What does Go have? Go generate AKA C Macros but even worse since there is no macro syntax , you have to code you own code generator yourself .
- bad_user 10y ago> 4. Who really cares about cross-platform code if all I do is on Linux? Deployment happens mostly on Linux, but development happens mostly on OS X and Windows. Having guaranteed behavior, compiling it only once, being able to deploy as a simple JAR file, the same JAR file that you tested locally, is awesome. > 5. Why does this program require 4GB of ram? Java is actually very memory efficient, all things considering. There are Ruby developers choosing JRuby for deployment because of that efficiency. By the time Go's GC will reach the same maturity, it will behave similarly. > 6. Must I really download and install the JVM all the time, and what is it good for anyway? The JVM ensures consistent behavior across all platforms and is able to do optimizations based on runtime profiling, with JVM bytecode acting as a very efficient ABI, making the JVM an efficient target for multiple languages, including Scala, Clojure, Groovy, Ruby, Kotlin, Ceylon and others, languages that have been able to bootstrap easily and have a huge ecosystem at disposal because of the JVM. > 1. Wow, I can write stuff that previously could only be done in C/C++, and I can do it almost as easily as writing Python or Ruby. Go is not a replacement for C/C++ because it has a GC. In fact it's impossible to use Go for the same use-cases where C/C++ is required. And if you can use Go, then you can use Java as well. And in fact, because Java is more mature and has alternatives like Azul's pauseless GC, it's more amenable for projects with soft real-time constraints. > 2. Wow, I don't need anything installed for my program to run, it just runs! That's cool sometimes, but Java is almost as ubiquitous as POSIX and HTML5. On Linux it's basically one "apt-get install" away, just like everything else. So the advantage of not requiring a runtime for me is, you know, meh.
- fauigerzigerk 10y ago>Java is actually very memory efficient, all things considering That makes me wonder about your universe of things to consider. Java's terrible memory usage was set in stone the moment they decided not to include structured value types.
- threeseed 10y agoValue Types are being worked on now for Java 10+. https://en.wikipedia.org/wiki/Project_Valhalla_(Java_language) https://en.wikipedia.org/wiki/Project_Valhalla_(Java_languag... The Java language is definitely not set in stone.
- spriggan3 10y ago> 5. Why does this program require 4GB of ram? The biggest issue with Java IMHO , 6 not so much since deployment is automated. > 1. Wow, I can write stuff that previously could only be done in C/C++ Not true, like at all. Every Go does can be done with Java.