Hacker News new | past | comments | ask | show | jobs | submit login

> What is the sweet spot? There must be an answer

Keep things 'square'. This is a fuzzy concept and I don't really know how to explain it properly, other than that the effort spent on each layer of abstraction should be roughly equivalent.

Your example is a single 1m-line function or 1m one-line functions. In this case you probably want 100 functions of 100 lines each (and yes, refactoring like this you probably save 100-fold in overall LoC so it works out.) And your 100 functions are probably nested in a 10-deep hierarchy where they all do roughly the same amount of cognitive work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: