I only really write functions when I want to de-duplicate code or unit test a specific few lines. Don't believe in using a function just to give a block of code a name, a comment can do that. When code gets very nested is another time I start using functions, so I'm not like 4 tab lengths in. Putting code in 10 line functions for the sake of it can actually kill readability as you have to keep navigating around the code-base to read.
Hasn't been a problem for me yet. Code is still fairly readible.
Guess I'm just trying not to repeat the mistake that I see in the legacy apps the I have to mantain at work. In the codebase that I deal with daily is actually common to see methods that have more than 500 lines, and that's just wrong. People are actually scare to touch one of those methods.
The goal is to write functions that anyone can read and have the confidence that they can change stuff, make it better, or delete the whole thing if it's no longer necessary.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I only really write functions when I want to de-duplicate code or unit test a specific few lines. Don't believe in using a function just to give a block of code a name, a comment can do that. When code gets very nested is another time I start using functions, so I'm not like 4 tab lengths in. Putting code in 10 line functions for the sake of it can actually kill readability as you have to keep navigating around the code-base to read.
Hasn't been a problem for me yet. Code is still fairly readible.
Guess I'm just trying not to repeat the mistake that I see in the legacy apps the I have to mantain at work. In the codebase that I deal with daily is actually common to see methods that have more than 500 lines, and that's just wrong. People are actually scare to touch one of those methods.
The goal is to write functions that anyone can read and have the confidence that they can change stuff, make it better, or delete the whole thing if it's no longer necessary.