3 ms·
So what? A language's complexity is measured (by developers) as the mental effort required to learn and read it -- not by the regularity of the grammar. Java is
by pron 11y ago
So what? A language's complexity is measured (by developers) as the mental effort required to learn and read it -- not by the regularity of the grammar. Java is a relatively very simple language (for a statically typed one) -- even with its corner cases. It's certainly more complex than C and a little more than Go, but it's much simpler than C++, C#, Scala, Ada, Rust, Haskell, OCaml and pretty much every other statically typed language out there with more than 1000 users.
- lmm 11y agoThese aren't just theoretical grammar issues. Every beginner struggles with when you use == and when you use .equals(), or the differences between casting primitives and casting objects. I've witnessed even very experienced developers get confused reading generic bounds, or fail to take advantage of multi-catch or generics inference. All I can say for your comparisons is that I disagree with many of them.
- pron 11y ago> Every beginner struggles with when you use == and when you use .equals(), or the differences between casting primitives and casting objects. I actually agree with those points (though Java is still very simple), but there's an obvious reason: that's the exact same behavior as in C++ (unless you start playing with operator overloading), and any other behavior would have looked surprising or strange to people coming over from C/C++, which was basically everyone who learned Java in its first 10 years. The same goes for the fallthrough switch statement. Generic bounds indeed completely go against the language's design goals, but failing to take advantage of multicatch or generic inference (or lambda inference) is not a problem[1]. Java is a language designed for ease of reading (it says so right in its design documents), and for large teams/project, so code is made to look uniform, with all "advanced" features being local and obvious to anyone reading them. The goal was to make every new developer on your team (people working on large projects move around a lot) immediately able to read the code and not have to learn the team's DSL or coding style. Those were the problems that plagued C++ (alas, they only became apparent years after C++ had been in widespread use, and cost the industry billions), and Java very successfully avoided. Go has adopted the same design philosophy. [1]: Not that it's important, but every Java IDE would automatically suggest the shortened syntax. Java IDEs even automatically convert loops to streams.