The Aether

The Aether

32M Downloads

Enhancement: Code maintainability with nullability

Jonathing opened this issue ยท 0 comments

commented

I have no idea what to prefix this issue since it isn't necessarily a mod bug, but rather an annoyance I have with the code base that makes some of the codebase hard to read.

One of the worst things about working with Java is defining nullability. More specifically, when working with libraries and other APIs, what can, cannot, should, or should not be nullable. With my own projects, I have opted to treat everything as not nullable unless it is marked with the @Nullable annotation. This includes variables, fields, method parameters, type parameters, and return types. While I do not propose that The Aether Team use a similar, paranoid style of determining nullability within the source code, I would like to open up the idea of deciding on a consistent method of determining nullability within your repositories. It is my personal belief that no project should ever need to use both the @NotNull and @Nullable annotations at the same time, and it is even more important when considering code and factors that involve public API, since many programmers who create sub-projects or add-on mods will unfortunately need to learn the standard that you set within your own source code.

Consider this issue an RFC of sorts, but I would like to have this discussion sooner rather than later so that making add-on mods and writing consistent PRs becomes less painful for everyone.