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

Inconsistent style and excessively long if-else branch chains #123

Open
LukasDrsman opened this issue Jan 10, 2023 · 1 comment
Open

Inconsistent style and excessively long if-else branch chains #123

LukasDrsman opened this issue Jan 10, 2023 · 1 comment

Comments

@LukasDrsman
Copy link

Several parts of the code in public/ subfolder contain excessively long if-else branch chains, which could be reduced simply by proper usage of switch-case labels instead of branching (e.g. type recognition in Robot.js). Additionally, inconsistent style is used for function definitions and calls (spaces vs no space before parentheses of functions and their definitions).

@QuirkyCort
Copy link
Owner

In the "if-else" vs "switch-case" war, I generally stand on the side of "if-else". It's a stylistic preference. Don't want to get into any arguments over why I prefer one over the other, but it should suffice to say that I'll accept code written in either styles, but won't change working code from one to the other.

...for that matter, a lookup would be much better than either "if-else" or "switch-case", but it'll require some of the component classes to be changed.

As for the inconsistent spacing in function definitions, that's my bad. I'll fix it if I see it.

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