8 ms·
In the world of web development why would one pick Java(or Kotlin) over TS/node.js ?
by ithrow 4y ago
In the world of web development why would one pick Java(or Kotlin) over TS/node.js ?
- boomskats 4y agoJava's superior G1/Parallel/Serial GC that they're changing?
- pphysch 4y agoI'd wager TS/node/etc going the way of PHP and JQuery in the next decade. SPA will go full WASM (which you could technically use Java for) and non-SPA will be built off better browsers (e.g. WebKit adding nested CSS) and HTMX-style solutions. Note that it doesn't mean everyone will be rolling their own WASM-based engine, but that there will be a bunch of public WASM-based engines (like PyScript/Pyodide stuff) that are tailored for specific domains than one-size-fits-all React. This leaves "full stack JS" in an awkward middle ground. Sure, you could still use it on your backend (like PHP), but why? We use JS because there were literally no other practical options, but better browsers and WASM are providing new options.
- cbm-vic-20 4y agoJava has really good runtime monitoring capability. Being able to get a thread dump from a production system, or generating Flight Recorder logs for offline analysis is incredibly useful. Is there something similar in the Node ecosystem?
- winrid 4y agoNope. You can get a heap dump which gives you object allocation stats by "object shape" which is incredibly less useful than stats by ClassPath.
- 62951413 4y agoFor the same reasons you'd pick golang over python/TS. Only you'll get higher-level abstractions (pattern matching, FP-style maps/flatMaps&Co throughout the standard library) and powerful collections with full support for generics. Better yet, start with Kotlin from day one.
- alfalfasprout 4y agoAt that point, why not Scala?
- dxxvi 4y agoAgreed. If somebody doesn't know Java and decides to jump to Kotlin, I will have the same question: why not Scala which is used more than Kotlin on computers (i.e. non-Android)?
- zmmmmm 4y agoI'm not necessarily advocating for Kotlin but the key argument would be supportability. Scala is a very complex language+ecosystem with idioms many people are highly unfamiliar with. Comparatively, Kotlin can be written idiomatically in a way that the vast majority of developers will readily understand and quickly come up to speed with.
- hibikir 4y agoI personally love scala: It's been my main language at work for well over a decade. However, the barriers of entry are real, especially since arguably the most popular styles of the language demand learning the most esoteric parts of the language straight away. If your organization is well seeded with very experienced people, they'll be able to train people up, but it's oh so easy for things to go wrong. If you are looking for all the advanced type system features, kotlin is definitely not going to put you in the same spot, but if you are hiring Java devs, training them is a far easier lift: They can mostly train themselves. I'd hope that after another version or two of scala3, when more organizations are happy running it in production, we might have an easier onboarding road, where we don't have to explain implicit parameters, implicit conversions and implicit classes, just so that we can get to the real meat that is the mechanics of type classes. But, as is, there's good defensible reasons for many teams to go try Kotlin first.
- the8472 4y agoIt can execute application code on more than one thread at a time. Something I'd think people would appreciate in the age of many-core systems.
- cageface 4y agoI've been doing backend dev in Node/TS for the first time recently after working mainly in Python or Ruby for many years. And overall I have to say I'm not very impressed. The tools and frameworks are immature and it's annoying having to deal with all the unfixable flaws in JS. If I were starting a new company today I would certainly seriously consider Java or Kotlin instead.
- madduci 4y agoType safety, performance, more battle tested ecosystem just to mention a few points on why it's better than node. Personally I would never trust JavaScript on backend.