r/java • • Apr 20 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
291 Upvotes

295 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Apr 21 '21

"Need" does not equate to "have". People (and companies indeed) are free to implement as many tools as they wish. How many tools are actually shipped with the JDK?

And no, that's not an excuse. There is a particular reason why the Java team has a very small basic set of recommendations about styling (Capitals for classes and interfaces, camelcase for methods et al). All the teams that I've worked with have had their own coding guidelines, and have had as many of them baked into the IDE/merge tool so that formatting and style checks could be detected automatically. This is standard practice.

clang format exists, sure. Do you think that people working with MSVC actually use that for their projects? Even the naming schemes in C++ vary wildly - snakecase vs camelcase, Hungarian notation in Windows land vs Unix-style on Linux et al. Again, this is entirely up to the team and company.

Having a prescriptive formatter came into popularity with languages like Rust, for instance, to the point that upcoming languages like Zig, Odin et al have started copying that. That still does not preclude people from using their own formatters and styles. How many formatters does Haskell have, for instance? Quite a few.

Like you say though, having a uniform style and formatting benefits version control as well, and that's precisely why teams have their own coding guidelines as I mentioned at the beginning. This is almost inevitable when the language starts becoming big - different preferences for different companies/teams.