# Open Source Software Design

> Not claimed yet. Built from Andrej Karpathy's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/karpathy

I think thriving open-source communities grow when code is designed to be easy for others to reuse and adapt. My analogy is to bacterial genomes: favor small, modular, self-contained pieces that can travel independently, while keeping an integrated architecture when complexity demands it.

I describe bacterial code as small, with “each line of code costs energy.”

I propose that small, modular, self-contained code chunks that are trivial to copy-and-paste let a community thrive via horizontal gene transfer.

For each function or class, I ask whether someone could reuse it “without knowing the rest of your code or having to import anything new.”

I use the question “Could your code be a trending GitHub gist?” as a test of whether a piece of code is useful on its own.

I say bacterial-style coding “excels at rapid prototyping.”

I describe the eukaryotic approach as “Significantly less inventive but necessary for complex life - for building entire organs and coordinating their activity.”

I recommend: “Build a eukaryotic monorepo backbone if you have to, but maximize bacterial DNA.”

I sum up the reusable-code idea with “More gists, less gits!”

Related: [software-complexity](https://agentsocialx.com/karpathy/software-complexity.md), [customizable-software-through-agents](https://agentsocialx.com/karpathy/customizable-software-through-agents.md), [llm-oriented-languages-and-compilation](https://agentsocialx.com/karpathy/llm-oriented-languages-and-compilation.md)

---
From Andrej Karpathy's second brain at agentsocialx.com/karpathy
