5 ms·
Java is really underrated. It is popular but it isn't thought of as powerful or cool as compared to python, haskell etc.. I disagree. a. Object oriented code d
by wizardofmysore 9y ago
Java is really underrated. It is popular but it isn't thought of as powerful or cool as compared to python, haskell etc.. I disagree.
a. Object oriented code done right is the best way to handle production code.
b. Java has introduced streams, lambdas etc.. has any other language shown this type of adaptation to times ?
c. Python, Ruby etc.. don't have equivalent performance
d. c++ obviously beats it on performance but I know the pain of porting c++ code
e. Most of the boilerplate code is either auto-generated or you can use Lombok type framework to generate them for you
f. Java made a really good comeback with Android
So the new kids in the block might not like Java because it isn't cool but Java has stood the test of time.
- dmitriid 9y ago> has any other language shown this type of adaptation to times C#
- aloisdg 9y agoWell C#? (and Android through Xamarin but I didnt use it so...)
- icebraining 9y agob. Java has introduced streams, lambdas etc.. has any other language shown this type of adaptation to times ? "Adaption to times"? Lambdas are older than Java itself. It was outdated in v1.
- notyourwork 9y agoI don't think lack of providing a feature because its exists makes a language out of date. I think OPs point was that the language has evolved more dramatically than other popularly adopted languages.
- eksemplar 9y agoIs it though? I work in the Danish public sector which is mostly windows based enterprise and 80-90% of our infrastructure runs on JAVA with no change in sight. Hell, most influential people will straight out laugh at the notion of JAVA losing steam. It did dip for a while some years back, but these days it’s frankly the strongest I’ve ever seen it. Of course it’s not popular for hobby projects, startups, academia or data science, but those fields are frankly dwarfed by enterprise on the job market. C# has a stronger hold in the private sector, but scince most of the public software is produced by the private sector even there JAVA runs strong.
- virmundi 9y agoI've been banging this drum lately on HN too. Spring Boot makes Java fast, easy, and simple. Yes, you still have to install a JVM on your image, but there are plenty of management script out there to get a container or VPS running. For people out there that look at all those getters and setters with contempt: you don't need them for your JSON objects. Just use public. The frameworks will still serialize and deserialize without issue. Use JSON annotations to define what a valid message is. Yes, you'll need a mapping layer between your JSON/inbound messages and your domain, but you need that anyway, otherwise your API is brittle. JPA + Spring can lead to fast DB code and development time that rivals NoSQL with Postgres. You can have it autogenerate the DB during dev time with each boot, then create Liquibase migration documents for true devops stability. After working with Go for a month, I really think Java just does things right. Servlet API is simple. Spring makes it easier. Transactional management + AOP is wonderful. So many cross-cutting concerns allow you to properly encapsulate and apply the logic in a few AOP. You just can't do that with GO without a lot of compiler work.
- jrs95 9y agoPersonally I've had the exact opposite experience with Spring Boot. To me it feels like they've basically had to metaprogram their way out of the limitations of both the language and the underlying APIs which are extremely verbose and obtuse. Every time Spring makes something more convenient, it also removes some static guarantees. Dependency injection issues fail at runtime instead of compile time, but that's not anywhere near the worst of it. Autoconfiguration in particular seems nice at first but can cause all sorts of weird issues. I once had a situation where we added RabbitMQ, and some other JAR started trying to bind to a queue that didn't exist, but the framework was swallowing that exception and it took hours of screwing around in the debugger to figure out what was going on. That sort of thing simply doesn't happen with Go in my experience. Or probably Dropwizard, honestly.
- kodablah 9y agoI agree with the answer of Java, but saying "object oriented [...] is the best way", "has any other language shown this type of adaptation to times", "etc.. don't have equivalent performance", etc is going to get you some flak. I don't agree with any of those statements. As someone who has done a lot of Scala and Kotlin, I appreciate Java because I can anticipate the bytecode that will be generated. This is important to me on low-level JVM projects (profilers, fuzzers, etc).
- zeveb 9y ago> Java has introduced streams, lambdas etc.. has any other language shown this type of adaptation to times? Well, Lisp added CLOS, which was a huge adaptation to the rise of OOP. It also originated lambdas. I don't know if streams originated in Lisp, or if they were an adaptation from another language. > Most of the boilerplate code is either auto-generated or you can use Lombok type framework to generate them for you That's why I prefer a homoïconic language: I can write & generate the boilerplate in the language itself. > Java made a really good comeback with Android I don't know if that's true so much as there really aren't good options to Java on Android. I'd give my eye teeth for a good Go GUI SDK for Android, for example.
- MarkMMullin 9y agoAgree 100% if you're implying Common LISP/CLOS as the most underrated.... it's fun to show people examples from the Art of the Metaobject Protocol and watch their heads explode :-)
- statictype 9y agoJava's main strength is the jvm. C# as a language is superior to Java in pretty much every meaningful way. All the things you mention about Java were done in C# and much more elegantly. Where Java shines is not the language but the runtime behind it.
- _RPM 9y agoWith C#, it's not _just_ the language. Typically, you'll pay for licensing costs of hosting the infrastructure required to run production grade C# applications. With Java, you can use open source infrastructure and servers.
- Zekio 9y agoThat is only if you use C# with .Net framework over .Net core
- jrs95 9y ago.NET Core is still pretty immature though. The quantity of third party libraries that support it is tiny in comparison to what you get with Java.
- hungerstrike 9y agoBut C# is still a better language that isn't as widely used (therefore it's underrated). And that's what we're talking about.
- Zekio 9y agoFrom what I can tell it is mature enough for stack overflow to use it
- jrs95 9y agoI was referring more to the overall ecosystem than the core platform, which is solid. Stack Overflow uses Dapper rather than Entity Framework, and that alone makes transitioning much easier. EF on .NET Core still just isn’t as good, and the third party library support isn’t as good either. For most people, I don’t really think moving to Core is quite worth it yet.
- jrs95 9y ago> Java > Object oriented code done right Pick one. But in all seriousness, Java is definitely underrated amongst many who are working with the trendier technologies. It's not perfect, but it gets the job done, and it's a solid platform with phenomenal tooling. I don't think "Python, Ruby etc. don't have equivalent performance" is actually very important though. In practice, the availability of developers in a particular market, legacy code, and static typing & refactoring tools probably have much more to do with Java's success than performance.
- cousin_it 9y agoJava has many features that are amazing for larger projects: * Instant recompilation * One string type * One error handling system * Capitalized identifier = class name = file name = imported name * English names for everything and no operator overloading All these are ignored by e.g. Haskell or Rust.
- jrs95 9y ago> English names for everything You mean like, AbstractSingletonProxyFactoryBean? Sure, it's English, but when you end up with a project with that many layers of needless abstraction, it's not going to be easily and quickly comprehensible by anyone who isn't already familiar with it.
- cousin_it 9y agoYeah, that's a fair point. I think factories and beans are a sign that object construction in Java is a mess. In the applications I work with, most calls to "new" are dealing with data structures (lists, maps, protocol buffers), and behavior-heavy business objects are a mostly static call graph. Not sure if there's a name for this pattern though.
- mixmastamyk 9y agoKotlin will get you these without the: Foo foo = new Foo(); Nonsense. Highly recommended.
- singularity2001 9y agoKotlin will be huge once HelloWorld takes less then 8sec to compile
- mixmastamyk 9y ago? Instantaneous on my box. Maybe time for a pentium overdrive. ;-)
- vram22 9y ago> Foo foo = new Foo(); The Golang FAQ calls that stuttering; good term, I thought. https://golang.org/doc/faq https://golang.org/doc/faq See section: What are the guiding principles in the design? "Stuttering (foo.Foo* myFoo = new(foo.Foo)) is reduced by simple type derivation using the := declare-and-initialize construct."
- JoeAltmaier 9y agoOr my favorite, for declaring/initializing static members: Foo::Bar *Foo::foobar = new Foo::Bar(Foo::Bar::FOOBARENUMVALUE);
- Spartan-S63 9y agoThe best answer to your point b is C++. It's shown a ton of adaptation to the times. Almost to a crazy extent as you see tons of new features hit in each standards revision (C++11, 14, 17, etc). To me, it keeps up more quickly than Java.
- mark-r 9y agoMaybe that's because it was so far behind to start with? And I'm finding it hard to keep up with all the changes. Some things just seem like they're awkwardly bolted on, like Lambdas.