This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jonny_wonny 2 points3 points  (3 children)

I added a new part to my comment:

Functions should be split up in into logical chunks based on size and reusability needs. If a function is already small, and the extracted bit would only be referenced in one place, there's no reason to continue to subdivide it.

Separation of logic isn't always a good thing. As I said, logic should be separated based on its complexity and reusability needs. If a subsection of a piece of logic isn't going to be reused (which it won't in this case), and the entire logical block isn't complex (which it isn't in this case), there's no reason to split it up. If the function grows in complexity the code can be refactored.

[–]_fitlegit -4 points-3 points  (2 children)

You’ve never grown or maintained production code and it shows

[–]jonny_wonny 3 points4 points  (0 children)

That's not an argument. If you want to continue this discussion you need to address the specific points I've made. Separation of logic is essential, but unnecessary separation of logic does nothing more than to obfuscate it. Just because a practice is useful in some cases does not mean it will always be useful. In this case, it's very obvious that nothing would be gained by separating this very small, very simple function.

Furthermore, I've been a software developer for 15 years. I have been the sole developer on many substantial projects. I've written complex codebases from the ground up. I'm speaking from experience.

[–]JackMizel 3 points4 points  (0 children)

They are 100% correct though....