Ask HN: Please help me, I'm a bad developer
0. Understanding a codebase:<p>0.0. Get to know the codebase:<p>0.0.0. Code distribution:<p>You can get an overall &quot;idea&quot; of the code distribution, or where the meat is, by using `cloc . --by-file`. This shows you a listing of files and their respective number of lines of code and comments. You instantly get an idea of the &quot;big&quot; files of the project you probably should get to know.<p>You also see the ratio comment&#x2F;code and can start documenting and writing tests as you go. It will help you understand the project, and will be useful for everyone and in refactoring.<p>0.0.1. Structure:<p>0.0.1.0: Visualization<p>Drawing helps me. Conceptual blocks of the project. It can start as block names and boxes &quot;Codec&quot;, &quot;Streaming&quot;, &quot;Persistence&quot;, &quot;Dispatcher&quot;, etc.<p>Drawing on paper, whiteboard, etc. You can also use something like &quot;Gliffy&quot; to diagram for yourself and with someone when communicating. You can both change and make sure you&#x27;re talking about the same thing.<p>And do it going down the abstraction scale. Higher abstractions to lower abstractions.<p>I also found a quick automatically generated &quot;UML&quot; diagram helps. I don&#x27;t write them necessarily, but I use a tool that tells me about the structure of a project.<p>pyreverse for Python, scaladiagrams for Scala, are just a few examples that generate an image you can save and glance over after the `cloc` stuff.<p>0.0.1.1: Grep<p>I use `git grep` on the classes found in the biggest files I found with `cloc`. I can see how they &quot;disseminate&quot; through the project and how they get around and are used<p>0.0.1.2: Tests<p>I look at unit tests (if any) to get a sense on what the different parts do and how they&#x27;re used. You learn a lot about &quot;intent&quot; from the tests if you&#x27;re lucky to have them. I add tests as I get acquainted with the project.<p>If there&#x27;s a CI config file, I&#x27;ll check it out and it tells me how to deploy the project. It&#x27;s often more accurate than the readme or else the builds would fail.<p>0.0.2: Musing<p>I maintain a separate &quot;musing&quot; file, sometimes called &quot;refactoring&quot; where I&#x27;ll put a comment with the path to a file and the part it&#x27;s about (say a function, or a class), and rewrite it. It is separate in the beginning as I don&#x27;t know if the refactoring is relevant or if there&#x27;s any Chesterton&#x27;s Fence and I don&#x27;t want to pollute the repo. It is my way of grappling with the code. Several rewrites. Often when I&#x27;m in a quiet place and my juices are flowing.<p>0.1. Taking notes for project:<p>One of my habits from the beginning was taking notes. I can now pull my notebooks at my current job and see the chronology (dated by month) and ordered. I can walk through the different difficulties, conceptualizations, drawings and schematics, sequence diagrams, re-architectures, refactorings, etc.<p>As you embark on your journey in a project, your fresh eyes are valuable. You&#x27;re seeing a lot of what has become &quot;normal&quot; for other developers. Note <i>everything</i>. The idiosyncratic build or deployment. Out of date documentation. Everything.<p>You can create well written issues that follow a template with expected and actual behaviors, screenshots, logs, stack traces, possible fixes, likely culprits, etc.. If your repo does not have a template for issue, propose one.<p>Write issues in a way to make them easier to fix for everyone. Your group can use your notes to rework an API or the user experience. You&#x27;re also working to streamline future contributions for newcomers.<p>0.2. Knowledge Base<p>As your understanding of the project increases and you touch more and more parts, you can maintain a sort of knowledge base. It is highly likely that this knowledge base will serve as the project documentation if it has none.<p>1. Attention<p>1.1 Taking meeting notes:<p>Many meetings. Few actions. Everybody ends up talking about the same things and issues drag on forever. You can take notes and review them later. Write them up and send them to everyone. Check out minutes of meetings.<p>You can write the gist of what&#x27;s said, and the <i>action</i> that must be taken, by whom, and when.<p>Taking these notes will help mitigate your distraction during the meeting as you can review them at your rythm.<p><pre><code>  # Minutes of Meeting
  --------------------
  
  ## Date: 2019-03-25
  ## Place: BIGCorp HQ. City, State.
  
  ## Participants:
  
  ### BIGCorp:
  
    - John Doe (jd)
    - MeMyself I (mmi)
  
  ### OtherCorp:
    - Dilbert (db@othercorp.com)
    - Dogbert (dg@othercorp.com)
  
  
  ## Topics:
  
    - Scheduled information sending
    - Information flow
    - Architecture for Project X
  
  ## Details:
  
  OtherCorp has raised some issues for the timeline of Project X...
  Blah blah blah.
  
  ## Actions:
  
  ### BIGCorp:
  
  - [ ] @bc: Send project X estimates by 2019-03-28
  - [x] @bc: Send invoice and cheque for offices remodeling
  - [ ] @mmi: Add different schemes for user authentication
  - [ ] @mmi: Finalize migrations so we take into account user&#x27;s timezone
  
  ### OtherCorp:
  
  - [ ] @oc: Expose API end points for user&#x27;s identity verification
  - [ ] @oc: Cache the results of the most common queries

</code></pre>
2. Skills<p>Understand the business value for the customer (what value is your code bringing to the customer, what are they trying to achieve).<p>Daily improvements. Reading good books and implementing what they contain. Writing the best code you can write. Reading the best code you can find. Consistent, continuous, relentless, improvement.<p>If you can be better than you were when the day started, and do that daily, good things may happen.<p>Constantly transfer the quality gains to the projects you&#x27;re involved in (better documentation techniques, better patterns, less complexity, etc.)<p>Help others write better code by setting the example. Mentor newcomers to the project. Help write tools for everyone to use.