Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize usage of final classes, private constructors, @SuppressWarnings, and @ApiStatus #10

Open
Trikzon opened this issue Jul 3, 2021 · 3 comments

Comments

@Trikzon
Copy link
Contributor

Trikzon commented Jul 3, 2021

After the cosmetics pr is complete, we should standardize the uses of these language features.

Final Classes

I'm for removing all our final class uses. It's pointless to use imo.

Private constructors

I think that all of our static-only method classes should have a private no argument constructor.

@SuppressWarnings

I usually don't ever use these, so I'd like feedback on how we should standardize its usage. Right now it feels like @andantedevs is adding them kinda at random rather than every time they could be used.

@ApiStatus

I think we should take full use of this annotation. I think it might break compatibility with non-jetbrains editors, but I'm not too worried for that tbh

@andantet
Copy link
Contributor

andantet commented Jul 3, 2021

@SuppressWarnings

Having worked by myself for a while, my usage of this is kind of instinctive, but the basis is 'if it's creating an unnecessary warning, add a suppression'

  • if it's a block/item etc that's made to be used by other mods, @SuppressWarnings("unused")
  • if there's a deprecation, and it's one of Mojang's weird formatting deprecations or quite frankly anywhere actually, ew, get it out of here, @SuppressWarnings("deprecation")
  • if there's some mixin-based confusion with an editor, like casting, suppress the warning
  • or essentially anything that's giving you unnecessary warnings that you don't want to disable inspections for completely

@Trikzon
Copy link
Contributor Author

Trikzon commented Jul 3, 2021

Do you generally look at warnings when writing code? I've grown to just institutionally ignore them, but I do get where you're coming from

@andantet
Copy link
Contributor

andantet commented Jul 3, 2021

I'm one for a clean warnings gutter lmao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants