Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

coding style: early exit vs deep nested. #84

Open
simpzan opened this issue Jun 26, 2015 · 1 comment
Open

coding style: early exit vs deep nested. #84

simpzan opened this issue Jun 26, 2015 · 1 comment

Comments

@simpzan
Copy link

simpzan commented Jun 26, 2015

I like the idea of the project, and wanna join to make a little contribution. before that, I need to understand the code, so I start to read the code.
I found that the coding style of deeply nested if statement is kinda hard to read. I think early exit is much more readable.
Would you consider to make a switch of the style?
https://en.wikibooks.org/wiki/Computer_Programming/Coding_Style/Minimize_nesting

@frankrousseau
Copy link
Contributor

Hello @simpzan,

Thank you for your message. It's great you want to contribute and any help would be welcome.

About nesting code style, it adds a lot of readability by adding meaningful blocks. So we won't change it. The only things that could be used to simplifiy is the return callback(err); at the beginning of each callback functions.

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

No branches or pull requests

2 participants