7 ms·
just had this conversation with a co-worker today. java is a stable api but it also doesn't evolve. The tradeoff is you get a program guaranteed to work no mat
by Justsignedup 8y ago
just had this conversation with a co-worker today.
java is a stable api but it also doesn't evolve. The tradeoff is you get a program guaranteed to work no matter the upgrade vs being able to build better toolage.
React changes every year or 2. It is exhausting. But you get way better patterns and some things that drastically improve productivity.
- sixstringtheory 8y agoJava gives you a flexible object oriented language and an incredible set of libraries. It's got an archiver for artifact and dependency management. It now has lambdas and has FRP style stream programming. I'd say it's kept up pretty well with modern fashion, while it's been doing other things far longer than newer, more popular languages. Take Swift, now my daily driver (which I love so much compared to ObjC, which I moved to after Java)... an example of something Java had way before Swift is "Protocol Oriented Programming". Also, Swing's GridBagLayout predates iOS' AutoLayout and CSS (edit: don't know where I was going with CSS haha...). Everything old is new again, and I'm sure Java reinvented a few wheels of it's own. Also keep in mind that React is a library, not a language. If you want to compare things, compare Javascript to Java, or the Java stdlibs to React. Maybe that's what you meant when you said Java. IMO, Java and its libraries are nicer to work with solely due to its static nature and OO design. It is worlds apart from a scripting language when you need to refactor, or even just understand, legacy code. And if you can't even run tests on that legacy code anymore, like a React project over a year or two old? What are the better patterns and productivity boosts you get from React vs. a Java ecosystem?
- humbleMouse 8y agoIn addition to all of these good things, you can also use groovy which has a ton of shorthand syntax and makes writing code super easy. Groovy also makes writing tests short and simple. I love java and all jvm languages honestly.
- euyyn 8y agoKotlin though. Everything you said, but a joy to write instead of a chore.
- pjmlp 8y agoI am betting Kotlin is the new Groovy. Lets see where it stands 5 years from now, specially if Fuchsia actually gets released.
- ptx 8y agoKotlin is different because of the focus on tooling, which is the advantage Java still had over all the dynamically typed JVM languages. Also, Kotlin/Native is in beta now and could target Fuchsia (compiling AOT to native code using LLVM).
- pjmlp 8y agoWhat tooling? Being forced to use InteliJ, without any proper support on Eclipse and Netbeans? Still not able to use several of Android Studio features available to Java, like incremental compilation and slim APKs? Kotlin advocates seem to forget JVM will never be rewritten in Kotlin, the language is just yet another guest, with the usual syndrome to wrap existing libraries, having to take care about FFI for Java access, not having all features taking advatange of the latest bytecodes, e.g. lambdas implementation. As for Kotlin/Native, there is nothing to worry about versus what Go, Rust, C++, Dart, D, Nim offer in terms of performance, libraries and in some cases tooling. Having to buy CLion for a graphical debugger isn't a selling point versus the established alternatives. Fuchsia is being written in Go, Rust, C++ and Dart, with the team now hiring for node.js support. https://www.androidpolice.com/2019/03/19/google-working-to-bring-javascript-app-support-to-fuschia/ https://www.androidpolice.com/2019/03/19/google-working-to-b...
- coldtea 8y ago>What tooling? Being forced to use InteliJ, without any proper support on Eclipse and Netbeans? Seeing that both Eclipse and Netbeans are now more or less dead (and speaking as a long time Eclipse user, from the very first version to around 4), yes, first class vendor-direct InteliJ support is more than enough. And more than most languages (including Groovy) ever had. >As for Kotlin/Native, there is nothing to worry about versus what Go, Rust, C++, Dart, D, Nim offer in terms of performance, libraries and in some cases tooling. IMHO, Rust will always be kind of niche as hard to tackle, Dart we'll see, D never went anywhere, and Nim will remain niche, it's a little too idiosyncratic to catch on. Kotlin is already more popular than all of the above except perhaps Go. >Fuchsia is being written in Go, Rust, C++ and Dart, with the team now hiring for node.js support. Fuchsia is still vaporware or at least irrelevant. It's not even in the market yet. And the fact that it's written in 4 (and looking for 5th) languages doesn't really bring much confidence.
- freewilly1040 8y agoDoesn't evolve _quickly_. Which as you say is say is part of the tradeoff of giving a trustable guarantee that the tooling you do use will continue to work for a long time.
- mosdl 8y agoThere are plenty of java projects that change apis. Comparing a framework to a language is stupid.
- Consultant32452 8y agoI've been working professionally in Java for almost 20 years. I can't remember the last time I saw someone use features introduced after 1.6. The time API in 1.8 was nice. I've never seen anyone use lambdas in production code. I'm sure people do use newer stuff, but I think it's the minority. So in practice it's even more stable than it is in the headlines.
- Scea91 8y agoStrange, our production code is full of streams and lambdas. It probably depends on the type of product.
- euyyn 8y agoChromium (and so Chrome too) uses lambdas in its Java parts.
- qw 8y agoI work for a large company and the code base is full of streams and lambdas. Streams are almost used too much and could be replaced with a simple for-loop.
- ionised 8y agoYeah, stream overuse is definitely an issue at our company.
- jcadam 8y agoI started using Streams and lambdas immediately, along with functional interfaces. Java is still not nearly as pleasant as Scala or Clojure, however.
- ionised 8y agoWe start using new features pretty much as soon as the new JDK version is released to general use.
- astura 8y agoI started using them ASAP.
- jaabe 8y agoIf you develop, not if you maintain. This is a major reason we stay away from JS frameworks after burning the hands on implementing an AngularJS that was obsolete a year later. That and a few page reloads never killed anyone.
- deleted 8y ago[deleted]
- coldtea 8y ago>java is a stable api but it also doesn't evolve You have probably missed the last 5 years. From streams, to closures, to default methods, to functional interfaces, to local type inference, to new Process APIs, to modules, to unsigned arithmetic, to new date/time APIs, http client, 2 new GCs, shell REPL, etc... with more to come, and new releases every 3 months...
- ptx 8y ago> unsigned arithmetic I thought I had missed something there, but it looks like it's just a bunch of utility methods to reinterpret integers and convert them to longs (etc.)? Kotlin, on the other hand, recently added actual unsigned types[0] – taking up the same number of bits as the corresponding signed type, supporting the normal mathematical operators, and preventing unintended mixups with signed types. [0] https://kotlinlang.org/docs/reference/basic-types.html#unsigned-integers https://kotlinlang.org/docs/reference/basic-types.html#unsig...
- coldtea 8y ago>I thought I had missed something there, but it looks like it's just a bunch of utility methods to reinterpret integers and convert them to longs (etc.)? Yes, but it's also a new feature (along with dozens of others). The complaint I answered was that Java is stagnant somehow, when it has been evolving fast in the last 5 years, and is accelerating its pace (release cadenze) even more. >Kotlin, on the other hand, recently added actual unsigned types[0] – taking up the same number of bits as the corresponding signed type, supporting the normal mathematical operators, and preventing unintended mixups with signed types. Which, given that the JVM doesn't support them at the bytecode level (iirc), they also use some similar trick of working with signed numbers under the hood, just hide it better at the syntax level.