5 ms·
Java won for a bunch of reason: 1) It’s fast. Like almost C/C++ fast. Yes like any language you can write crappy slow code in Java but it is fast by default.
by ecopoesis 8y ago
Java won for a bunch of reason:
1) It’s fast. Like almost C/C++ fast. Yes like any language you can write crappy slow code in Java but it is fast by default.
2) While certainly not an easy language it is a simple language. The number of footguns in Java is pretty small.
There’s only a little of magic that languages like Ruby and Python have. Which of course means the programmer has to be more specific and add lots of boilerplate. And if you get it wrong the compiler yells loudly. And there’s none of the memory management ceremony from C/C++ that everyone gets wrong constantly.
GC can lead to hard to explain madness but your basic enterprise CRUD app is never going to see that.
3) The standard library is awesome. Things like Java collections and concurrency just work: no fuss. And when you need to reach into the back of the tool cabinet the defacto STL provided by Apache is incredible. Need something super specialized like an ordered bidi map in a tree? Apache’s got one and I have faith it’s well tested, decently performant and has good documentation
A decade ago Java could be terrible. There were a lot of people pushing giant XML confine. But even then you could always use code and smart folks did. Today the XML stuff is kept for comparability but the world has moved on. Modern frameworks end up looking and acting a lot like Rails.
- whatshisface 8y ago>There’s only a little of magic that languages like Ruby and Python have. >And there’s none of the memory management ceremony from C/C++ that everyone gets wrong constantly. These statements are the spitting image of the Blub essay[0]. No matter what language you like, the world splits into languages where you have to do lots of things manually with high risk of mistakes, languages that have tons of sneaky implicit behavior, and your language. [0]http://wiki.c2.com/?BlubParadox http://wiki.c2.com/?BlubParadox
- sanderjd 8y agoThe "blub paradox" is an opinion piece; it is not gospel. I did a bit more than two thirds of my career in non-"blub" languages. I like those languages, I know them well, I am good at them. For the last couple years I've been writing Java. I find it to be a much better tool for the job. A little bit more typing really isn't a very big deal.
- bogomipz 8y ago>"2) While certainly not an easy language it is a simple language." I was curious about this comment, could you elaborate? How can it simultaneously be both "not an easy language" and "a simple language"?
- ecopoesis 8y agoI think Java is simple because it’s small. There are only 50 keywords and ~40 operators (many of which are variations). As a comparison C# has 102 [1] keywords. Java code is generally easy to understand assuming some familiarity with other languages. There aren’t many weird symbols or constructs. There are very few exceptions to the basic rules of Java. It just does what you’d expect most of the time. Java feels like a lowest common denominator language— a kind of average of everything else. This “simpleness” is part of what makes Java not easy. It is not very expressive. Java (outside of memory management) does not give the programmer a lot of help. You have to explain things to it in excruciating detail, being very specific and never leaving anything out or the compiler will complain. The lack of expressiveness makes some things really hard. Just look at the number of dependency injection frameworks that exist for Java. Or logging frameworks. At a certain point of project complexity everyone ends up fighting their language. It feels that with Java that point comes early then most others. But cleverly I think it comes after a level of complexity that most people end up hitting in enterprisy CRUD apps and that’s a big part of why Java is so popular. [1] https://stackoverflow.com/a/4980785/858463 https://stackoverflow.com/a/4980785/858463
- bogomipz 8y agoThanks for the clarification. The list in that link is interesting. I hadn't seen that before. Cheers.