5 ms·
I don't get why people complain so much about Java. It's definitely not perfect, but it's not a complicate language to use. People complain that it is slow; w
by AYBABTME 14y ago
I don't get why people complain so much about Java. It's definitely not perfect, but it's not a complicate language to use. People complain that it is slow; well it's much faster than dynamic languages. People complain that it is verbose. Yeah, maybe more compared to dynamically typed languages. But personnaly, I don't have much of an issue with Java. It's not hard to read, not hard to write, and to my experience, its runtime behavior is easy to predict.
When I look at benchmarks of languages (notably this [1]), and compare Java to say Ruby or Python, it's about 40 times faster, and compare pretty well versus C++. And I'd rather code something in Java than in C++ everyday, all the time.
Now I'm not versed in the benchmarking of languages, and I don't care that much about them as I understand that they are not very reliable. But when I need a lil'more performance than Python or Ruby, but that I don't want to ruin my psychological balance with C++, I'm quite happy to have Java.
Maybe it's just my lack of knowledge that gets me to have this opinion. Maybe once I get a chance to try out Go and Scala, I'll find there is no reason to use Java anymore. But I don't think I'll get to the opinion that is it terrible and that it deserves to be hated and laughed at.
[1] http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php http://shootout.alioth.debian.org/u32/which-programming-lang...
[Edit1] weakly -> dynamically
- icebraining 14y agoPeople complain that it is verbose. Yeah, maybe more compared to weakly typed languages. I think you mean dynamically typed, which is not the same as weakly. But even that is not true: there are plenty of statically typed languages which are nowhere are verbose as Java, due to cultural differences, type inference, first-class functions, pattern matching, etc.
- AYBABTME 14y agoYou're right, I meant dynamically typed. I edited, thanks!
- pjmlp 14y agoWhat I don't like is: - checked exceptions (usually leads to codebases full of empty try/catch blocks) - the way generics got implemented - how the current designers are afraid to change the language and keep adding annotations instead of new keywords (@override, @value, @notnull, ....) - lack of type alias (typedef in C, type in Pascal/C/Go) to shorten declarations - it would be nice to have aot compilation available as part of the standard toolchain, instead of forcing us to buy third party compilers But the language is still quite usable and fulfills its purpose
- yummyfajitas 14y agoTry out Scala. It's a superior substitute for Java in every possible way. And even if my last statement is hyperbole, you can still use Java in your scala project for the critical parts where scala doesn't do a good enough job. Sbt, the standard scala build tool typically builds you src/main/scala and src/main/java folders. Write scala in the scala folders, java in the java folders, they can easily refer to each other, it's all seamless.
- sek 14y agoThat is not true, you can program such an unmaintainable mess in Scala that is just not possible in Java. You don't have to implement every programming feature just because it exists. That makes Scala inferior in reality. In my opinion the reason why Scala will never be mainstream. There has to be a balance between features and simplicity.
- TylerE 14y agoThere will always be a market for a language without training wheels.
- thebluesky 14y agoFor a language that will "never be mainstream" it seems to be picking up steam pretty fast. We're very happy with it. Sensibly written Scala code is much easier to read than Java, and that's coming from someone who has been using Java for a long long time.
- notimetorelax 14y agoIt's funny my boss was thinking of trying Scala, but the more he learned about it the more he became disillusioned. I remember reading somewhere that although you might decide to limit use of Scala language facilities (as there are too many of them), you'll still have to deal with them when trying to understand how libraries work (for debugging purposes for example).
- 14y ago
- djhworld 14y agoI've been using Go recently and it's pretty good, but the main problem is the lack of generics. If you use a lot of generic code in Java, you're going to really miss it in Go.
- luriel 14y ago> If you use a lot of generic code in Java, you're going to really miss it in Go. Doubt it, Go code has much less need for generics than Java code. This is in part because of Go's interfaces which cover some of the same space, because Go has builtin map and slice types, and because the general coding style in Go. Have you really felt the need for generics when writing Go code? Because that is very, very rarely the case for me, and talking with many other Go programmers, the need for generics seems to very rarely come up when actually writing real world Go code. One has to realize that features are not interchangeable across languages, just because they are essential to some language doesn't mean that they even make sense in another language.
- djhworld 14y agoI run into most issues when implementing datatypes like stacks/queues etc It would be so much more beneficial to write one stack struct with associated methods rather than having to duplicate functionality for each type. It's possible to use empty interfaces, but then you have to do runtime type assertions which defeats the point of static typing. Maybe I've just been spoiled by Haskell/Java in that side of things, but I really feel that compile time static typing solves A LOT of development problems
- pjmlp 14y agoLack of generics has made me move to D instead.
- clwoodson 14y agoMy problem with java is not the language itself. It is the bloated, over-engineered frameworks that were built on top of it that way too many companies bought into. See EJB2, JSF, etc... Way too many java frameworks make the job at hand harder. A huge smell to me is that java frameworks have... frameworks... which have frameworks to finally arrive at a frankenstein's monster that is semi usable until its not and then woe-be-the-engineer saddled with its architecture. JSF is by itself is unproductive to develop with, so frameworks like RichFaces rose on top of it, which were also not enough, so other frameworks like Seam rose on top of them. And one feature of Seam is to make the JSF event-based framework behave more like an action-based framework ala struts or spring MVC. Maybe this should beg the question, "WTF are we doing with this dubiously helpful technology (JSF) at the foundation of our (web) technology stack?" Its interesting to me that many "new" languages getting implemented are built on the JVM (or are old languages ported to java). I expect the JVM will outlive Java by a long margin.