Re:Should I Learn Java in 2018
by lmm on Friday July 13, 2018 @08:30AM
(#17522331)
> SBT is hellish though
Agreed, ignore it, stick with Maven.
> the added complexity that Scala has imposes a lot of cognitive overhead.
That's just FUD and memes. Scala is more consistent than Java and much more consistent than Kotlin, which makes it much easier to concentrate on what your code is actually doing.
(This is why you will see some very complicated functions and datatypes written in Scala - it's only really practical to write a complicated function or datatype in a simple language, because otherwise the language will sap too much of your attention. But that's a reflection of those functions and datatypes; if you don't need a complicated function or datatype, don't use it. The language itself is simple)
> With Kotlin, you always end up writing cleaner Java and don't risk erring on the side of unneeded entanglement in the spaghetti monster that Scala can sometimes be.
Not true. Kotlin codebases that do the same thing look worse than Scala codebases or have subtle misbehaviours waiting; Kotlin has a huge number of ad-hoc special cases e.g. nullables, async, continuations are all special language features. Kotlin's ability to do error handling/validation is actually worse than Java's (no checked exceptions and no adequate replacement if you want to actually report the details of failures).
Agreed, ignore it, stick with Maven.
> the added complexity that Scala has imposes a lot of cognitive overhead.
That's just FUD and memes. Scala is more consistent than Java and much more consistent than Kotlin, which makes it much easier to concentrate on what your code is actually doing.
(This is why you will see some very complicated functions and datatypes written in Scala - it's only really practical to write a complicated function or datatype in a simple language, because otherwise the language will sap too much of your attention. But that's a reflection of those functions and datatypes; if you don't need a complicated function or datatype, don't use it. The language itself is simple)
> With Kotlin, you always end up writing cleaner Java and don't risk erring on the side of unneeded entanglement in the spaghetti monster that Scala can sometimes be.
Not true. Kotlin codebases that do the same thing look worse than Scala codebases or have subtle misbehaviours waiting; Kotlin has a huge number of ad-hoc special cases e.g. nullables, async, continuations are all special language features. Kotlin's ability to do error handling/validation is actually worse than Java's (no checked exceptions and no adequate replacement if you want to actually report the details of failures).