Suppose you are implementing some complex piece of software — a database, a word processor, a filesystem, a web browser, whatever. How do you get st

How to write complex software

submited by
Style Pass
2025-01-02 23:30:03

Suppose you are implementing some complex piece of software — a database, a word processor, a filesystem, a web browser, whatever. How do you get started? How do you actually organize the code?

This post attempts to lay out a general method for approaching this problem with some specific techniques and guiding heuristics.

Developing complex software is really different than small software. If your whole program can fit in under 5000 lines or so, you'll often be best served by a single giant file with minimal abstractions.

Minimal abstraction means making changes will often involve mutating a lot of code, the total amount of code in the whole project is small, so this is fine.

When working on a large project, one that is unavoidably tens or hundreds of thousands of lines of code, this strategy does not work, and abstraction and organization is needed.

If we're writing a database, let's create a mock request and test just how many requests per second we can parse in the best case scenario? How many small reads and writes can our disk handle? How many checksums can your CPU compute per second?

Leave a Comment