DEV Community

Discussion on: Once you start writing a lot of code you're surely doing it wrong

Collapse
 
ksaaskil profile image
Kimmo Sääskilahti

Good job showing how to write more readable and robust code by using the right tools for the job 👍 The first version could also be made more readable by defining helper functions to remove all that nesting?

Collapse
 
akumzy profile image
Akuma Isaac Akuma

Yeah, but that's will come after the implementation is being figured out completely

Collapse
 
ksaaskil profile image
Kimmo Sääskilahti

I respectfully disagree, I think it's better to write short functions with single responsibilities from the beginning. That makes refactoring a lot simpler and easier to see if the composed function is doing what it should. But that's just my experience 🙂

Thread Thread
 
akumzy profile image
Akuma Isaac Akuma

That's okay