• 0 Posts
  • 1 Comment
Joined 29 days ago
cake
Cake day: February 15th, 2025

help-circle
  • Skim the book, “working effectively with legacy code”. In a nutshell, you write characterization tests around the module or method, then do safe IDE based refactorings, then do some slightly more significant refactorings. After that the code should make enough sense for you to make changes if you need to.

    It is as much in art as a science. The important thing is that as you are doing refactorings, the main one you do is to extract methods, and give the methods clear names that say what they are doing. You should be left with a top-level method that reads like a narrative of what the whole thing does.

    Medication helps me quite a bit. I am also using Atomoxetine. The effect is much more subtle than stimulants, but I think just as powerful in the long run.