| > Keep nesting low. This so much. One of the bigger differences between academic and professional coding is software system longevity. Premature refactoring is incredibly harmful to readability. 1. You have no idea what the future will require. You will always know more about the requirements in the future. 2. You have no idea how the current use and system will need to evolve. You will always learn more about this in the future. 3. You have no idea how long the current system will be used. Could be 20 years; could be a week (if it's an executive's pet project). 4. Time to MVP > perfect code in almost all instances. Writing code with clean, documented potential refactoring points, but stopping short of actually pulling all those things apart has served me far better than the alternative. If you have one function that may not be applicable to a future use case, and you refactor it into two, now you have two functions that may not be applicable to a future use case. Develop a feel for what's "reasonable" in an initial write, and don't code yourself into an inflexible corner, but defer actual refactoring until it's necessary. Because then you'll have the benefit of knowing far more about the new needs and how the system is used. |
Is that a thing? If it is, I've never run into it. I always run into the opposite - never refactoring and everything turning into a god object. It never occurred to me that premature factoring would be bad because I can't recall ever running into it!