How to restrain one's self from the overwhelming urge to rewrite everything?

后端 未结 20 721
遥遥无期
遥遥无期 2021-01-30 12:50

Setup

Have you ever had the experience of going into a piece of code to make a seemingly simple change and then realizing that you\'ve just stepped into a wasteland tha

20条回答
  •  无人及你
    2021-01-30 13:50

    1. reread "Refactoring".
    2. Take a piece of paper and itemize the "Bad Smells" list.
      (for each smell in BadSmells() {
      print smell.name;
      }
    3. Add comments to the code including item(s) from the list.
      while( odorPersists() ) {
    4. Work through the list, laser-focused on one smell at a time.
      }

提交回复
热议问题