Skip to content

Code formatting + cleanup #26

@CoconutMacaroon

Description

@CoconutMacaroon

Formatting

A lot of the code is decently-formatted. I've created a style guide. It mostly is simaler to what we already have, but also is explicitly spelled-out.

Tidyness + Documentation

For docs, I'm working on setting up JavaDoc for documentation, and plan to slowly add JavaDoc comments.

Commented out code

There is a decent amount of commented-out code. Most of it was clearly used for debugging (e.g., // System.out.println(...);).

I'm torn on what to do with it. Part of me thinks it could be helpful for the next person that debugs the code. The other part of me says it is irrelevant to the code and should be removed, as it will rot. After all, Git will always have a copy of it.

One example of commented-out code is here. Here are the options I see:

  1. Leave the commented-out code - Ugly, and potentially annoying (if the code arround the commented-out code changes, the commented-out code will quickly rot)
  2. Delete the commented-out code - Someone debugging would have to re-add the comments, but it would be saved in Git. Moreover, and this is my opionion: code that is purely for debugging, and that is commented-out (rendering it useless, especially if the surrounding code changes) does not belong. Perhaps it is fine to have while debugging, or maybe in a development branch, but not the primary branch. Moreover, sooner or later, the commented-out code will rot.
  3. Hide it behind a boolean. E.g., if(DEBUGGING_MODE = true) {. Personally, I feel that is lots of work and effort that would be better put to other tasks.

Thoughts?

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions