<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: software-engineering</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/software-engineering.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2026-03-11T14:47:09+00:00</updated><author><name>Simon Willison</name></author><entry><title>Quoting John Carmack</title><link href="https://simonwillison.net/2026/Mar/11/john-carmack/#atom-tag" rel="alternate"/><published>2026-03-11T14:47:09+00:00</published><updated>2026-03-11T14:47:09+00:00</updated><id>https://simonwillison.net/2026/Mar/11/john-carmack/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://twitter.com/ID_AA_Carmack/status/1405932642005041153"&gt;&lt;p&gt;It is hard for less experienced developers to appreciate how rarely architecting for future requirements / applications turns out net-positive.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://twitter.com/ID_AA_Carmack/status/1405932642005041153"&gt;John Carmack&lt;/a&gt;, a tweet in June 2021&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/yagni"&gt;yagni&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/john-carmack"&gt;john-carmack&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="yagni"/><category term="john-carmack"/></entry><entry><title>Quoting Ally Piechowski</title><link href="https://simonwillison.net/2026/Mar/6/ally-piechowski/#atom-tag" rel="alternate"/><published>2026-03-06T21:58:33+00:00</published><updated>2026-03-06T21:58:33+00:00</updated><id>https://simonwillison.net/2026/Mar/6/ally-piechowski/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://piechowski.io/post/how-i-audit-a-legacy-rails-codebase/"&gt;&lt;p&gt;&lt;strong&gt;Questions for developers:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“What’s the one area you’re afraid to touch?”&lt;/li&gt;
&lt;li&gt;“When’s the last time you deployed on a Friday?”&lt;/li&gt;
&lt;li&gt;“What broke in production in the last 90 days that wasn’t caught by tests?”&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Questions for the CTO/EM:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“What feature has been blocked for over a year?”&lt;/li&gt;
&lt;li&gt;“Do you have real-time error visibility right now?”&lt;/li&gt;
&lt;li&gt;“What was the last feature that took significantly longer than estimated?”&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Questions for business stakeholders:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“Are there features that got quietly turned off and never came back?”&lt;/li&gt;
&lt;li&gt;“Are there things you’ve stopped promising customers?”&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://piechowski.io/post/how-i-audit-a-legacy-rails-codebase/"&gt;Ally Piechowski&lt;/a&gt;, How to Audit a Rails Codebase&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/rails"&gt;rails&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/technical-debt"&gt;technical-debt&lt;/a&gt;&lt;/p&gt;



</summary><category term="rails"/><category term="software-engineering"/><category term="technical-debt"/></entry><entry><title>"Good engineering management" is a fad</title><link href="https://simonwillison.net/2025/Nov/23/good-engineering-management-is-a-fad/#atom-tag" rel="alternate"/><published>2025-11-23T21:29:09+00:00</published><updated>2025-11-23T21:29:09+00:00</updated><id>https://simonwillison.net/2025/Nov/23/good-engineering-management-is-a-fad/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://lethain.com/good-eng-mgmt-is-a-fad/"&gt;&amp;quot;Good engineering management&amp;quot; is a fad&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Will Larson argues that the technology industry's idea of what makes a good engineering manager changes over time based on industry realities. ZIRP hypergrowth has been exchanged for a more cautious approach today, and expectations of managers has changed to match:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Where things get weird is that in each case a morality tale was subsequently superimposed on top of the transition [...] the industry will want different things from you as it evolves, and it will tell you that each of those shifts is because of some complex moral change, but it’s pretty much always about business realities changing.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I particularly appreciated the section on core engineering management skills that stay constant no matter what:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Execution&lt;/strong&gt;: lead team to deliver expected tangible and intangible work. Fundamentally, management is about getting things done, and you’ll neither get an opportunity to begin managing, nor stay long as a manager, if your teams don’t execute. [...]&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Team&lt;/strong&gt;: shape the team and the environment such that they succeed. This is &lt;em&gt;not&lt;/em&gt; working for the team, nor is it working for your leadership, it is finding the balance between the two that works for both. [...]&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ownership&lt;/strong&gt;: navigate reality to make consistent progress, even when reality is difficult Finding a way to get things done, rather than finding a way that it not getting done is someone else’s fault. [...]&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alignment&lt;/strong&gt;: build shared understanding across leadership, stakeholders, your team, and the problem space. Finding a realistic plan that meets the moment, without surprising or being surprised by those around you. [...]&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;Will goes on to list four additional growth skill "whose presence–or absence–determines how far you can go in your career".

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=46026939"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/will-larson"&gt;will-larson&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/careers"&gt;careers&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/management"&gt;management&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/leadership"&gt;leadership&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="will-larson"/><category term="careers"/><category term="management"/><category term="leadership"/></entry><entry><title>Vibe engineering</title><link href="https://simonwillison.net/2025/Oct/7/vibe-engineering/#atom-tag" rel="alternate"/><published>2025-10-07T14:32:25+00:00</published><updated>2025-10-07T14:32:25+00:00</updated><id>https://simonwillison.net/2025/Oct/7/vibe-engineering/#atom-tag</id><summary type="html">
    &lt;p&gt;I feel like &lt;strong&gt;vibe coding&lt;/strong&gt; is &lt;a href="https://simonwillison.net/2025/Mar/19/vibe-coding/"&gt;pretty well established now&lt;/a&gt; as covering the fast, loose and irresponsible way of building software with AI - entirely prompt-driven, and with no attention paid to how the code actually works. This leaves us with a terminology gap: what should we call the other end of the spectrum, where seasoned professionals accelerate their work with LLMs while staying proudly and confidently accountable for the software they produce?&lt;/p&gt;
&lt;p&gt;I propose we call this &lt;strong&gt;vibe engineering&lt;/strong&gt;, with my tongue only partially in my cheek.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Update 23rd February 2026&lt;/strong&gt;: It looks like the term "Agentic Engineering" is coming out on top for this now. I have &lt;a href="https://simonwillison.net/tags/agentic-engineering/"&gt;a new tag for that&lt;/a&gt; and I'm working on &lt;a href="https://simonwillison.net/2026/Feb/23/agentic-engineering-patterns/"&gt;a not-quite-a-book&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;One of the lesser spoken truths of working productively with LLMs as a software engineer on non-toy-projects is that it's &lt;em&gt;difficult&lt;/em&gt;. There's a lot of depth to understanding how to use the tools, there are plenty of traps to avoid, and the pace at which they can churn out working code raises the bar for what the human participant can and should be contributing.&lt;/p&gt;
&lt;p&gt;The rise of &lt;strong&gt;coding agents&lt;/strong&gt; - tools like &lt;a href="https://www.claude.com/product/claude-code"&gt;Claude Code&lt;/a&gt; (released February 2025), OpenAI's &lt;a href="https://github.com/openai/codex"&gt;Codex CLI&lt;/a&gt; (April) and &lt;a href="https://github.com/google-gemini/gemini-cli"&gt;Gemini CLI&lt;/a&gt; (June) that can iterate on code, actively testing and modifying it until it achieves a specified goal, has dramatically increased the usefulness of LLMs for real-world coding problems.&lt;/p&gt;
&lt;p&gt;I'm increasingly hearing from experienced, credible software engineers who are running multiple copies of agents at once, tackling several problems in parallel and expanding the scope of what they can take on. I was skeptical of this at first but &lt;a href="https://simonwillison.net/2025/Oct/5/parallel-coding-agents/"&gt;I've started running multiple agents myself now&lt;/a&gt; and it's surprisingly effective, if mentally exhausting!&lt;/p&gt;
&lt;p&gt;This feels very different from classic vibe coding, where I outsource a simple, low-stakes task to an LLM and accept the result if it appears to work. Most of my &lt;a href="https://tools.simonwillison.net/"&gt;tools.simonwillison.net&lt;/a&gt; collection (&lt;a href="https://simonwillison.net/2025/Sep/4/highlighted-tools/"&gt;previously&lt;/a&gt;) were built like that. Iterating with coding agents to produce production-quality code that I'm confident I can maintain in the future feels like a different process entirely.&lt;/p&gt;
&lt;p&gt;It's also become clear to me that LLMs actively reward existing top tier software engineering practices:&lt;/p&gt;
&lt;ul id="techniques"&gt;
&lt;li&gt;
&lt;strong&gt;Automated testing&lt;/strong&gt;. If your project has a robust, comprehensive and stable test suite agentic coding tools can &lt;em&gt;fly&lt;/em&gt; with it. Without tests? Your agent might claim something works without having actually tested it at all, plus any new change could break an unrelated feature without you realizing it. Test-first development is particularly effective with agents that can iterate in a loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Planning in advance&lt;/strong&gt;. Sitting down to hack something together goes much better if you start with a high level plan. Working with an agent makes this even more important - you can iterate on the plan first, then hand it off to the agent to write the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comprehensive documentation&lt;/strong&gt;. Just like human programmers, an LLM can only keep a subset of the codebase in its context at once. Being able to feed in relevant documentation lets it use APIs from other areas without reading the code first. Write good documentation first and the model may be able to build the matching implementation from that input alone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Good version control habits&lt;/strong&gt;. Being able to undo mistakes and understand when and how something was changed is even more important when a coding agent might have made the changes. LLMs are also fiercely competent at Git - they can navigate the history themselves to track down the origin of bugs, and they're better than most developers at using &lt;a href="https://til.simonwillison.net/git/git-bisect"&gt;git bisect&lt;/a&gt;. Use that to your advantage.&lt;/li&gt;
&lt;li&gt;Having &lt;strong&gt;effective automation&lt;/strong&gt; in place. Continuous integration, automated formatting and linting, continuous deployment to a preview environment - all things that agentic coding tools can benefit from too. LLMs make writing quick automation scripts easier as well, which can help them then repeat tasks accurately and consistently next time.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;culture of code review&lt;/strong&gt;. This one explains itself. If you're fast and productive at code review you're going to have a much better time working with LLMs than if you'd rather write code yourself than review the same thing written by someone (or something) else.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;very weird form of management&lt;/strong&gt;. Getting good results out of a coding agent feels uncomfortably close to getting good results out of a human collaborator. You need to provide clear instructions, ensure they have the necessary context and provide actionable feedback on what they produce. It's a &lt;em&gt;lot&lt;/em&gt; easier than working with actual people because you don't have to worry about offending or discouraging them - but any existing management experience you have will prove surprisingly useful.&lt;/li&gt;
&lt;li&gt;Really good &lt;strong&gt;manual QA (quality assurance)&lt;/strong&gt;. Beyond automated tests, you need to be really good at manually testing software, including predicting and digging into edge-cases.&lt;/li&gt;
&lt;li&gt;Strong &lt;strong&gt;research skills&lt;/strong&gt;. There are dozens of ways to solve any given coding problem. Figuring out the best options and proving an approach has always been important, and remains a blocker on unleashing an agent to write the actual code.&lt;/li&gt;
&lt;li&gt;The ability to &lt;strong&gt;ship to a preview environment&lt;/strong&gt;. If an agent builds a feature, having a way to safely preview that feature (without deploying it straight to production) makes reviews much more productive and greatly reduces the risk of shipping something broken.&lt;/li&gt;
&lt;li&gt;An instinct for &lt;strong&gt;what can be outsourced&lt;/strong&gt; to AI and what you need to manually handle yourself. This is constantly evolving as the models and tools become more effective. A big part of working effectively with LLMs is maintaining a strong intuition for when they can best be applied.&lt;/li&gt;
&lt;li&gt;An updated &lt;strong&gt;sense of estimation&lt;/strong&gt;. Estimating how long a project will take has always been one of the hardest but most important parts of being a senior engineer, especially in organizations where budget and strategy decisions are made based on those estimates. AI-assisted coding makes this &lt;em&gt;even harder&lt;/em&gt; - things that used to take a long time are much faster, but estimations now depend on new factors which we're all still trying to figure out.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you're going to really exploit the capabilities of these new tools, you need to be operating &lt;em&gt;at the top of your game&lt;/em&gt;. You're not just responsible for writing the code - you're researching approaches, deciding on high-level architecture, writing specifications, defining success criteria, &lt;a href="https://simonwillison.net/2025/Sep/30/designing-agentic-loops/"&gt;designing agentic loops&lt;/a&gt;, planning QA, managing a growing army of weird digital interns who will absolutely cheat if you give them a chance, and spending &lt;em&gt;so much time on code review&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Almost all of these are characteristics of senior software engineers already!&lt;/p&gt;
&lt;p&gt;AI tools &lt;strong&gt;amplify existing expertise&lt;/strong&gt;. The more skills and experience you have as a software engineer the faster and better the results you can get from working with LLMs and coding agents.&lt;/p&gt;
&lt;h4 id="-vibe-engineering-really-"&gt;"Vibe engineering", really?&lt;/h4&gt;
&lt;p&gt;Is this a stupid name? Yeah, probably. "Vibes" as a concept in AI feels a little tired at this point. "Vibe coding" itself is used by a lot of developers in a dismissive way. I'm ready to reclaim vibes for something more constructive.&lt;/p&gt;
&lt;p&gt;I've never really liked the artificial distinction between "coders" and "engineers" - that's always smelled to me a bit like gatekeeping. But in this case a bit of gatekeeping is exactly what we need!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Vibe engineering&lt;/strong&gt; establishes a clear distinction from vibe coding. It signals that this is a different, harder and more sophisticated way of working with AI tools to build production software.&lt;/p&gt;
&lt;p&gt;I like that this is cheeky and likely to be controversial. This whole space is still absurd in all sorts of different ways. We shouldn't take ourselves too seriously while we figure out the most productive ways to apply these new tools.&lt;/p&gt;
&lt;p&gt;I've tried in the past to get terms like &lt;strong&gt;&lt;a href="https://simonwillison.net/tags/ai-assisted-programming/"&gt;AI-assisted programming&lt;/a&gt;&lt;/strong&gt; to stick, with approximately zero success. May as well try rubbing some vibes on it and see what happens.&lt;/p&gt;
&lt;p&gt;I also really like the clear mismatch between "vibes" and "engineering". It makes the combined term self-contradictory in a way that I find mischievous and (hopefully) sticky.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/code-review"&gt;code-review&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/definitions"&gt;definitions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/llms"&gt;llms&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai-assisted-programming"&gt;ai-assisted-programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/vibe-coding"&gt;vibe-coding&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/coding-agents"&gt;coding-agents&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/parallel-agents"&gt;parallel-agents&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/agentic-engineering"&gt;agentic-engineering&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="code-review"/><category term="definitions"/><category term="software-engineering"/><category term="ai"/><category term="generative-ai"/><category term="llms"/><category term="ai-assisted-programming"/><category term="vibe-coding"/><category term="coding-agents"/><category term="parallel-agents"/><category term="agentic-engineering"/></entry><entry><title>Quoting potatolicious</title><link href="https://simonwillison.net/2025/Aug/21/potatolicious/#atom-tag" rel="alternate"/><published>2025-08-21T21:44:19+00:00</published><updated>2025-08-21T21:44:19+00:00</updated><id>https://simonwillison.net/2025/Aug/21/potatolicious/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://news.ycombinator.com/item?id=44976929#44978319"&gt;&lt;p&gt;Most classical engineering fields deal with probabilistic system components all of the time. In fact I'd go as far as to say that &lt;em&gt;inability&lt;/em&gt; to deal with probabilistic components is disqualifying from many engineering endeavors.&lt;/p&gt;
&lt;p&gt;Process engineers for example have to account for human error rates. On a given production line with humans in a loop, the operators will sometimes screw up. Designing systems to detect these errors (which are &lt;em&gt;highly probabilistic&lt;/em&gt;!), mitigate them, and reduce the occurrence rates of such errors is a huge part of the job. [...]&lt;/p&gt;
&lt;p&gt;Software engineering is &lt;em&gt;unlike&lt;/em&gt; traditional engineering disciplines in that for most of its lifetime it's had the luxury of purely deterministic expectations. This is not true in nearly every other type of engineering.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://news.ycombinator.com/item?id=44976929#44978319"&gt;potatolicious&lt;/a&gt;, in a conversation about AI engineering&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/hacker-news"&gt;hacker-news&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;&lt;/p&gt;



</summary><category term="hacker-news"/><category term="software-engineering"/><category term="ai"/><category term="generative-ai"/></entry><entry><title>Quoting Salvatore Sanfilippo</title><link href="https://simonwillison.net/2025/Feb/8/salvatore-sanfilippo/#atom-tag" rel="alternate"/><published>2025-02-08T17:55:36+00:00</published><updated>2025-02-08T17:55:36+00:00</updated><id>https://simonwillison.net/2025/Feb/8/salvatore-sanfilippo/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://antirez.com/news/145"&gt;&lt;p&gt;[...] We are destroying software with complex build systems.&lt;/p&gt;
&lt;p&gt;We are destroying software with an absurd chain of dependencies, making everything bloated and fragile.&lt;/p&gt;
&lt;p&gt;We are destroying software telling new programmers: “Don’t reinvent the wheel!”. But, reinventing the wheel is how you learn how things work, and is the first step to make new, different wheels. [...]&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://antirez.com/news/145"&gt;Salvatore Sanfilippo&lt;/a&gt;, We are destroying software&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/programming"&gt;programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/salvatore-sanfilippo"&gt;salvatore-sanfilippo&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;&lt;/p&gt;



</summary><category term="programming"/><category term="salvatore-sanfilippo"/><category term="software-engineering"/></entry><entry><title>My Approach to Building Large Technical Projects</title><link href="https://simonwillison.net/2024/Dec/28/my-approach-to-building-large-technical-projects/#atom-tag" rel="alternate"/><published>2024-12-28T14:54:46+00:00</published><updated>2024-12-28T14:54:46+00:00</updated><id>https://simonwillison.net/2024/Dec/28/my-approach-to-building-large-technical-projects/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://mitchellh.com/writing/building-large-technical-projects"&gt;My Approach to Building Large Technical Projects&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Mitchell Hashimoto wrote this piece about taking on large projects back in June 2023. The project he described in the post is a terminal emulator written in Zig called &lt;a href="https://ghostty.org/"&gt;Ghostty&lt;/a&gt; which just reached its &lt;a href="https://mitchellh.com/writing/ghostty-1-0-reflection"&gt;1.0 release&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I've learned that when I break down my large tasks in chunks that result in seeing tangible forward progress, I tend to finish my work and retain my excitement throughout the project. People are all motivated and driven in different ways, so this may not work for you, but as a broad generalization I've not found an engineer who doesn't get excited by a good demo. And the goal is to always give yourself a good demo.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For backend-heavy projects the lack of an initial UI is a challenge here, so Mitchell advocates for early automated tests as a way to start exercising code and seeing progress right from the start. Don't let tests get in the way of demos though:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;No matter what I'm working on, I try to build one or two demos per week intermixed with automated test feedback as explained in the previous section.&lt;/p&gt;
&lt;p&gt;Building a demo also provides you with invaluable product feedback. You can quickly intuit whether something &lt;em&gt;feels good&lt;/em&gt;, even if it isn't fully functional.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For more on the development of Ghostty see &lt;a href="https://mitchellh.com/writing/ghostty-and-useful-zig-patterns"&gt;this talk&lt;/a&gt; Mitchell gave at Zig Showtime last year:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I want the terminal to be a modern platform for text application development, analogous to the browser being a modern platform for GUI application development (for better or worse).&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://bsky.app/profile/vickiboykis.com/post/3l7xplgkifb2p"&gt;@vickiboykis.com&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/testing"&gt;testing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/zig"&gt;zig&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mitchell-hashimoto"&gt;mitchell-hashimoto&lt;/a&gt;&lt;/p&gt;



</summary><category term="open-source"/><category term="software-engineering"/><category term="testing"/><category term="zig"/><category term="mitchell-hashimoto"/></entry><entry><title>Cognitive load is what matters</title><link href="https://simonwillison.net/2024/Dec/26/cognitive-load-is-what-matters/#atom-tag" rel="alternate"/><published>2024-12-26T06:01:08+00:00</published><updated>2024-12-26T06:01:08+00:00</updated><id>https://simonwillison.net/2024/Dec/26/cognitive-load-is-what-matters/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://minds.md/zakirullin/cognitive"&gt;Cognitive load is what matters&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Excellent living document (the underlying repo has &lt;a href="https://github.com/zakirullin/cognitive-load/commits/main/"&gt;625 commits&lt;/a&gt; since being created in May 2023) maintained by Artem Zakirullin about minimizing the cognitive load needed to understand and maintain software.&lt;/p&gt;
&lt;p&gt;This all rings very true to me. I judge the quality of a piece of code by how easy it is to change, and anything that causes me to take on more cognitive load - unraveling a class hierarchy, reading though dozens of tiny methods - reduces the quality of the code by that metric.&lt;/p&gt;
&lt;p&gt;Lots of accumulated snippets of wisdom in this one.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mantras like "methods should be shorter than 15 lines of code" or "classes should be small" turned out to be somewhat wrong.&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/karpathy/status/1872038630405054853?s=46"&gt;@karpathy&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/programming"&gt;programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/cognitive-debt"&gt;cognitive-debt&lt;/a&gt;&lt;/p&gt;



</summary><category term="programming"/><category term="software-engineering"/><category term="cognitive-debt"/></entry><entry><title>Preferring throwaway code over design docs</title><link href="https://simonwillison.net/2024/Dec/15/preferring-throwaway-code-over-design-docs/#atom-tag" rel="alternate"/><published>2024-12-15T19:48:44+00:00</published><updated>2024-12-15T19:48:44+00:00</updated><id>https://simonwillison.net/2024/Dec/15/preferring-throwaway-code-over-design-docs/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://softwaredoug.com/blog/2024/12/14/throwaway-prs-not-design-docs"&gt;Preferring throwaway code over design docs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Doug Turnbull advocates for a software development process far more realistic than attempting to create a design document up front and then implement accordingly.&lt;/p&gt;
&lt;p&gt;As Doug observes, "No plan survives contact with the enemy". His process is to build a prototype in a draft pull request on GitHub, making detailed notes along the way and with the full intention of discarding it before building the final feature.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Important in this methodology is a great deal of maturity. Can you throw away your idea you’ve coded or will you be invested in your first solution? A major signal for seniority is whether you feel comfortable coding something 2-3 different ways. That your value delivery isn’t about lines of code shipped to prod, but organizational knowledge gained.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I've been running a similar process  for several years using issues rather than PRs. I wrote about that in &lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#everything-starts-with-an-issue"&gt;How I build a feature&lt;/a&gt; back in 2022.&lt;/p&gt;
&lt;p&gt;The thing I love about issue comments (or PR comments) for recording ongoing design decisions is that because they incorporate a timestamp there's no implicit expectation to keep them up to date as the software changes. Doug sees the same benefit:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Another important point is on using PRs for documentation. They are one of the best forms of documentation for devs. They’re discoverable - one of the first places you look when trying to understand why code is implemented a certain way. PRs don’t profess to reflect the current state of the world, but a state at a point in time.&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=42417478"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/github"&gt;github&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prototyping"&gt;prototyping&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;&lt;/p&gt;



</summary><category term="github"/><category term="prototyping"/><category term="software-engineering"/></entry><entry><title>Quoting Arvind Narayanan</title><link href="https://simonwillison.net/2024/Dec/2/arvind-narayanan/#atom-tag" rel="alternate"/><published>2024-12-02T11:51:21+00:00</published><updated>2024-12-02T11:51:21+00:00</updated><id>https://simonwillison.net/2024/Dec/2/arvind-narayanan/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://twitter.com/random_walker/status/1863547659794964865"&gt;&lt;p&gt;For most software engineers, being well rounded is more important than pure technical mastery. This was already true, of course — see @patio11's famous advice "Don't call yourself a programmer" — but even more so due to foundation models. In most situations, skills like being able to use AI to rapidly prototype in order to communicate with clients to iterate on specifications create far more business value than technical wizardry alone.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://twitter.com/random_walker/status/1863547659794964865"&gt;Arvind Narayanan&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/programming"&gt;programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prototyping"&gt;prototyping&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/arvind-narayanan"&gt;arvind-narayanan&lt;/a&gt;&lt;/p&gt;



</summary><category term="programming"/><category term="prototyping"/><category term="software-engineering"/><category term="ai"/><category term="arvind-narayanan"/></entry><entry><title>How I ship projects at big tech companies</title><link href="https://simonwillison.net/2024/Nov/11/shipping/#atom-tag" rel="alternate"/><published>2024-11-11T23:54:52+00:00</published><updated>2024-11-11T23:54:52+00:00</updated><id>https://simonwillison.net/2024/Nov/11/shipping/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.seangoedecke.com/how-to-ship/"&gt;How I ship projects at big tech companies&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
This piece by Sean Goedecke on shipping features at larger tech companies is fantastic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why do so many engineers think shipping is easy? I know it sounds extreme, but I think many engineers do not understand what shipping even is inside a large tech company. What does it mean to ship? It does not mean deploying code or even making a feature available to users. Shipping is a social construct within a company. Concretely, that means that &lt;strong&gt;a project is shipped when the important people at your company believe it is shipped&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sean emphasizes communication, building confidence and gaining trust and the importance of deploying previews of the feature (for example using feature flags) as early as possible to get that crucial internal buy-in and feedback from other teams.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I think a lot of engineers hold off on deploys essentially out of fear. If you want to ship, you need to do the exact opposite: you need to deploy as much as you can as early as possible, and you need to do the scariest changes as early as you can possibly do them. Remember that you have the most end-to-end context on the project, which means &lt;strong&gt;you should be the least scared of scary changes&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=42111031"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/management"&gt;management&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/feature-flags"&gt;feature-flags&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="management"/><category term="feature-flags"/></entry><entry><title>Whither CockroachDB?</title><link href="https://simonwillison.net/2024/Aug/16/whither-cockroachdb/#atom-tag" rel="alternate"/><published>2024-08-16T22:06:40+00:00</published><updated>2024-08-16T22:06:40+00:00</updated><id>https://simonwillison.net/2024/Aug/16/whither-cockroachdb/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://rfd.shared.oxide.computer/rfd/0508"&gt;Whither CockroachDB?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;a href="https://www.cockroachlabs.com/"&gt;CockroachDB&lt;/a&gt; - previously Apache 2.0, then BSL 1.1 - announced &lt;a href="https://www.cockroachlabs.com/blog/enterprise-license-announcement/"&gt;on Wednesday&lt;/a&gt; that they were moving to a source-available license.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://oxide.computer/"&gt;Oxide&lt;/a&gt; use CockroachDB for their product's control plane database. That software is shipped to end customers in an Oxide rack, and it's unacceptable to Oxide for their customers to think about the CockroachDB license.&lt;/p&gt;
&lt;p&gt;Oxide use RFDs - Requests for Discussion - internally, and occasionally publish them (see &lt;a href="https://rfd.shared.oxide.computer/rfd/0001"&gt;rfd1&lt;/a&gt;) using their own &lt;a href="https://github.com/oxidecomputer/rfd-site"&gt;custom software&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;They chose to publish &lt;a href="https://rfd.shared.oxide.computer/rfd/0508"&gt;this RFD&lt;/a&gt; that they wrote in response to the CockroachDB license change, describing in detail the situation they are facing and the options they considered.&lt;/p&gt;
&lt;p&gt;Since CockroachDB is a critical component in their stack which they have already patched in the past, they're opting to maintain their own fork of a recent Apache 2.0 licensed version:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The immediate plan is to self-support on CochroachDB 22.1 and potentially CockroachDB 22.2; we will not upgrade CockroachDB beyond 22.2. [...] This is not intended to be a community fork (we have no current intent to accept outside contributions); we will make decisions in this repository entirely around our own needs. If a community fork emerges based on CockroachDB 22.x, we will support it (and we will specifically seek to get our patches integrated), but we may or may not adopt it ourselves: we are very risk averse with respect to this database and we want to be careful about outsourcing any risk decisions to any entity outside of Oxide.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The full document is a &lt;em&gt;fascinating&lt;/em&gt; read - as Kelsey Hightower &lt;a href="https://twitter.com/kelseyhightower/status/1824502930550268410"&gt;said&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is engineering at its finest and not a single line of code was written.&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/kelseyhightower/status/1824502930550268410"&gt;@kelseyhightower&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/databases"&gt;databases&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/oxide"&gt;oxide&lt;/a&gt;&lt;/p&gt;



</summary><category term="databases"/><category term="open-source"/><category term="software-engineering"/><category term="oxide"/></entry><entry><title>Lessons learned in 35 years of making software</title><link href="https://simonwillison.net/2024/Jul/16/lessons-learned/#atom-tag" rel="alternate"/><published>2024-07-16T20:12:19+00:00</published><updated>2024-07-16T20:12:19+00:00</updated><id>https://simonwillison.net/2024/Jul/16/lessons-learned/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.jimgrey.net/2024/07/03/lessons-learned-in-35-years-of-making-software/"&gt;Lessons learned in 35 years of making software&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Lots of great stuff in here from Jim Grey, with a strong focus on "soft skills" (I prefer the term "professional skills") around building relationships and making sure your contributions are visible.&lt;/p&gt;
&lt;p&gt;This tip resonated with me in particular:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;There is no substitute for working software in Production&lt;/strong&gt;. I can’t believe now that I have been part of &lt;em&gt;18-month&lt;/em&gt; release projects. This was back in the bad old waterfall days, but even then it was possible to release a lot more frequently than that. The software we build is valuable. It builds the value of the company. When you hold it until it’s perfect, or everything you think it needs to be, you are holding back on building the company’s value. Find the fastest, shortest path to getting the smallest increment of the thing that will work into the customer’s hands. You can keep making it better from there.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And another tip on the subject of perfectionism:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;When you deliver work you’re really proud of, you’ve almost certainly done too much and taken too long&lt;/strong&gt;. I have a bit of a perfectionist streak. I want to do my work well and thoroughly. It took me a long time to learn that when I do that, it’s for me, not for the company. When I’ve reached 60-80% of the thing being as good as I want, I’ve probably done enough.&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://lobste.rs/s/hqa40h/lessons_learned_35_years_making_software"&gt;lobste.rs&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/careers"&gt;careers&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="careers"/></entry><entry><title>Quoting Jacob Kaplan-Moss</title><link href="https://simonwillison.net/2024/Jul/13/jacob-kaplan-moss/#atom-tag" rel="alternate"/><published>2024-07-13T14:12:38+00:00</published><updated>2024-07-13T14:12:38+00:00</updated><id>https://simonwillison.net/2024/Jul/13/jacob-kaplan-moss/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://jacobian.org/2024/jul/12/lnt-for-engineering-leadership/"&gt;&lt;p&gt;We respect wildlife in the wilderness because we’re in &lt;em&gt;their&lt;/em&gt; house. We don’t fully understand the complexity of most ecosystems, so we seek to minimize our impact on those ecosystems since we can’t always predict what outcomes our interactions with nature might have.&lt;/p&gt;
&lt;p&gt;In software, many disastrous mistakes stem from not understanding why a system was built the way it was, but changing it anyway. It’s super common for a new leader to come in, see something they see as “useless”, and get rid of it – without understanding the implications. Good leaders make sure they understand before they mess around.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://jacobian.org/2024/jul/12/lnt-for-engineering-leadership/"&gt;Jacob Kaplan-Moss&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/jacob-kaplan-moss"&gt;jacob-kaplan-moss&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/management"&gt;management&lt;/a&gt;&lt;/p&gt;



</summary><category term="jacob-kaplan-moss"/><category term="software-engineering"/><category term="management"/></entry><entry><title>Quoting Bryan Cantrill</title><link href="https://simonwillison.net/2024/Jan/18/bryan-cantrill/#atom-tag" rel="alternate"/><published>2024-01-18T03:27:21+00:00</published><updated>2024-01-18T03:27:21+00:00</updated><id>https://simonwillison.net/2024/Jan/18/bryan-cantrill/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://speakerdeck.com/bcantrill/things-i-learned-the-hard-way"&gt;&lt;p&gt;Tools are the things we build that we don't ship - but that very much affect the artifact that we develop.&lt;/p&gt;
&lt;p&gt;It can be tempting to either shy away from developing tooling entirely or (in larger organizations) to dedicate an entire organization to it.&lt;/p&gt;
&lt;p&gt;In my experience, tooling should be built by those using it.&lt;/p&gt;
&lt;p&gt;This is especially true for tools that improve the artifact by improving understanding: the best time to develop a debugger is when debugging!&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://speakerdeck.com/bcantrill/things-i-learned-the-hard-way"&gt;Bryan Cantrill&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/tools"&gt;tools&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/bryan-cantrill"&gt;bryan-cantrill&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="tools"/><category term="bryan-cantrill"/></entry><entry><title>Tech debt metaphor maximalism</title><link href="https://simonwillison.net/2023/Jul/8/tech-debt-metaphor-maximalism/#atom-tag" rel="alternate"/><published>2023-07-08T05:11:24+00:00</published><updated>2023-07-08T05:11:24+00:00</updated><id>https://simonwillison.net/2023/Jul/8/tech-debt-metaphor-maximalism/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://apenwarr.ca/log/20230605"&gt;Tech debt metaphor maximalism&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I’ve long been a fan of the metaphor of technical debt, because it implies that taking on some debt is OK provided you’re strategic about how much you take on and how quickly you pay it off. Avery Pennarun provides the definitive guide to thinking about technical debt, including an extremely worthwhile explanation of how financial debt works as well.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=36635496"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/technical-debt"&gt;technical-debt&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/avery-pennarun"&gt;avery-pennarun&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="technical-debt"/><category term="avery-pennarun"/></entry><entry><title>Quoting sametmax</title><link href="https://simonwillison.net/2023/Jun/23/sametmax/#atom-tag" rel="alternate"/><published>2023-06-23T23:59:54+00:00</published><updated>2023-06-23T23:59:54+00:00</updated><id>https://simonwillison.net/2023/Jun/23/sametmax/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://news.ycombinator.com/item?id=36429671"&gt;&lt;p&gt;Every year, some generation of engineers have to learn the concepts of "there is no silver bullet", "use the right tech for the right problem", "your are not google", "rewriting a codebase every 2 years is not a good business decision", "things cost money".&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://news.ycombinator.com/item?id=36429671"&gt;sametmax&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/></entry><entry><title>Quoting Justin Etheredge</title><link href="https://simonwillison.net/2023/Jan/19/justin-etheredge/#atom-tag" rel="alternate"/><published>2023-01-19T01:42:48+00:00</published><updated>2023-01-19T01:42:48+00:00</updated><id>https://simonwillison.net/2023/Jan/19/justin-etheredge/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://www.simplethread.com/20-things-ive-learned-in-my-20-years-as-a-software-engineer/"&gt;&lt;p&gt;Old technologies that have stuck around are sharks, not dinosaurs. They solve problems so well that they have survived the rapid changes that occur constantly in the technology world. Don’t bet against these technologies, and replace them only if you have a very good reason. These tools won’t be flashy, and they won’t be exciting, but they will get the job done without a lot of sleepless nights.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://www.simplethread.com/20-things-ive-learned-in-my-20-years-as-a-software-engineer/"&gt;Justin Etheredge&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/></entry><entry><title>The Perfect Commit</title><link href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#atom-tag" rel="alternate"/><published>2022-10-29T20:41:01+00:00</published><updated>2022-10-29T20:41:01+00:00</updated><id>https://simonwillison.net/2022/Oct/29/the-perfect-commit/#atom-tag</id><summary type="html">
    &lt;p&gt;For the last few years I've been trying to center my work around creating what I consider to be the &lt;em&gt;Perfect Commit&lt;/em&gt;. This is a single commit that contains all of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;implementation&lt;/strong&gt;: a single, focused change&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tests&lt;/strong&gt; that demonstrate the implementation works&lt;/li&gt;
&lt;li&gt;Updated &lt;strong&gt;documentation&lt;/strong&gt; reflecting the change&lt;/li&gt;
&lt;li&gt;A link to an &lt;strong&gt;issue thread&lt;/strong&gt; providing further context&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our job as software engineers generally isn't to write new software from scratch: we spend the majority of our time adding features and fixing bugs in existing software.&lt;/p&gt;
&lt;p&gt;The commit is our principle unit of work. It deserves to be treated thoughtfully and with care.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Update 26th November 2022&lt;/strong&gt;: My 25 minute talk &lt;a href="https://simonwillison.net/2022/Nov/26/productivity/"&gt;Massively increase your productivity on personal projects with comprehensive documentation and automated tests&lt;/a&gt; describes this approach to software development in detail.&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#implementation"&gt;Implementation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#tests"&gt;Tests&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#documentation"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#link-to-an-issue"&gt;A link to an issue&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#issue-over-commit-message"&gt;An issue is more valuable than a commit message&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#not-all-perfect"&gt;Not every commit needs to be "perfect"&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#scrappy-branches"&gt;Write scrappy commits in a branch&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/#examples"&gt;Some examples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="implementation"&gt;Implementation&lt;/h4&gt;
&lt;p&gt;Each commit should change a single thing.&lt;/p&gt;
&lt;p&gt;The definition of "thing" here is left deliberately vague!&lt;/p&gt;
&lt;p&gt;The goal is have something that can be easily reviewed, and that can be clearly understood in the future when revisited using tools like &lt;code&gt;git blame&lt;/code&gt; or &lt;a href="https://til.simonwillison.net/git/git-bisect"&gt;git bisect&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I like to keep my commit history linear, as I find that makes it much easier to comprehend later. This further reinforces the value of each commit being a single, focused change.&lt;/p&gt;
&lt;p&gt;Atomic commits are also much easier to cleanly revert if something goes wrong - or to cherry-pick into other branches.&lt;/p&gt;
&lt;p&gt;For things like web applications that can be deployed to production, a commit should be a unit that can be deployed. Aiming to keep the main branch in a deployable state is a good rule of thumb for deciding if a commit is a sensible atomic change or not.&lt;/p&gt;
&lt;h4 id="tests"&gt;Tests&lt;/h4&gt;
&lt;p&gt;The ultimate goal of tests is to &lt;em&gt;increase&lt;/em&gt; your productivity. If your testing practices are slowing you down, you should consider ways to improve them.&lt;/p&gt;
&lt;p&gt;In the longer term, this productivity improvement comes from gaining the freedom to make changes and stay confident that your change hasn't broken something else.&lt;/p&gt;
&lt;p&gt;But tests can help increase productivity in the immediate short term as well.&lt;/p&gt;
&lt;p&gt;How do you know when the change you have made is finished and ready to commit? It's ready when the new tests pass.&lt;/p&gt;
&lt;p&gt;I find this reduces the time I spend second-guessing myself and questioning whether I've done enough and thought through all of the edge cases.&lt;/p&gt;
&lt;p&gt;Without tests, there's a very strong possibility that your change will have broken some other, potentially unrelated feature. Your commit could be held up by hours of tedious manual testing. Or you could &lt;abbr title="You Only Live Once"&gt;YOLO&lt;/abbr&gt; it and learn that you broke something important later!&lt;/p&gt;
&lt;p&gt;Writing tests becomes far less time consuming if you already have good testing practices in place.&lt;/p&gt;
&lt;p&gt;Adding a new test to a project with a lot of existing tests is easy: you can often find an existing test that has 90% of the pattern you need already worked out for you.&lt;/p&gt;
&lt;p&gt;If your project has no tests at all, adding a test for your change will be a lot more work.&lt;/p&gt;
&lt;p&gt;This is why I start every single one of my projects with a passing test. It doesn't matter what this test is - &lt;code&gt;assert 1 + 1 == 2&lt;/code&gt; is fine! The key thing is to get a testing framework in place, such that you can run a command (for me that's usually &lt;code&gt;pytest&lt;/code&gt;) to execute the test suite - and you have an obvious place to add new tests in the future.&lt;/p&gt;
&lt;p&gt;I use &lt;a href="https://simonwillison.net/2021/Aug/28/dynamic-github-repository-templates/"&gt;these cookiecutter templates&lt;/a&gt; for almost all of my new projects. They configure a testing framework with a single passing test and GitHub Actions workflows to exercise it all from the very start.&lt;/p&gt;
&lt;p&gt;I'm not a huge advocate of test-first development, where tests are written before the code itself. What I care about is tests-included development, where the final commit bundles the tests and the implementation together. I wrote more about my approach to testing in &lt;a href="https://simonwillison.net/2020/Feb/11/cheating-at-unit-tests-pytest-black/"&gt;How to cheat at unit tests with pytest and Black&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="documentation"&gt;Documentation&lt;/h4&gt;
&lt;p&gt;If your project defines APIs that are meant to be used outside of your project, they need to be documented. In my work these projects are usually one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Python APIs (modules, functions and classes) that provide code designed to be imported into other projects.&lt;/li&gt;
&lt;li&gt;Web APIs - usually JSON over HTTP these days - that provide functionality to be consumed by other applications.&lt;/li&gt;
&lt;li&gt;Command line interface tools, such as those implemented using &lt;a href="https://click.palletsprojects.com/"&gt;Click&lt;/a&gt; or &lt;a href="https://typer.tiangolo.com/"&gt;Typer&lt;/a&gt; or &lt;a href="https://docs.python.org/3/library/argparse.html"&gt;argparse&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is critical that this documentation &lt;strong&gt;must live in the same repository as the code itself&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is important for a number of reasons.&lt;/p&gt;
&lt;p&gt;Documentation is only valuable &lt;strong&gt;if people trust it&lt;/strong&gt;. People will only trust it if they know that it is kept up to date.&lt;/p&gt;
&lt;p&gt;If your docs live in a separate wiki somewhere it's easy for them to get out of date - but more importantly it's hard for anyone to quickly confirm if the documentation is being updated in sync with the code or not.&lt;/p&gt;
&lt;p&gt;Documentation should be &lt;strong&gt;versioned&lt;/strong&gt;. People need to be able to find the docs for the specific version of your software that they are using. Keeping it in the same repository as the code gives you synchronized versioning for free.&lt;/p&gt;
&lt;p&gt;Documentation changes should be &lt;strong&gt;reviewed&lt;/strong&gt; in the same way as your code. If they live in the same repository you can catch changes that need to be reflected in the documentation as part of your code review process.&lt;/p&gt;
&lt;p&gt;And ideally, documentation should be &lt;strong&gt;tested&lt;/strong&gt;. I wrote about my approach to doing this using &lt;a href="https://simonwillison.net/2018/Jul/28/documentation-unit-tests/"&gt;Documentation unit tests&lt;/a&gt;. Executing example code in the documentation using a testing framework is a great idea too.&lt;/p&gt;
&lt;p&gt;As with tests, writing documentation from scratch is much more work than incrementally modifying existing documentation.&lt;/p&gt;
&lt;p&gt;Many of my commits include documentation that is just a sentence or two. This doesn't take very long to write, but it adds up to something very comprehensive over time.&lt;/p&gt;
&lt;p&gt;How about end-user facing documentation? I'm still figuring that out myself. I created my &lt;a href="https://simonwillison.net/2022/Mar/10/shot-scraper/"&gt;shot-scraper tool&lt;/a&gt; to help automate the process of keeping screenshots up-to-date, but I've not yet found personal habits and styles for end-user documentation that I'm confident in.&lt;/p&gt;
&lt;h4 id="link-to-an-issue"&gt;A link to an issue&lt;/h4&gt;
&lt;p&gt;Every perfect commit should include a link to an issue thread that accompanies that change.&lt;/p&gt;
&lt;p&gt;Sometimes I'll even open an issue seconds before writing the commit message, just to give myself something I can link to from the commit itself!&lt;/p&gt;
&lt;p&gt;The reason I like issue threads is that they provide effectively unlimited space for commentary and background for the change that is being made.&lt;/p&gt;
&lt;p&gt;Most of my issue threads are me talking to myself - sometimes with dozens of issue comments, all written by me.&lt;/p&gt;
&lt;p&gt;Things that can go in an issue thread include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Background&lt;/strong&gt;: the reason for the change. I try to include this in the opening comment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State of play&lt;/strong&gt; before the change. I'll often link to the current version of the code and documentation. This is great for if I return to an open issue a few days later, as it saves me from having to repeat that initial research.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Links to things&lt;/strong&gt;. So many links! Inspiration for the change, relevant documentation, conversations on Slack or Discord, clues found on StackOverflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code snippets&lt;/strong&gt; illustrating potential designs and false-starts. Use &lt;code&gt;```python ... ```&lt;/code&gt; blocks to get syntax highlighting in your issue comments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decisions&lt;/strong&gt;. What did you consider? What did you decide? As programmers we make hundreds of tiny decisions a day. Write them down! Then you'll never find yourself relitigating them in the future having forgotten your original reasoning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screenshots&lt;/strong&gt;. What it looked like before, what it looked like after. Animated screenshots are even better! I use &lt;a href="https://www.cockos.com/licecap/"&gt;LICEcap&lt;/a&gt; to generate quick GIF screen captures or QuickTime to capture videos - both of which can be dropped straight into a GitHub issue comment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prototypes&lt;/strong&gt;. I'll often paste a few lines of code copied from a Python console session. Sometimes I'll even paste in a block of HTML and CSS, or add a screenshot of a UI prototype.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After I've closed my issues I like to add one last comment that links to the updated documentation and ideally a live demo of the new feature.&lt;/p&gt;
&lt;h4 id="issue-over-commit-message"&gt;An issue is more valuable than a commit message&lt;/h4&gt;
&lt;p&gt;I went through a several year phase of writing essays in my commit messages, trying to capture as much of the background context and thinking as possible.&lt;/p&gt;
&lt;p&gt;My commit messages grew a lot shorter when I started bundling the updated documentation in the commit - since often much of the material I'd previously included in the commit message was now in that documentation instead.&lt;/p&gt;
&lt;p&gt;As I extended my practice of writing issue threads, I found that they were a better place for most of this context than the commit messages themselves. They supported embedded media, were more discoverable and I could continue to extend them even after the commit had landed.&lt;/p&gt;
&lt;p&gt;Today many of my commit messages are a single line summary and a link to an issue!&lt;/p&gt;
&lt;p&gt;The biggest benefit of lengthy commit messages is that they are guaranteed to survive for as long as the repository itself. If you're going to use issue threads in the way I describe here it is critical that you consider their long term archival value.&lt;/p&gt;
&lt;p&gt;I expect this to be controversial! I'm advocating for abandoning one of the core ideas of Git here - that each repository should incorporate a full, decentralized record of its history that is copied in its entirety when someone clones a repo.&lt;/p&gt;
&lt;p&gt;I understand that philosophy. All I'll say here is that my own experience has been that dropping that requirement has resulted in a net increase in my overall productivity. Other people may reach a different conclusion.&lt;/p&gt;
&lt;p&gt;If this offends you too much, you're welcome to construct an &lt;em&gt;even more perfect commit&lt;/em&gt; that incorporates background information and additional context in an extended commit message as well.&lt;/p&gt;
&lt;p&gt;One of the reasons I like GitHub Issues is that it includes a comprehensive API, which can be used to extract all of that data. I use my &lt;a href="https://github.com/dogsheep/github-to-sqlite"&gt;github-to-sqlite tool&lt;/a&gt; to maintain an ongoing archive of my issues and issue comments as a SQLite database file.&lt;/p&gt;
&lt;h4 id="not-all-perfect"&gt;Not every commit needs to be "perfect"&lt;/h4&gt;
&lt;p&gt;I find that the vast majority of my work fits into this pattern, but there are exceptions.&lt;/p&gt;
&lt;p&gt;Typo fix for some documentation or a comment? Just ship it, it's fine.&lt;/p&gt;
&lt;p&gt;Bug fix that doesn't deserve documentation? Still bundle the implementation and the test plus a link to an issue, but no need to update the docs - especially if they already describe the expected bug-free behaviour.&lt;/p&gt;
&lt;p&gt;Generally though, I find that aiming for implementation, tests, documentation and an issue link covers almost all of my work. It's a really good default model.&lt;/p&gt;
&lt;h4 id="scrappy-branches"&gt;Write scrappy commits in a branch&lt;/h4&gt;
&lt;p&gt;If I'm writing more exploratory or experimental code it often doesn't make sense to work in this strict way. For those instances I'll usually work in a branch, where I can ship "WIP" commit messages and failing tests with abandon. I'll then squash-merge them into a single perfect commit (sometimes via a self-closed GitHub pull request) to keep my main branch as tidy as possible.&lt;/p&gt;
&lt;h4 id="examples"&gt;Some examples&lt;/h4&gt;
&lt;p&gt;Here are some examples of my commits that follow this pattern:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/datasette/commit/9676b2deb07cff20247ba91dad3e84a4ab0b00d1"&gt;Upgrade Docker images to Python 3.11&lt;/a&gt; for &lt;a href="https://github.com/simonw/datasette/issues/1853"&gt;datasette #1853&lt;/a&gt; - a pretty tiny change, but still includes tests, docs and an issue link.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/sqlite-utils/commit/ab8d4aad0c42f905640981f6f24bc1e37205ae62"&gt;sqlite-utils schema now takes optional tables&lt;/a&gt; for &lt;a href="https://github.com/simonw/sqlite-utils/issues/299"&gt;sqlite-utils #299&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/shot-scraper/commit/5048e21a1ca5accedfeca6ac25a16a38dc240b81"&gt;shot-scraper html command&lt;/a&gt; for &lt;a href="https://github.com/simonw/shot-scraper/issues/96"&gt;shot-scraper #96&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/s3-credentials/commit/c7bb7268c4a124349bb511f7ec3ee3f28f9581ad"&gt;s3-credentials put-objects command&lt;/a&gt; for &lt;a href="https://github.com/simonw/s3-credentials/issues/68"&gt;s3-credentials #68&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/datasette-gunicorn/commit/0d561d7a94f76079b1eb7779b3e944c163d2539e"&gt;Initial implementation&lt;/a&gt; for &lt;a href="https://github.com/simonw/datasette-gunicorn/issues/1"&gt;datasette-gunicorn #1&lt;/a&gt; - this was the first commit to this repository, but I still bundled the tests, docs, implementation and a link to an issue.&lt;/li&gt;
&lt;/ul&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/code-review"&gt;code-review&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/definitions"&gt;definitions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/documentation"&gt;documentation&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/git"&gt;git&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github"&gt;github&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/testing"&gt;testing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github-issues"&gt;github-issues&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="code-review"/><category term="definitions"/><category term="documentation"/><category term="git"/><category term="github"/><category term="software-engineering"/><category term="testing"/><category term="github-issues"/></entry><entry><title>Software engineering practices</title><link href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#atom-tag" rel="alternate"/><published>2022-10-01T15:56:02+00:00</published><updated>2022-10-01T15:56:02+00:00</updated><id>https://simonwillison.net/2022/Oct/1/software-engineering-practices/#atom-tag</id><summary type="html">
    &lt;p&gt;Gergely Orosz &lt;a href="https://twitter.com/GergelyOrosz/status/1576161504260657152"&gt;started a Twitter conversation&lt;/a&gt; asking about recommended "software engineering practices" for development teams.&lt;/p&gt;
&lt;p&gt;(I really like his rejection of the term "best practices" here: I always feel it's prescriptive and misguiding to announce something as "best".)&lt;/p&gt;
&lt;p&gt;I decided to flesh some of my replies out into a longer post.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#docs-same-repo"&gt;Documentation in the same repo as the code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#create-test-data"&gt;Mechanisms for creating test data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#rock-solid-migrations"&gt;Rock solid database migrations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#new-project-templates"&gt;Templates for new projects and components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#auto-formatting"&gt;Automated code formatting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#tested-dev-environments"&gt;Tested, automated process for new development environments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Oct/1/software-engineering-practices/#automated-previews"&gt;Automated preview environments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="docs-same-repo"&gt;Documentation in the same repo as the code&lt;/h4&gt;
&lt;p&gt;The most important characteristic of internal documentation is trust: do people trust that documentation both exists and is up-to-date?&lt;/p&gt;
&lt;p&gt;If they don't, they won't read it or contribute to it.&lt;/p&gt;
&lt;p&gt;The best trick I know of for improving the trustworthiness of documentation is to put it in the same repository as the code it documents, for a few reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You can enforce documentation updates as part of your code review process. If a PR changes code in a way that requires documentation updates, the reviewer can ask for those updates to be included.&lt;/li&gt;
&lt;li&gt;You get versioned documentation. If you're using an older version of a library you can consult the documentation for that version. If you're using the current main branch you can see documentation for that, without confusion over what corresponds to the most recent "stable" release.&lt;/li&gt;
&lt;li&gt;You can integrate your documentation with your automated tests! I wrote about this in &lt;a href="https://simonwillison.net/2018/Jul/28/documentation-unit-tests/"&gt;Documentation unit tests&lt;/a&gt;, which describes a pattern for introspecting code and then ensuring that the documentation at least has a section header that matches specific concepts, such as plugin hooks or configuration options.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id="create-test-data"&gt;Mechanisms for creating test data&lt;/h4&gt;
&lt;p&gt;When you work on large products, your customers will inevitably find surprising ways to stress or break your system. They might create an event with over a hundred different types of ticket for example, or an issue thread with a thousand comments.&lt;/p&gt;
&lt;p&gt;These can expose performance issues that don't affect the majority of your users, but can still lead to service outages or other problems.&lt;/p&gt;
&lt;p&gt;Your engineers need a way to replicate these situations in their own development environments.&lt;/p&gt;
&lt;p&gt;One way to handle this is to provide tooling to import production data into local environments. This has privacy and security implications - what if a developer laptop gets stolen that happens to have a copy of your largest customer's data?&lt;/p&gt;
&lt;p&gt;A better approach is to have a robust system in place for generating test data, that covers a variety of different scenarios.&lt;/p&gt;
&lt;p&gt;You might have a button somewhere that creates an issue thread with a thousand fake comments, with a note referencing the bug that this helps emulate.&lt;/p&gt;
&lt;p&gt;Any time a new edge case shows up, you can add a new recipe to that system. That way engineers can replicate problems locally without needing copies of production data.&lt;/p&gt;
&lt;h4 id="rock-solid-migrations"&gt;Rock solid database migrations&lt;/h4&gt;
&lt;p&gt;The hardest part of large-scale software maintenance is inevitably the bit where you need to change your database schema.&lt;/p&gt;
&lt;p&gt;(I'm confident that one of the biggest reasons NoSQL databases became popular over the last decade was the pain people had associated with relational databases due to schema changes. Of course, NoSQL database schema modifications are still necessary, and often they're even more painful!)&lt;/p&gt;
&lt;p&gt;So you need to invest in a really good, version-controlled mechanism for managing schema changes. And a way to run them in production without downtime.&lt;/p&gt;
&lt;p&gt;If you do not have this your engineers will respond by being fearful of schema changes. Which means they'll come up with increasingly complex hacks to avoid them, which piles on technical debt.&lt;/p&gt;
&lt;p&gt;This is a deep topic. I mostly use Django for large database-backed applications, and Django has the best &lt;a href="https://docs.djangoproject.com/en/4.1/topics/migrations/"&gt;migration system&lt;/a&gt; I've ever personally experienced. If I'm working without Django I try to replicate its approach as closely as possible:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The database knows which migrations have already been applied. This means when you run the "migrate" command it can run just the ones that are still needed - important for managing multiple databases, e.g. production, staging, test and development environments.&lt;/li&gt;
&lt;li&gt;A single command that applies pending migrations, and updates the database rows that record which migrations have been run.&lt;/li&gt;
&lt;li&gt;Optional: rollbacks. Django migrations can be rolled back, which is great for iterating in a development environment but using that in production is actually quite rare: I'll often ship a new migration that reverses the change instead rather than using a rollback, partly to keep the record of the mistake in version control.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even harder is the challenge of making schema changes without any downtime. I'm always interested in reading about new approaches for this - GitHub's &lt;a href="https://github.com/github/gh-ost"&gt;gh-ost&lt;/a&gt; is a neat solution for MySQL.&lt;/p&gt;
&lt;p&gt;An interesting consideration here is that it's rarely possible to have application code and database schema changes go out at the exact same instance in time. As a result, to avoid downtime you need to design every schema change with this in mind. The process needs to be:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Design a new schema change that can be applied without changing the application code that uses it.&lt;/li&gt;
&lt;li&gt;Ship that change to production, upgrading your database while keeping the old code working.&lt;/li&gt;
&lt;li&gt;Now ship new application code that uses the new schema.&lt;/li&gt;
&lt;li&gt;Ship a new schema change that cleans up any remaining work - dropping columns that are no longer used, for example.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This process is a pain. It's difficult to get right. The only way to get good at it is to practice it a lot over time.&lt;/p&gt;
&lt;p&gt;My rule is this: &lt;strong&gt;schema changes should be boring and common&lt;/strong&gt;, as opposed to being exciting and rare.&lt;/p&gt;
&lt;h4 id="new-project-templates"&gt;Templates for new projects and components&lt;/h4&gt;
&lt;p&gt;If you're working with microservices, your team will inevitably need to build new ones.&lt;/p&gt;
&lt;p&gt;If you're working in a monorepo, you'll still have elements of your codebase with similar structures - components and feature implementations of some sort.&lt;/p&gt;
&lt;p&gt;Be sure to have really good templates in place for creating these "the right way" - with the right directory structure, a README and a test suite with a single, dumb passing test.&lt;/p&gt;
&lt;p&gt;I like to use the Python &lt;a href="https://cookiecutter.readthedocs.io/"&gt;cookiecutter&lt;/a&gt; tool for this. I've also used GitHub template repositories, and I even have a neat trick for &lt;a href="https://simonwillison.net/2021/Aug/28/dynamic-github-repository-templates/"&gt;combining the two&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;These templates need to be maintained and kept up-to-date. The best way to do that is to make sure they are being used - every time a new project is created is a chance to revise the template and make sure it still reflects the recommended way to do things.&lt;/p&gt;
&lt;h4 id="auto-formatting"&gt;Automated code formatting&lt;/h4&gt;
&lt;p&gt;This one's easy. Pick a code formatting tool for your language - like &lt;a href="https://github.com/psf/black"&gt;Black&lt;/a&gt; for Python or &lt;a href="https://prettier.io/"&gt;Prettier&lt;/a&gt; for JavaScript (I'm so jealous of how Go has &lt;a href="https://pkg.go.dev/cmd/gofmt"&gt;gofmt&lt;/a&gt; built in) - and run its "check" mode in your CI flow.&lt;/p&gt;
&lt;p&gt;Don't argue with its defaults, just commit to them.&lt;/p&gt;
&lt;p&gt;This saves an incredible amount of time in two places:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As an individual, you get back all of that mental energy you used to spend thinking about the best way to format your code and can spend it on something more interesting.&lt;/li&gt;
&lt;li&gt;As a team, your code reviews can entirely skip the pedantic arguments about code formatting. Huge productivity win!&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="tested-dev-environments"&gt;Tested, automated process for new development environments&lt;/h4&gt;
&lt;p&gt;The most painful part of any software project is inevitably setting up the initial development environment.&lt;/p&gt;
&lt;p&gt;The moment your team grows beyond a couple of people, you should invest in making this work better.&lt;/p&gt;
&lt;p&gt;At the very least, you need a documented process for creating a new environment - and it has to be known-to-work, so any time someone is onboarded using it they should be encouraged to fix any problems in the documentation or accompanying scripts as they encounter them.&lt;/p&gt;
&lt;p&gt;Much better is an automated process: a single script that gets everything up and running. Tools like Docker have made this a LOT easier over the past decade.&lt;/p&gt;
&lt;p&gt;I'm increasingly convinced that the best-in-class solution here is cloud-based development environments. The ability to click a button on a web page and have a fresh, working development environment running a few seconds later is a game-changer for large development teams.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.gitpod.io/"&gt;Gitpod&lt;/a&gt; and &lt;a href="https://github.com/features/codespaces"&gt;Codespaces&lt;/a&gt; are two of the most promising tools I've tried in this space.&lt;/p&gt;
&lt;p&gt;I've seen developers lose hours a week to issues with their development environment. Eliminating that across a large team is the equivalent of hiring several new full-time engineers!&lt;/p&gt;
&lt;h4 id="automated-previews"&gt;Automated preview environments&lt;/h4&gt;
&lt;p&gt;Reviewing a pull request is a lot easier if you can actually try out the changes.&lt;/p&gt;
&lt;p&gt;The best way to do this is with automated preview environments, directly linked to from the PR itself.&lt;/p&gt;
&lt;p&gt;These are getting increasingly easy to offer. &lt;a href="https://vercel.com/features/previews"&gt;Vercel&lt;/a&gt;, &lt;a href="https://www.netlify.com/products/deploy-previews/"&gt;Netlify&lt;/a&gt;, &lt;a href="https://render.com/docs/pull-request-previews"&gt;Render&lt;/a&gt; and &lt;a href="https://devcenter.heroku.com/articles/github-integration-review-apps"&gt;Heroku&lt;/a&gt; all have features that can do this. Building a custom system on top of something like &lt;a href="https://cloud.google.com/run"&gt;Google Cloud Run&lt;/a&gt; or &lt;a href="https://fly.io/blog/fly-machines/"&gt;Fly Machines&lt;/a&gt; is also possible with a bit of work.&lt;/p&gt;
&lt;p&gt;This is another one of those things which requires some up-front investment but will pay itself off many times over through increased productivity and quality of reviews.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/documentation"&gt;documentation&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/testing"&gt;testing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/version-control"&gt;version-control&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/zero-downtime"&gt;zero-downtime&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github-actions"&gt;github-actions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/technical-debt"&gt;technical-debt&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gergely-orosz"&gt;gergely-orosz&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="documentation"/><category term="software-engineering"/><category term="testing"/><category term="version-control"/><category term="zero-downtime"/><category term="github-actions"/><category term="technical-debt"/><category term="gergely-orosz"/></entry><entry><title>Reduce Friction</title><link href="https://simonwillison.net/2022/Jul/25/reduce-friction/#atom-tag" rel="alternate"/><published>2022-07-25T22:25:07+00:00</published><updated>2022-07-25T22:25:07+00:00</updated><id>https://simonwillison.net/2022/Jul/25/reduce-friction/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.ceejbot.com/posts/reduce-friction/"&gt;Reduce Friction&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Outstanding essay on software engineering friction and development team productivity by C J Silverio: it explains the concept of “friction” (and gives great definitions of “process”, “ceremony” and “formality” in the process) as it applies to software engineering, lays out the challenges involved in getting organizations to commit to reducing it and then provides actionable advice on how to get consensus and where to invest your efforts in order to make things better.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/management"&gt;management&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="management"/></entry><entry><title>Visual Studio Code: Development Process</title><link href="https://simonwillison.net/2022/Jul/20/visual-studio-code-development-process/#atom-tag" rel="alternate"/><published>2022-07-20T16:34:54+00:00</published><updated>2022-07-20T16:34:54+00:00</updated><id>https://simonwillison.net/2022/Jul/20/visual-studio-code-development-process/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/microsoft/vscode/wiki/Development-Process"&gt;Visual Studio Code: Development Process&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A detailed description of the development process used by VS Code: a 6-12 month high level roadmap, then month long iterations that each result in a new version that is shipped to users. Includes details of how the four weeks of each iteration are spent too.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/migueldeicaza/status/1549784683646418946"&gt;Miguel de Icaza&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/microsoft"&gt;microsoft&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/vs-code"&gt;vs-code&lt;/a&gt;&lt;/p&gt;



</summary><category term="microsoft"/><category term="software-engineering"/><category term="vs-code"/></entry><entry><title>The End of Localhost</title><link href="https://simonwillison.net/2022/Jun/8/the-end-of-localhost/#atom-tag" rel="alternate"/><published>2022-06-08T18:09:23+00:00</published><updated>2022-06-08T18:09:23+00:00</updated><id>https://simonwillison.net/2022/Jun/8/the-end-of-localhost/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://dx.tips/the-end-of-localhost"&gt;The End of Localhost&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
swyx makes the argument for cloud-based development environments, and points out that many large companies—including Google, Facebook, Shopify and GitHub—have made the move already. I was responsible for the team maintaining the local development environment experience at Eventbrite for a while, and my conclusion is that with a large enough engineering team someone will ALWAYS find a new way to break their local environment: the idea of being able to bootstrap a fresh, guaranteed-to-work environment in the cloud at the click of a button could save SO much time and money.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/swyx"&gt;swyx&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/><category term="swyx"/></entry><entry><title>Contributing to Complex Projects</title><link href="https://simonwillison.net/2022/Mar/15/contributing-to-complex-projects/#atom-tag" rel="alternate"/><published>2022-03-15T06:09:16+00:00</published><updated>2022-03-15T06:09:16+00:00</updated><id>https://simonwillison.net/2022/Mar/15/contributing-to-complex-projects/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://mitchellh.com/writing/contributing-to-complex-projects"&gt;Contributing to Complex Projects&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Mitchell Hashimoto describes in detail his process for understanding and eventually contributing to a complex new codebase. I picked up a whole bunch of useful tips from this.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/mitchellh/status/1503402023428845571"&gt;@mitchellh&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mitchell-hashimoto"&gt;mitchell-hashimoto&lt;/a&gt;&lt;/p&gt;



</summary><category term="open-source"/><category term="software-engineering"/><category term="mitchell-hashimoto"/></entry><entry><title>How I build a feature</title><link href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#atom-tag" rel="alternate"/><published>2022-01-12T18:10:17+00:00</published><updated>2022-01-12T18:10:17+00:00</updated><id>https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#atom-tag</id><summary type="html">
    &lt;p&gt;I'm maintaining &lt;a href="https://github.com/simonw/simonw/blob/main/releases.md"&gt;a lot of different projects&lt;/a&gt; at the moment. I thought it would be useful to describe the process I use for adding a new feature to one of them, using the new &lt;a href="https://sqlite-utils.datasette.io/en/stable/cli.html#cli-create-database"&gt;sqlite-utils create-database&lt;/a&gt; command as an example.&lt;/p&gt;
&lt;p&gt;I like each feature to be represented by what I consider to be the &lt;strong&gt;perfect commit&lt;/strong&gt; - one that bundles together the implementation, the tests, the documentation and a link to an external issue thread.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 29th October 2022:&lt;/strong&gt; I wrote &lt;a href="https://simonwillison.net/2022/Oct/29/the-perfect-commit/"&gt;more about the perfect commit&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;sqlite-utils create-database&lt;/code&gt; command is very simple: it creates a new, empty SQLite database file. You use it like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;% sqlite-utils create-database empty.db
&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#everything-starts-with-an-issue"&gt;Everything starts with an issue&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#development-environment"&gt;Development environment&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#automated-tests"&gt;Automated tests&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#implementing-the-feature"&gt;Implementing the feature&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#code-formatting-with-black"&gt;Code formatting with Black&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#linting"&gt;Linting&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#documentation"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#committing-the-change"&gt;Committing the change&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#branches-and-pull-requests"&gt;Branches and pull requests&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#release-notes-and-a-release"&gt;Release notes, and a release&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#a-live-demo"&gt;A live demo&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#tell-the-world-about-it"&gt;Tell the world about it&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://simonwillison.net/2022/Jan/12/how-i-build-a-feature/#more-examples-of-this-pattern"&gt;More examples of this pattern&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id="everything-starts-with-an-issue"&gt;Everything starts with an issue&lt;/h4&gt;
&lt;p&gt;Every piece of work I do has an associated issue. This acts as ongoing work-in-progress notes and lets me record decisions, reference any research, drop in code snippets and sometimes even add screenshots and video - stuff that is really helpful but doesn't necessarily fit in code comments or commit messages.&lt;/p&gt;
&lt;p&gt;Even if it's a tiny improvement that's only a few lines of code, I'll still open an issue for it - sometimes just a few minutes before closing it again as complete.&lt;/p&gt;
&lt;p&gt;Any commits that I create that relate to an issue reference the issue number in their commit message. GitHub does a great job of automatically linking these together, bidirectionally so I can navigate from the commit to the issue or from the issue to the commit.&lt;/p&gt;
&lt;p&gt;Having an issue also gives me something I can link to from my release notes.&lt;/p&gt;
&lt;p&gt;In the case of the &lt;code&gt;create-database&lt;/code&gt; command, I opened &lt;a href="https://github.com/simonw/sqlite-utils/issues/348"&gt;this issue&lt;/a&gt; in November when I had the idea for the feature.&lt;/p&gt;
&lt;p&gt;I didn't do the work until over a month later - but because I had designed the feature in the issue comments I could get started on the implementation really quickly.&lt;/p&gt;
&lt;h4 id="development-environment"&gt;Development environment&lt;/h4&gt;
&lt;p&gt;Being able to quickly spin up a development environment for a project is crucial. All of my projects have a section in the README or the documentation describing how to do this - here's &lt;a href="https://sqlite-utils.datasette.io/en/stable/contributing.html"&gt;that section for sqlite-utils&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On my own laptop each project gets a directory, and I use &lt;code&gt;pipenv shell&lt;/code&gt; in that directory to activate a directory-specific virtual environment, then &lt;code&gt;pip install -e '.[test]'&lt;/code&gt; to install the dependencies and test dependencies.&lt;/p&gt;
&lt;h4 id="automated-tests"&gt;Automated tests&lt;/h4&gt;
&lt;p&gt;All of my features are accompanied by automated tests. This gives me the confidence to boldly make changes to the software in the future without fear of breaking any existing features.&lt;/p&gt;
&lt;p&gt;This means that writing tests needs to be as quick and easy as possible - the less friction here the better.&lt;/p&gt;
&lt;p&gt;The best way to make writing tests easy is to have a great testing framework in place from the very beginning of the project. My cookiecutter templates (&lt;a href="https://github.com/simonw/python-lib"&gt;python-lib&lt;/a&gt;, &lt;a href="https://github.com/simonw/datasette-plugin"&gt;datasette-plugin&lt;/a&gt; and &lt;a href="https://github.com/simonw/click-app"&gt;click-app&lt;/a&gt;) all configure &lt;a href="https://docs.pytest.org/"&gt;pytest&lt;/a&gt; and add a &lt;code&gt;tests/&lt;/code&gt; folder with a single passing test, to give me something to start adding tests to.&lt;/p&gt;
&lt;p&gt;I can't say enough good things about pytest. Before I adopted it, writing tests was a chore. Now it's an activity I genuinely look forward to!&lt;/p&gt;
&lt;p&gt;I'm not a religious adherent to writing the tests first - see &lt;a href="https://simonwillison.net/2020/Feb/11/cheating-at-unit-tests-pytest-black/"&gt;How to cheat at unit tests with pytest and Black&lt;/a&gt; for more thoughts on that - but I'll write the test first if it's pragmatic to do so.&lt;/p&gt;
&lt;p&gt;In the case of &lt;code&gt;create-database&lt;/code&gt;, writing the test first felt like the right thing to do. Here's the test I started with:&lt;/p&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;def&lt;/span&gt; &lt;span class="pl-en"&gt;test_create_database&lt;/span&gt;(&lt;span class="pl-s1"&gt;tmpdir&lt;/span&gt;):
    &lt;span class="pl-s1"&gt;db_path&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;tmpdir&lt;/span&gt; &lt;span class="pl-c1"&gt;/&lt;/span&gt; &lt;span class="pl-s"&gt;"test.db"&lt;/span&gt;
    &lt;span class="pl-k"&gt;assert&lt;/span&gt; &lt;span class="pl-c1"&gt;not&lt;/span&gt; &lt;span class="pl-s1"&gt;db_path&lt;/span&gt;.&lt;span class="pl-en"&gt;exists&lt;/span&gt;()
    &lt;span class="pl-s1"&gt;result&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-v"&gt;CliRunner&lt;/span&gt;().&lt;span class="pl-en"&gt;invoke&lt;/span&gt;(
        &lt;span class="pl-s1"&gt;cli&lt;/span&gt;.&lt;span class="pl-s1"&gt;cli&lt;/span&gt;, [&lt;span class="pl-s"&gt;"create-database"&lt;/span&gt;, &lt;span class="pl-en"&gt;str&lt;/span&gt;(&lt;span class="pl-s1"&gt;db_path&lt;/span&gt;)]
    )
    &lt;span class="pl-k"&gt;assert&lt;/span&gt; &lt;span class="pl-s1"&gt;result&lt;/span&gt;.&lt;span class="pl-s1"&gt;exit_code&lt;/span&gt; &lt;span class="pl-c1"&gt;==&lt;/span&gt; &lt;span class="pl-c1"&gt;0&lt;/span&gt;
    &lt;span class="pl-k"&gt;assert&lt;/span&gt; &lt;span class="pl-s1"&gt;db_path&lt;/span&gt;.&lt;span class="pl-en"&gt;exists&lt;/span&gt;()&lt;/pre&gt;
&lt;p&gt;This test uses the &lt;a href="https://docs.pytest.org/en/6.2.x/tmpdir.html#the-tmpdir-fixture"&gt;tmpdir pytest fixture&lt;/a&gt; to provide a temporary directory that will be automatically cleaned up by pytest after the test run finishes.&lt;/p&gt;
&lt;p&gt;It checks that the &lt;code&gt;test.db&lt;/code&gt; file doesn't exist yet, then uses the Click framework's &lt;a href="https://click.palletsprojects.com/en/8.0.x/testing/"&gt;CliRunner utility&lt;/a&gt; to execute the create-database command. Then it checks that the command didn't throw an error and that the file has been created.&lt;/p&gt;
&lt;p&gt;The I run the test, and watch it fail - because I haven't built the feature yet!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;% pytest -k test_create_database

============ test session starts ============
platform darwin -- Python 3.8.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/simon/Dropbox/Development/sqlite-utils
plugins: cov-2.12.1, hypothesis-6.14.5
collected 808 items / 807 deselected / 1 selected                           

tests/test_cli.py F                                                   [100%]

================= FAILURES ==================
___________ test_create_database ____________

tmpdir = local('/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/pytest-of-simon/pytest-659/test_create_database0')

    def test_create_database(tmpdir):
        db_path = tmpdir / "test.db"
        assert not db_path.exists()
        result = CliRunner().invoke(
            cli.cli, ["create-database", str(db_path)]
        )
&amp;gt;       assert result.exit_code == 0
E       assert 1 == 0
E        +  where 1 = &amp;lt;Result SystemExit(1)&amp;gt;.exit_code

tests/test_cli.py:2097: AssertionError
========== short test summary info ==========
FAILED tests/test_cli.py::test_create_database - assert 1 == 0
===== 1 failed, 807 deselected in 0.99s ====
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;-k&lt;/code&gt; option lets me run any test that match the search string, rather than running the full test suite. I use this all the time.&lt;/p&gt;
&lt;p&gt;Other pytest features I often use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pytest -x&lt;/code&gt;: runs the entire test suite but quits at the first test that fails&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pytest --lf&lt;/code&gt;: re-runs any tests that failed during the last test run&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pytest --pdb -x&lt;/code&gt;: open the Python debugger at the first failed test (omit the &lt;code&gt;-x&lt;/code&gt; to open it at every failed test). This is the main way I interact with the Python debugger. I often use this to help write the tests, since I can add &lt;code&gt;assert False&lt;/code&gt; and get a shell inside the test to interact with various objects and figure out how to best run assertions against them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="implementing-the-feature"&gt;Implementing the feature&lt;/h4&gt;
&lt;p&gt;Test in place, it's time to implement the command. I added this code to my existing &lt;a href="https://github.com/simonw/sqlite-utils/blob/3.20/sqlite_utils/cli.py"&gt;cli.py module&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;span class="pl-en"&gt;@&lt;span class="pl-s1"&gt;cli&lt;/span&gt;.&lt;span class="pl-en"&gt;command&lt;/span&gt;(&lt;span class="pl-s1"&gt;name&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;"create-database"&lt;/span&gt;)&lt;/span&gt;
&lt;span class="pl-en"&gt;@&lt;span class="pl-s1"&gt;click&lt;/span&gt;.&lt;span class="pl-en"&gt;argument&lt;/span&gt;(&lt;/span&gt;
&lt;span class="pl-en"&gt;    &lt;span class="pl-s"&gt;"path"&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-en"&gt;    &lt;span class="pl-s1"&gt;type&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-s1"&gt;click&lt;/span&gt;.&lt;span class="pl-v"&gt;Path&lt;/span&gt;(&lt;span class="pl-s1"&gt;file_okay&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;True&lt;/span&gt;, &lt;span class="pl-s1"&gt;dir_okay&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;False&lt;/span&gt;, &lt;span class="pl-s1"&gt;allow_dash&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;False&lt;/span&gt;),&lt;/span&gt;
&lt;span class="pl-en"&gt;    &lt;span class="pl-s1"&gt;required&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;True&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-en"&gt;)&lt;/span&gt;
&lt;span class="pl-k"&gt;def&lt;/span&gt; &lt;span class="pl-en"&gt;create_database&lt;/span&gt;(&lt;span class="pl-s1"&gt;path&lt;/span&gt;):
    &lt;span class="pl-s"&gt;"Create a new empty database file."&lt;/span&gt;
    &lt;span class="pl-s1"&gt;db&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;sqlite_utils&lt;/span&gt;.&lt;span class="pl-v"&gt;Database&lt;/span&gt;(&lt;span class="pl-s1"&gt;path&lt;/span&gt;)
    &lt;span class="pl-s1"&gt;db&lt;/span&gt;.&lt;span class="pl-en"&gt;vacuum&lt;/span&gt;()&lt;/pre&gt;
&lt;p&gt;(I happen to know that the quickest way to create an empty SQLite database file is to run &lt;code&gt;VACUUM&lt;/code&gt; against it.)&lt;/p&gt;
&lt;p&gt;The test now passes!&lt;/p&gt;
&lt;p&gt;I iterated on this implementation a little bit more, to add the &lt;code&gt;--enable-wal&lt;/code&gt; option I had designed &lt;a href="https://github.com/simonw/sqlite-utils/issues/348#issuecomment-983120066"&gt;in the issue comments&lt;/a&gt; - and updated the test to match. You can see the final implementation in this commit: &lt;a href="https://github.com/simonw/sqlite-utils/commit/1d64cd2e5b402ff957f9be2d9bb490d313c73989"&gt;1d64cd2e5b402ff957f9be2d9bb490d313c73989&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If I add a new test and it passes the first time, I’m always suspicious of it. I’ll deliberately break the test (change a 1 to a 2 for example) and run it again to make sure it fails, then change it back again.&lt;/p&gt;
&lt;h4 id="code-formatting-with-black"&gt;Code formatting with Black&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://github.com/psf/black"&gt;Black&lt;/a&gt; has increased my productivity as a Python developer by a material amount. I used to spend a whole bunch of brain cycles agonizing over how to indent my code, where to break up long function calls and suchlike. Thanks to Black I never think about this at all - I instinctively run &lt;code&gt;black .&lt;/code&gt; in the root of my project and accept whatever style decisions it applies for me.&lt;/p&gt;
&lt;h4 id="linting"&gt;Linting&lt;/h4&gt;
&lt;p&gt;I have a few linters set up to run on every commit. I can run these locally too - how to do that is &lt;a href="https://sqlite-utils.datasette.io/en/stable/contributing.html#linting-and-formatting"&gt;documented here&lt;/a&gt; - but I'm often a bit lazy and leave them to &lt;a href="https://github.com/simonw/sqlite-utils/blob/main/.github/workflows/test.yml"&gt;run in CI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this case one of my linters failed! I accidentally called the new command function &lt;code&gt;create_table()&lt;/code&gt; when it should have been called &lt;code&gt;create_database()&lt;/code&gt;. The code worked fine due to how the &lt;code&gt;cli.command(name=...)&lt;/code&gt; decorator works but &lt;code&gt;mypy&lt;/code&gt; &lt;a href="https://github.com/simonw/sqlite-utils/runs/4754944593?check_suite_focus=true"&gt;complained about&lt;/a&gt; the redefined function name. I fixed that in &lt;a href="https://github.com/simonw/sqlite-utils/commit/2f8879235afc6a06a8ae25ded1b2fe289ad8c3a6#diff-76294b3d4afeb27e74e738daa01c26dd4dc9ccb6f4477451483a2ece1095902e"&gt;a separate commit&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="documentation"&gt;Documentation&lt;/h4&gt;
&lt;p&gt;My policy these days is that if a feature isn't documented it doesn't exist. Updating existing documentation isn't much work at all if the documentation already exists, and over time these incremental improvements add up to something really comprehensive.&lt;/p&gt;
&lt;p&gt;For smaller projects I use a single &lt;code&gt;README.md&lt;/code&gt; which gets displayed on both GitHub and PyPI (and the Datasette website too, for example on &lt;a href="https://datasette.io/tools/git-history"&gt;datasette.io/tools/git-history&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;My larger projects, such as &lt;a href="https://docs.datasette.io/"&gt;Datasette&lt;/a&gt; and &lt;a href="https://sqlite-utils.datasette.io/"&gt;sqlite-utils&lt;/a&gt;, use &lt;a href="https://readthedocs.org/"&gt;Read the Docs&lt;/a&gt; and &lt;a href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html"&gt;reStructuredText&lt;/a&gt; with &lt;a href="https://www.sphinx-doc.org/"&gt;Sphinx&lt;/a&gt; instead.&lt;/p&gt;
&lt;p&gt;I like reStructuredText mainly because it has really good support for internal reference links - something that is missing from Markdown, though it can be enabled using &lt;a href="https://myst-parser.readthedocs.io"&gt;MyST&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sqlite-utils&lt;/code&gt; uses Sphinx. I have the &lt;a href="https://github.com/executablebooks/sphinx-autobuild"&gt;sphinx-autobuild&lt;/a&gt; extension configured, which means I can run a live reloading server with the documentation like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd docs
make livehtml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any time I'm working on the documentation I have that server running, so I can hit "save" in VS Code and see a preview in my browser a few seconds later.&lt;/p&gt;
&lt;p&gt;For Markdown documentation I use the VS Code preview pane directly.&lt;/p&gt;
&lt;p&gt;The moment the documentation is live online, I like to add a link to it in a comment on the issue thread.&lt;/p&gt;
&lt;h4 id="committing-the-change"&gt;Committing the change&lt;/h4&gt;
&lt;p&gt;I run &lt;code&gt;git diff&lt;/code&gt; a LOT while hacking on code, to make sure I haven’t accidentally changed something unrelated. This also helps spot things like rogue &lt;code&gt;print()&lt;/code&gt; debug statements I may have added.&lt;/p&gt;
&lt;p&gt;Before my final commit, I sometimes even run &lt;code&gt;git diff | grep print&lt;/code&gt; to check for those.&lt;/p&gt;
&lt;p&gt;My goal with the commit is to bundle the test, documentation and implementation. If those are the only files I've changed I do this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git commit -a -m "sqlite-utils create-database command, closes #348"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If this completes the work on the issue I use "&lt;code&gt;closes #N&lt;/code&gt;", which causes GitHub to close the issue for me. If it's not yet ready to close I use "&lt;code&gt;refs #N&lt;/code&gt;" instead.&lt;/p&gt;
&lt;p&gt;Sometimes there will be unrelated changes in my working directory. If so, I use &lt;code&gt;git add &amp;lt;files&amp;gt;&lt;/code&gt; and then commit just with &lt;code&gt;git commit -m message&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id="branches-and-pull-requests"&gt;Branches and pull requests&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;create-database&lt;/code&gt; is a good example of a feature that can be implemented in a single commit, with no need to work in a branch.&lt;/p&gt;
&lt;p&gt;For larger features, I'll work in a feature branch:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git checkout -b my-feature
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I'll make a commit (often just labelled "WIP prototype, refs #N") and then push that to GitHub and open a pull request for it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git push -u origin my-feature 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I ensure the new pull request links back to the issue in its description, then switch my ongoing commentary to comments on the pull request itself.&lt;/p&gt;
&lt;p&gt;I'll sometimes add a task checklist to the opening comment on the pull request, since tasks there get reflected in the GitHub UI anywhere that links to the PR. Then I'll check those off as I complete them.&lt;/p&gt;
&lt;p&gt;An example of a PR I used like this is &lt;a href="https://github.com/simonw/sqlite-utils/pull/361"&gt;#361: --lines and --text and --convert and --import&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I don't like merge commits - I much prefer to keep my &lt;code&gt;main&lt;/code&gt; branch history as linear as possible. I usually merge my PRs through the GitHub web interface using the squash feature, which results in a single, clean commit to main with the combined tests, documentation and implementation. Occasionally I will see value in keeping the individual commits, in which case I will rebase merge them.&lt;/p&gt;
&lt;p&gt;Another goal here is to keep the &lt;code&gt;main&lt;/code&gt; branch releasable at all times. Incomplete work should stay in a branch. This makes turning around and releasing quick bug fixes a lot less stressful!&lt;/p&gt;
&lt;h4 id="release-notes-and-a-release"&gt;Release notes, and a release&lt;/h4&gt;
&lt;p&gt;A feature isn't truly finished until it's been released to &lt;a href="https://pypi.org/"&gt;PyPI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;All of my projects are configured the same way: they use GitHub releases to trigger a GitHub Actions workflow which publishes the new release to PyPI. The &lt;code&gt;sqlite-utils&lt;/code&gt; workflow for that &lt;a href="https://github.com/simonw/sqlite-utils/blob/main/.github/workflows/publish.yml"&gt;is here in publish.yml&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;My &lt;a href="https://cookiecutter.readthedocs.io/"&gt;cookiecutter&lt;/a&gt; templates for new projects set up this workflow for me. I just need to create a PyPI token for the project and assign it as a repository secret. See the &lt;a href="https://github.com/simonw/python-lib"&gt;python-lib cookiecutter README&lt;/a&gt; for details.&lt;/p&gt;
&lt;p&gt;To push out a new release, I need to increment the version number in &lt;a href="https://github.com/simonw/sqlite-utils/blob/main/setup.py"&gt;setup.py&lt;/a&gt; and write the release notes.&lt;/p&gt;
&lt;p&gt;I use &lt;a href="https://semver.org/"&gt;semantic versioning&lt;/a&gt; - a new feature is a minor version bump, a breaking change is a major version bump (I try very hard to avoid these) and a bug fix or documentation-only update is a patch increment.&lt;/p&gt;
&lt;p&gt;Since &lt;code&gt;create-database&lt;/code&gt; was a new feature, it went out in &lt;a href="https://github.com/simonw/sqlite-utils/releases/3.21"&gt;release 3.21&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;My projects that use Sphinx for documentation have &lt;a href="https://github.com/simonw/sqlite-utils/blob/main/docs/changelog.rst"&gt;changelog.rst&lt;/a&gt; files in their repositories. I add the release notes there, linking to the relevant issues and cross-referencing the new documentation. Then I ship a commit that bundles the release notes with the bumped version number, with a commit message that looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git commit -m "Release 3.21

Refs #348, #364, #366, #368, #371, #372, #374, #375, #376, #379"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here's &lt;a href="https://github.com/simonw/sqlite-utils/commit/7c637b11805adc3d3970076a7ba6afe8e34b371e"&gt;the commit for release 3.21&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Referencing the issue numbers in the release automatically adds a note to their issue threads indicating the release that they went out in.&lt;/p&gt;
&lt;p&gt;I generate that list of issue numbers by pasting the release notes into an Observable notebook I built for the purpose: &lt;a href="https://observablehq.com/@simonw/extract-issue-numbers-from-pasted-text"&gt;Extract issue numbers from pasted text&lt;/a&gt;. Observable is really great for building this kind of tiny interactive utility.&lt;/p&gt;
&lt;p&gt;For projects that just have a README I write the release notes in Markdown and paste them directly into the GitHub "new release" form.&lt;/p&gt;
&lt;p&gt;I like to duplicate the release notes to GiHub releases for my Sphinx changelog projects too. This is mainly so the &lt;a href="https://datasette.io/"&gt;datasette.io&lt;/a&gt; website will display the release notes on its homepage, which is populated &lt;a href="https://simonwillison.net/2020/Dec/13/datasette-io/"&gt;at build time&lt;/a&gt; using the GitHub GraphQL API.&lt;/p&gt;
&lt;p&gt;To convert my reStructuredText to Markdown I copy and paste the rendered HTML into this brilliant &lt;a href="https://euangoddard.github.io/clipboard2markdown/"&gt;Paste to Markdown&lt;/a&gt; tool by &lt;a href="https://github.com/euangoddard"&gt;Euan Goddard&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="a-live-demo"&gt;A live demo&lt;/h4&gt;
&lt;p&gt;When possible, I like to have a live demo that I can link to.&lt;/p&gt;
&lt;p&gt;This is easiest for features in Datasette core. Datesette’s main branch gets &lt;a href="https://github.com/simonw/datasette/blob/0.60a1/.github/workflows/deploy-latest.yml#L51-L73"&gt;deployed automatically&lt;/a&gt; to &lt;a href="https://latest.datasette.io/"&gt;latest.datasette.io&lt;/a&gt; so I can often link to a demo there.&lt;/p&gt;
&lt;p&gt;For Datasette plugins, I’ll deploy a fresh instance with the plugin (e.g. &lt;a href="https://datasette-graphql-demo.datasette.io/"&gt;this one for datasette-graphql&lt;/a&gt;) or (more commonly) add it to my big &lt;a href="https://latest-with-plugins.datasette.io/"&gt;latest-with-plugins.datasette.io&lt;/a&gt; instance - which tries to demonstrate what happens to Datasette if you install dozens of plugins at once (so far it works OK).&lt;/p&gt;
&lt;p&gt;Here’s a demo of the &lt;a href="https://datasette.io/plugins/datasette-copyable"&gt;datasette-copyable plugin&lt;/a&gt; running there:  &lt;a href="https://latest-with-plugins.datasette.io/github/commits.copyable"&gt;https://latest-with-plugins.datasette.io/github/commits.copyable&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="tell-the-world-about-it"&gt;Tell the world about it&lt;/h4&gt;
&lt;p&gt;The last step is to tell the world (beyond the people who meticulously read the release notes) about the new feature.&lt;/p&gt;
&lt;p&gt;Depending on the size of the feature, I might do this with a tweet &lt;a href="https://twitter.com/simonw/status/1455266746701471746"&gt;like this one&lt;/a&gt; - usually with a screenshot and a link to the documentation. I often extend this into a short Twitter thread, which gives me a chance to link to related concepts and demos or add more screenshots.&lt;/p&gt;
&lt;p&gt;For larger or more interesting feature I'll blog about them. I may save this for my weekly &lt;a href="https://simonwillison.net/tags/weeknotes/"&gt;weeknotes&lt;/a&gt;, but sometimes for particularly exciting features I'll write up a dedicated blog entry. Some examples include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2020/Sep/23/sqlite-advanced-alter-table/"&gt;Executing advanced ALTER TABLE operations in SQLite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2020/Jul/30/fun-binary-data-and-sqlite/"&gt;Fun with binary data and SQLite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2020/Sep/23/sqlite-utils-extract/"&gt;Refactoring databases with sqlite-utils extract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2021/Jun/19/sqlite-utils-memory/"&gt;Joining CSV and JSON data with an in-memory SQLite database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2021/Aug/6/sqlite-utils-convert/"&gt;Apply conversion functions to data in SQLite columns with the sqlite-utils CLI tool&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I may even assemble a full set of &lt;a href="https://simonwillison.net/tags/annotatedreleasenotes/"&gt;annotated release notes&lt;/a&gt; on my blog, where I quote each item from the release in turn and provide some fleshed out examples plus background information on why I built it.&lt;/p&gt;
&lt;p&gt;If it’s a new Datasette (or Datasette-adjacent) feature, I’ll try to remember to write about it in the next edition of the &lt;a href="https://datasette.substack.com/"&gt;Datasette Newsletter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Finally, if I learned a new trick while building a feature I might extract that into &lt;a href="https://til.simonwillison.net/"&gt;a TIL&lt;/a&gt;. If I do that I'll link to the new TIL from the issue thread.&lt;/p&gt;
&lt;h4 id="more-examples-of-this-pattern"&gt;More examples of this pattern&lt;/h4&gt;
&lt;p&gt;Here are a bunch of examples of commits that implement this pattern, combining the tests, implementation and documentation into a single unit:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;sqlite-utils: &lt;a href="https://github.com/simonw/sqlite-utils/commit/324ebc31308752004fe5f7e4941fc83706c5539c"&gt;adding —limit and —offset to sqlite-utils rows&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;sqlite-utils: &lt;a href="https://github.com/simonw/sqlite-utils/commit/d83b2568131f2b1cc01228419bb08c96d843d65d"&gt;--where and -p options for sqlite-utils convert&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;s3-credentials: &lt;a href="https://github.com/simonw/s3-credentials/commit/905258379817e8b458528e4ccc5e6cc2c8cf4352"&gt;s3-credentials policy command&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;datasette: &lt;a href="https://github.com/simonw/datasette/commit/5cadc244895fc47e0534c6e90df976d34293921e"&gt;db.execute_write_script() and db.execute_write_many()&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;datasette: &lt;a href="https://github.com/simonw/datasette/commit/992496f2611a72bd51e94bfd0b17c1d84e732487"&gt;?_nosuggest=1 parameter for table views&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;datasette-graphql: &lt;a href="https://github.com/simonw/datasette-graphql/commit/2d8c042e93e3429c5b187121d26f8817997073dd"&gt;GraphQL execution limits: time_limit_ms and num_queries_limit&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/git"&gt;git&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github"&gt;github&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/testing"&gt;testing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pytest"&gt;pytest&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/black"&gt;black&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/read-the-docs"&gt;read-the-docs&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github-issues"&gt;github-issues&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="git"/><category term="github"/><category term="software-engineering"/><category term="testing"/><category term="pytest"/><category term="black"/><category term="read-the-docs"/><category term="github-issues"/></entry><entry><title>PAGNIs: Probably Are Gonna Need Its</title><link href="https://simonwillison.net/2021/Jul/1/pagnis/#atom-tag" rel="alternate"/><published>2021-07-01T19:13:58+00:00</published><updated>2021-07-01T19:13:58+00:00</updated><id>https://simonwillison.net/2021/Jul/1/pagnis/#atom-tag</id><summary type="html">
    &lt;p&gt;Luke Page has a great post up with &lt;a href="https://lukeplant.me.uk/blog/posts/yagni-exceptions/"&gt;his list of YAGNI exceptions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;YAGNI - You Ain't Gonna Need It - is a rule that says you shouldn't add a feature just because it might be useful in the future - only write code when it solves a direct problem.&lt;/p&gt;
&lt;p&gt;When should you over-ride YAGNI? When the cost of adding something later is so dramatically expensive compared with the cost of adding it early on that it's worth taking the risk. On when you know from experience that an initial investment will pay off many times over.&lt;/p&gt;
&lt;p&gt;Lukes's exceptions to YAGNI are well chosen: things like logging, API versioning, created_at timestamps and a bias towards "store multiple X for a user" (a many-to-many relationship) if there's any inkling that the system may need to support more than one.&lt;/p&gt;
&lt;p&gt;Because I like attempting to coin phrases, I propose we call these &lt;strong&gt;PAGNIs&lt;/strong&gt; - short for &lt;strong&gt;Probably Are Gonna Need Its&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here are some of mine.&lt;/p&gt;
&lt;h4&gt;A kill-switch for your mobile apps&lt;/h4&gt;
&lt;p&gt;If you're building a mobile app that talks to your API, make sure to ship a kill-switch: a mechanism by which you can cause older versions of the application to show a "you must upgrade to continue using this application" screen when the app starts up.&lt;/p&gt;
&lt;p&gt;In an ideal world, you'll never use this ability: you'll continue to build new features to the app and make backwards-compatible changes to the API forever, such that ancient app versions keep working and new app versions get to do new things.&lt;/p&gt;
&lt;p&gt;But... sometimes that simply isn't possible. You might discover a security hole in the design of the application or API that can only be fixed by breaking backwards-compatibility - or maybe you're still maintaining a v1 API from five years ago to support a mobile application version that's only still installed by 30 users, and you'd like to not have to maintain double the amount of API code.&lt;/p&gt;
&lt;p&gt;You can't add a kill-switch retroactively to apps that have already been deployed!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/myunderpants/status/1410655652867809281"&gt;Apparently Firebase offers this&lt;/a&gt; to many Android apps, but if you're writing for iOS you need to provide this yourself.&lt;/p&gt;
&lt;h4&gt;Automated deploys&lt;/h4&gt;
&lt;p&gt;Nothing kills a side project like coming back to it in six months time and having to figure out how to deploy it again. Thanks to &lt;a href="https://simonwillison.net/tags/githubactions/"&gt;GitHub Actions&lt;/a&gt; and hosting providers like Google Cloud Run, Vercel, Heroku and Netlify setting up automated deployments is way easier now than it used to be. I have enough examples now that getting automated deployments working for a new project usually only takes a few minutes, and it pays off instantly.&lt;/p&gt;
&lt;h4&gt;Continuous Integration (and a test framework)&lt;/h4&gt;
&lt;p&gt;Similar to automated deployment in that GitHub Actions (and Circle CI and Travis before it) make this much less painful to setup than it used to be.&lt;/p&gt;
&lt;p&gt;Introducing a test framework to an existing project can be extremely painful. Introducing it at the very start is easy - and it sets a precedent that code should be tested from day one.&lt;/p&gt;
&lt;p&gt;These days I'm all about &lt;a href="https://simonwillison.net/tags/pytest/"&gt;pytest&lt;/a&gt;, and I have various cookiecutter templates (&lt;a href="https://github.com/simonw/datasette-plugin"&gt;datasette-plugin&lt;/a&gt;, &lt;a href="https://github.com/simonw/click-app"&gt;click-app&lt;/a&gt;, &lt;a href="https://github.com/simonw/python-lib"&gt;python-lib&lt;/a&gt;) that configure it on my new projects (with a passing test) out of the box.&lt;/p&gt;
&lt;p&gt;(Honestly, at this point in my career I consider continuous integration a DAGNI - Definitely Are Gonna Need It.)&lt;/p&gt;
&lt;p&gt;One particularly worthwhile trick is making sure the tests can spin up their own isolated test databases - another thing which is pretty easy to setup early (Django does this for you) and harder to add later on. I extend that to other external data stores - I once put a significant amount of effort into setting up a mechanism for running tests against Elasticsearch and clearing out the data again afterwards, and it paid off multiple times over.&lt;/p&gt;
&lt;p&gt;Even better: &lt;strong&gt;continuous deployment&lt;/strong&gt;! When the tests pass, deploy. If you have automated deployment setup already adding this is pretty easy, and doing it from the very start of a project sets a strong cultural expectation that no-one will land code to the &lt;code&gt;main&lt;/code&gt; branch until it's in a production-ready state and covered by unit tests.&lt;/p&gt;
&lt;p&gt;(If continuous deployment to production is too scary for your project, a valuable middle-ground is continuous deployment to a staging environment. Having everyone on your team able to interact with a live demo of your current main branch is a huge group productivity boost.)&lt;/p&gt;
&lt;h4&gt;API pagination&lt;/h4&gt;
&lt;p&gt;Never build an API endpoint that isn't paginated. Any time you think "there will never be enough items in this list for it to be worth pagination" one of your users will prove you wrong.&lt;/p&gt;
&lt;p&gt;This can be as simple as shipping an API which, even though it only returns a single page, has hard-coded JSON that looks like this:&lt;/p&gt;
&lt;div class="highlight highlight-source-json"&gt;&lt;pre&gt;{
  &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;results&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: [
    {&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;id&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-c1"&gt;1&lt;/span&gt;, &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;name&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;One&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;},
    {&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;id&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-c1"&gt;2&lt;/span&gt;, &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;name&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Two&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;},
    {&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;id&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-c1"&gt;3&lt;/span&gt;, &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;name&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Three&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;}
  ],
  &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;next_url&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-c1"&gt;null&lt;/span&gt;
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But make sure you leave space for the pagination information! You'll regret it if you don't.&lt;/p&gt;
&lt;h4&gt;Detailed API logs&lt;/h4&gt;
&lt;p&gt;This is a trick I learned &lt;a href="https://simonwillison.net/2021/Apr/12/porting-vaccinateca-to-django/#value-of-api-logs"&gt;while porting VaccinateCA to Django&lt;/a&gt;. If you are building an API, having a mechanism that provides detailed logs - including the POST bodies passed to the API - is invaluable.&lt;/p&gt;
&lt;p&gt;It's an inexpensive way of maintaining a complete record of what happened with your application - invaluable for debugging, but also for tricks like replaying past API traffic against a new implementation under test.&lt;/p&gt;
&lt;p&gt;Logs like these may become infeasible at scale, but for a new project they'll probably add up to just a few MBs a day - and they're easy to prune or switch off later on if you need to.&lt;/p&gt;
&lt;p&gt;VIAL uses &lt;a href="https://github.com/CAVaccineInventory/vial/blob/a0780e27c39018b66f95278ce18eda5968c325f8/vaccinate/api/utils.py#L86"&gt;a Django view decorator&lt;/a&gt; to log these directly to a PostgreSQL table. We've been running this for a few months and it's now our largest table, but it's still only around 2GB - easily worth it for the productivity boost it gives us.&lt;/p&gt;
&lt;p&gt;(Don't log any sensitive data that you wouldn't want your development team having access to while debugging a problem. This may require clever redaction, or you can avoid logging specific endpoints entirely. Also: don't log authentication tokens that could be used to imitate users: decode them and log the user identifier instead.)&lt;/p&gt;
&lt;h4&gt;A bookmarkable interface for executing read-only SQL queries against your database&lt;/h4&gt;
&lt;p&gt;This one is very much exposing my biases (I just released &lt;a href="https://django-sql-dashboard.datasette.io/"&gt;Django SQL Dashboard 1.0&lt;/a&gt; which provides exactly this for Django+PosgreSQL projects) but having used this for the past few months I can't see myself going back. Using bookmarked SQL queries to inform the implementation of new features is an incredible productivity boost. Here's &lt;a href="https://github.com/CAVaccineInventory/vial/issues/528"&gt;an issue I worked on&lt;/a&gt; recently with 18 comments linking to illustrative SQL queries.&lt;/p&gt;
&lt;p&gt;(On further thought: this isn't actually a great example of a PAGNI because it's not particularly hard to add this to a project at a later date.)&lt;/p&gt;
&lt;h4&gt;Driving down the cost&lt;/h4&gt;
&lt;p&gt;One trick with all of these things is that while they may seem quite expensive to implement, they get dramatically cheaper as you gain experience and gather more tools for helping put them into practice.&lt;/p&gt;
&lt;p&gt;Any of the ideas I've shown here could take an engineering team weeks (if not months) to add to an existing project - but with the right tooling they can represent just an hour (or less) work at the start of a project. And they'll pay themselves off many, many times over in the future.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/continuous-deployment"&gt;continuous-deployment&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/continuous-integration"&gt;continuous-integration&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/definitions"&gt;definitions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/testing"&gt;testing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pytest"&gt;pytest&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github-actions"&gt;github-actions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django-sql-dashboard"&gt;django-sql-dashboard&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/yagni"&gt;yagni&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pagni"&gt;pagni&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="continuous-deployment"/><category term="continuous-integration"/><category term="definitions"/><category term="software-engineering"/><category term="testing"/><category term="pytest"/><category term="github-actions"/><category term="django-sql-dashboard"/><category term="yagni"/><category term="pagni"/></entry><entry><title>YAGNI exceptions</title><link href="https://simonwillison.net/2021/Jul/1/yagni-exceptions/#atom-tag" rel="alternate"/><published>2021-07-01T18:30:24+00:00</published><updated>2021-07-01T18:30:24+00:00</updated><id>https://simonwillison.net/2021/Jul/1/yagni-exceptions/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://lukeplant.me.uk/blog/posts/yagni-exceptions/"&gt;YAGNI exceptions&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Luke Plant provides his collection of things that you probably ARE going to need in a project, where adding them later is painful enough that it’s worth the up-front investment. I really like these as a concept, and I’m coining the term PAGNI—for Probably Are Gonna Need It—to describe them.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/spookylukey/status/1409967250426281984"&gt;@spookylukey&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/luke-plant"&gt;luke-plant&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/yagni"&gt;yagni&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pagni"&gt;pagni&lt;/a&gt;&lt;/p&gt;



</summary><category term="luke-plant"/><category term="software-engineering"/><category term="yagni"/><category term="pagni"/></entry><entry><title>Quoting Paul Smith</title><link href="https://simonwillison.net/2021/Feb/22/paul-smith/#atom-tag" rel="alternate"/><published>2021-02-22T20:34:00+00:00</published><updated>2021-02-22T20:34:00+00:00</updated><id>https://simonwillison.net/2021/Feb/22/paul-smith/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://adhocteam.us/2017/10/10/stop-your-business-rules-engines/"&gt;&lt;p&gt;Business rules engines are li’l Conway’s Law devices: a manifestation of the distrust between stakeholders, client and contractor. We require BREs so that separate business units need not talk to each other to solve problems. They are communication and organizational dysfunction made silicon.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://adhocteam.us/2017/10/10/stop-your-business-rules-engines/"&gt;Paul Smith&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;&lt;/p&gt;



</summary><category term="software-engineering"/></entry><entry><title>Software Sprawl, The Golden Path, and Scaling Teams With Agency</title><link href="https://simonwillison.net/2018/Dec/2/the-golden-path/#atom-tag" rel="alternate"/><published>2018-12-02T19:40:33+00:00</published><updated>2018-12-02T19:40:33+00:00</updated><id>https://simonwillison.net/2018/Dec/2/the-golden-path/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://charity.wtf/2018/12/02/software-sprawl-the-golden-path-and-scaling-teams-with-agency/"&gt;Software Sprawl, The Golden Path, and Scaling Teams With Agency&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
This is smart: the "golden path" approach to encouraging a standard stack within a large engineering organization. If you build using the components on the golden path you get guaranteed ongoing support and as much free monitoring/tooling as can possibly be provided. I also really like the suggestion that this should be managed by a "council" of senior engineers with one member of the council rotated out every quarter to keep things from getting stale and cabal-like.&lt;/p&gt;
&lt;p&gt;Charity Majors describes the process like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Assemble a small council of trusted senior engineers.&lt;/li&gt;
&lt;li&gt;Task them with creating a recommended list of default components for developers to use when building out new services. This will be your Golden Path, the path of convergence (and the path of least resistance).&lt;/li&gt;
&lt;li&gt;Tell all your engineers that going forward, &lt;strong&gt;the Golden Path will be fully supported by the org.&lt;/strong&gt; Upgrades, patches, security fixes; backups, monitoring, build pipeline; deploy tooling, artifact versioning, development environment, even tier 1 on call support. Pave the path with gold. Nobody HAS to use these components ... but if they don't, they're on their own. They will have to support it themselves. [...]&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/mipsytipsy/status/1069260988812161025"&gt;Charity Majors&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/collaboration"&gt;collaboration&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charity-majors"&gt;charity-majors&lt;/a&gt;&lt;/p&gt;



</summary><category term="collaboration"/><category term="software-engineering"/><category term="charity-majors"/></entry><entry><title>Quoting Will Larson</title><link href="https://simonwillison.net/2018/Apr/23/will-larson/#atom-tag" rel="alternate"/><published>2018-04-23T15:03:37+00:00</published><updated>2018-04-23T15:03:37+00:00</updated><id>https://simonwillison.net/2018/Apr/23/will-larson/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://lethain.com/migrations/"&gt;&lt;p&gt;Migrations are both essential and frustratingly frequent as your codebase ages and your business grows: most tools and processes only support about one order of magnitude of growth before becoming ineffective, so rapid growth makes them a way of life. [...] As a result you switch tools a lot, and your ability to migrate to new software can easily become the defining constraint for your overall velocity. [...] Migrations matter because they are usually the only available avenue to make meaningful progress on technical debt.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://lethain.com/migrations/"&gt;Will Larson&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/migrations"&gt;migrations&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/software-engineering"&gt;software-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/will-larson"&gt;will-larson&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/technical-debt"&gt;technical-debt&lt;/a&gt;&lt;/p&gt;



</summary><category term="migrations"/><category term="software-engineering"/><category term="will-larson"/><category term="technical-debt"/></entry></feed>