Edit: Removed offensive word
Ask HN: How do you deal with 2000 line functions?
1–10 of 72 posts
Re: Ask HN: How do you deal with 2000 line functions?
#2The obvious refactoring is to split the function up into smaller pieces, even if you can split it into two 1500 line functions that is a win.
Re: Ask HN: How do you deal with 2000 line functions?
#3Re: Ask HN: How do you deal with 2000 line functions?
#4It's probably easier to do that than to muck around in the 2000-line version hoping you don't screw something else up.
Re: Ask HN: How do you deal with 2000 line functions?
#5Yes, just don't use the word "shit". The obvious refactoring is to split the function up into smaller pieces, even if you can split it into two 1500 line functions that is a win.
Re: Ask HN: How do you deal with 2000 line functions?
#6You test the shit out of it, then re-write it ensuring tests pass, then add your new code. It's probably easier to do that than to muck around in the 2000-line version hoping you don't screw something else up.
Re: Ask HN: How do you deal with 2000 line functions?
#7Yes, just don't use the word "shit". The obvious refactoring is to split the function up into smaller pieces, even if you can split it into two 1500 line functions that is a win.
Re: Ask HN: How do you deal with 2000 line functions?
#8You test the shit out of it, then re-write it ensuring tests pass, then add your new code. It's probably easier to do that than to muck around in the 2000-line version hoping you don't screw something else up.