Hacker News new | ask | show | jobs
by NwpierratorR 1806 days ago
Java has different codestyle, i.e. camelCase instead of snake_case, brackets shouldn't break the line, no space before param blocks after signature, etc.

Also explicit throws is so 2000s, nowadays it would be a better approach to return class that encapsulates (Result | Error)

3 comments

This is all stylistic preference which is by definition purely subjective. Just because a codebase isn't written in the same way as [big Java corp], doesn't mean it's bad.
I disagree about code style and dont think that its an issue. I know that its not the most popular style, specially in java world but this project is mostly written in c\c++. There is a meaning in keeping code style similar across different bindings, since its easier for developers.

Also, there are autoformatters for java(config for eclipse) and for c++(clang-format).

>Also explicit throws is so 2000s, nowadays it would be a better approach to return class that encapsulates (Result | Error)

Really not sure about this. Certainly not a Java convention, in my experience.