Hacker News new | ask | show | jobs
by marcus_holmes 3747 days ago
I thought it was interesting. I've carried a "no long functions" rule in my head for so long it was really challenging to have that questioned.

I get the logic behind why he likes long functions that have the meat of the program in them. I've hit code bases before that have broken out bits of logic into separate functions that are badly named and defined and I ended up hopping around the program trying to work out wtf is going on.

As long as we keep the subroutines nice and tight and well-named they're an aid to understanding the program: I can guess what `writeTextToFile(text,filename)` does, and I'd rather see that in the main logic routine than 50 lines of the code that writes text to files.

I will carry on writing short functions, but it's good to know that I'm doing that for a reason, having challenged it.