
Your Code as a Crime Scene
by Adam Tornhill · first published 2015
16mentions
12recommended by
15HN commenters
2015–2026first – last mentioned
80% recommend20% neutral
Why HN recommends it
Shows how to mine version control history to find hotspots and risky areas in a codebase, using tools like Code Maat; useful for engineers taking over legacy code or joining new teams.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.


…tools like these have been helping me to understand the team's and delivery dynamics when I'm joining new dev-teams. This particular is great, as it reminds me of a book that I had read a while back; Your Code as a Crime Scene [1] by Adam Tornhill. Adam is trying to explain something similar, but takes the whole concept onto the next level by explaining how tech debt and hidden coupling can be discovered using the git history…
on “Show HN: Visualizing a Codebase” ↗The best source for this kind of emprical measurement of code complexity is Your Code as a Crime Scene by Adam Tornhill. See also http://www.adamtornhill.com/code/codemaat.htm
on “Legacy Software Systems: How to Live with Aging Software Architecture?” ↗I like the mindset, it reminds me of "Your code as a crime scene" by Adam Tornhill: https://www.adamtornhill.com/articles/crimescene/codeascrime... Also, very tangentially, to the notion of the Developer's Legacy Index: https://www.javaadvent.com/2021/12/using-jgit-to-analyse-the...
on “The Git Commands I Run Before Reading Any Code” ↗…And "code smells" like passing too many parameters or doing "blast radius" for certain code changes are only watching for side-effects of a missing "code theory". An interesting book on the topic is "Your code as a crime scene". The bottom line is we're trying to fix these problems over and over again without having a good understanding of what the real problem is and this leads to too many rules too easy to misinterpret unless…
on “The Wrong Abstraction (2016)” ↗…Algorithms to Live By (Algorithms are fundamental ideas before we write any code) 7. Git Pro (Software cannot run without a Version Control System (VCS). We use it every minute of our working day) 8. Your Code as a Crime Scene (Finding problems in the code using code history) 9. Data-Intensive Applications (Databases are everywhere) 10. Software Engineering at Google (Addressing the biggest scaling problems) Honorable Mentions:…
on “Ask HN: Top 10 Timeless Software Books That ChangedLife as Software Engineer?” ↗See the work by Adam Tornhill https://github.com/adamtornhill/code-maat https://www.youtube.com/watch?v=hWhBmJJZoNM https://pragprog.com/book/atcrime/your-code-as-a-crime-scene https://pragprog.com/book/atevol/software-design-x-rays
on “What the Four Color Theorem Can Teach Us About Writing Software” ↗I also discovered this a few days before the event. Great stuff! Following it live was really cool. Special shoutout to `andrea with "Your Code as a Crime Scene/Analyze code quality through Emacs"
on “EmacsConf 2020 Talks” ↗The book "Your Code as a Crime Scene" has a number of interesting techniques and tools for this. https://pragprog.com/titles/atcrime/your-code-as-a-crime-sce...
on “Where's All the Code?” ↗No worries - don't take the feedback as a negative - I wish you all the best, this problem is a real issue (as is a lot around this point - see "your code as a crime scene" as a good book on this sort of automated analysis of likely areas code is falling down) and good luck for just being in the game - well done and wish you the best
on “Launch HN: Mintlify (YC W22) – Maintainable documentation for software teams” ↗He also wrote Your Code as a Crime Scene and authored the open source tool, Code Maat. I've found both extremely useful in my current job where I took over a code base with immense technical debt. AFIK, Code Scene is a commercial version of…
on “The Business Impact of Code Quality” ↗…maintenance engineers, not just systems designers--and that means paying for people, not just for products. Wonder if this is getting better, at least for newer (than COBOL) technologies. There's books like Your Code as a Crime Scene and Sustainable Web Development with Ruby on Rails, along with ideas to address tech debt like No Broken Windows and Chesterton's Fence. Service providers like Tidelift, who help sustain open source…
on “Built to Last” ↗…Algorithms to Live By (Algorithms are fundamental ideas before we write any code) 7. Git Pro (Software cannot run without a Version Control System (VCS). We use it every minute of our working day) 8. Your Code as a Crime Scene (Finding problems in the code using code history) 9. Data-Intensive Applications (Databases are everywhere) 10. Software Engineering at Google (Addressing the biggest scaling problems) Honorable Mentions: 1.…
on “Ask HN: Top 10 Timeless Software Books That ChangedLife as Software Engineer?” ↗This is the premise of the excellent book Your Code as a Crime Scene. The history and structure of the codebase reveals a wealth of information.
on “The Git Commands I Run Before Reading Any Code” ↗never tried it myself, but you can take a look at the accompanying code "Your Code as a Crime Scene" https://github.com/adamtornhill/code-maat
on “Ask HN: How do you familiarize yourself with a new codebase?” ↗> 8. Your Code as a Crime Scene (Finding problems in the code using code history) There's a brand new 2nd edition on its way: https://pragprog.com/titles/atcrime2/your-code-as-a-crime-sc...
on “Ask HN: Top 10 Timeless Software Books That ChangedLife as Software Engineer?” ↗