title: How to fight the startover effect
body: <p>When I'm asked to fix a bug or introduce a feature in a project I did not develope I often have this feeling that starting from scratch would safe me a lot of work, pain and effort. Altougth often this obviously is more work and seems like I suffer greatly from <a href="https://en.wikipedia.org/wiki/Not_invented_here" rel="nofollow noreferrer">nih</a>.</p>
  <p>So, what are ways you fight this urge and focus on the project or enable yourself to morph the project bit by bit to something you like more while fixing bugs or introducing features?</p>
  <h2>To make some points about me:</h2>
  <ul>
  <li>I'm a fairly good programmer</li>
  <li>I would consider myself a python programmer, meaning I try to follow the <a href="https://www.python.org/dev/peps/pep-0020/" rel="nofollow noreferrer">Zen of python</a></li>
  <li>I don't really like big abstraction (more in the example below)</li>
  <li>Obviously sometimes I have that problem with my own code.</li>
  </ul>
  <h2>To make some points about the projects I talk about:</h2>
  <ul>
  <li>Lately most of them are based on php but might be any language</li>
  <li>Propably coded by someone who never really coded big projects or in teams</li>
  <li>Most often with a lot of classes and pseudo-abstraction (more below)</li>
  <li>Most likely without comments at all</li>
  <li>Bad named variables, classes and functions</li>
  <li>A lot of redundancy for instance a lot of <code>style=&quot;border:1px solid black&quot;</code>
  or the same javascript function with different names in every htm file, or classes that will call each other in turns</li>
  <li>Huge switch statements over like a couple of hundreds of lines</li>
  <li>Sometimes build atop of librarys that are deprecated or just way to big for serving a very small feature set.</li>
  <li>Huge Codebase without really splitting up the codes in different files</li>
  <li>Weird globals</li>
  <li>Dead code in weird places (like in the switch statements)</li>
  </ul>
  <h2>How I try to solve it:</h2>
  <p>Lately if I have to fix something I will do so and after finding out what happens and being anoyed by it, I will put a lot of <code>#TODO</code>s in there and fix the initial problem.   Often with this method I use the predefined functions or classes that by their name should do something completely different, making the project more horrific.</p>