Skip to content

Code style #244

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

Closed
Tracked by #242
silkentrance opened this issue Feb 8, 2020 · 2 comments
Closed
Tracked by #242

Code style #244

silkentrance opened this issue Feb 8, 2020 · 2 comments

Comments

@silkentrance
Copy link
Collaborator

silkentrance commented Feb 8, 2020

The existing code style with if/then and other such constructs such as multiple returns per function/method is counter intuitive and prone to error and thus not up to par with what one would call clean code standard, when done properly.

So we need to enforce a single exit point per function/method where possible and also make sure that all for/do/while/if/then/else/try/catch/finally clauses are discriminated by opening and closing curly brackets, always.

@silkentrance silkentrance mentioned this issue Feb 8, 2020
3 tasks
@raszi
Copy link
Owner

raszi commented Feb 23, 2020

I agree with the proposal and to use a consistent style that's why the eslint was introduced.

Although I do not agree with the single exit point per function proposal, I believe that puts a bigger cognitive load on the reader. I would rather focus on the length of the functions and break down the overgrown ones to smaller and then compose them.

@silkentrance
Copy link
Collaborator Author

Closing as the existing eslint options are sufficient.

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