3 ms·
> Embrace duplication - don't unnecessary add loops or abstractions. > Once the file is ~500 LOC or becomes too dense, start to refactor a bit. Perhaps introdu
by freehorse 3y ago
> Embrace duplication - don't unnecessary add loops or abstractions.
> Once the file is ~500 LOC or becomes too dense, start to refactor a bit. Perhaps introduce some loops or some global variables.
I agree with most, but if I "embrace duplication" I can reach 500+ LOC in half an afternoon :P. It seems to have really paid off for me to start some degree of abstraction (not OO yet in general) early enough. Tbf, it is easier for me to tidy up the code with some abstractions, rather than ensure that the "main"-titled script runs from beginning to end each point of time with no errors, which imo can hinder experimentation more than abstraction. But also depends on what I do, I guess, the greener the field the more I feel this way.