3 ms·
Java dev here, excluding legacy code, very little reason. I find clojure a significantly better language, and theres always kotlin / scala if static typing is
by joncampbelldev 10y ago
Java dev here, excluding legacy code, very little reason.
I find clojure a significantly better language, and theres always kotlin / scala if static typing is your thang.
People tend to conflate the not-so-nice java language with the good parts (libraries and JVM). The performance of the JVM and the same massive ecosystem of existing libraries are available in clojure, scala and kotlin.
- pjmlp 10y agoUsing JVM without Java, is like being on UNIX and not using C. Sure there are lots of goodies on user space, but there isn't any way around it, when you want to extract all juice from the platform.
- joncampbelldev 10y agoPerformance wise I've never encountered a problem: - protocols have the same performance as interfaces but with significantly more power (solving the expression problem by default prevents so many headaches when you have to add more functionality later) - loops and other binding constructs can have type hints to allow java-speed numerical operations - immutability by default does have a cost in memory and cpu, but the ease and safety of concurrency it has enabled in my codebases more than makes up for it, e.g. "oh i've got a large (>100000 elements) of data being processed here in various ways (map, filter etc), lets parallelise that and give it a thread pool" I feel that if I were truly performance constrained in clojure its likely I would have performance troubles in java, the difference is just not big enough. BUT if such a situation came up, theres nothing to stop me coding up my super duper ultra performance needed code in java and just calling it from my clojure codebase. Interop is very nice. YMMV but its never been an issue in my day to day work (mainly involves analytics, visualisation, web services)
- roboguy12 10y agoMy experience with kotlin so far has been great. I've used it in personal projects, and am in the process of converting some microservices at work to it from java (the interop is seamless, so I'm able to do it incrementally as opposed to a full rewrite). People ask me what the difference is between kotlin and java, and I typically reply with "it's java, minus all the bad stuff". Variable types are inferred, map/reduce/filter are builtins and don't require going through a Stream, there's no need for Guava anymore since listOf() and mapOf() are builtin, boilerplate-reducers like data classes continue to speak to the whole "it's pretty much java, but how you _want_ to write it" mantra. It nails all of the little things that java has just missed, like in an if-block after checking a variables instanceof, you don't need to explicitly cast it to that type. There are tons of simple things like this that just come for free, and when you go back to java it's amazing how much extra, pointless boilerplate you need to write. I personally don't see any reason for me to ever write java again.