DEV Community

Discussion on: Simplify your code

Collapse
 
pedrorfpacheco profile image
Pedro Pacheco

I like your approach to the comment section. Depending on the problems, I either use the constant with a name that I can clearly understand or I extract it into a function that I test.

Regarding the "early return" topic, it was one of the first things I learned in the professional world and it really makes sense and optimizes the process.

Collapse
 
klnjmm profile image
Jimmy Klein

Thanks for your comment !

About early return, I don’t know nowdays how the « one return only » is teached at school, but it’s a shame to learn early return in the profession l world…