Useful or amusing computer-y advice I’ve found on the internet.
- Code is a liability, what the code does is an asset
- Dumb code is smart code
- The Grug Brained Developer
- Kernighan’s Law
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
- Repeat yourself, do more than one thing, and rewrite everything
- Write code that’s easy to delete, and easy to debug too.
- Why bad scientific code beats code following “best practices”
- Use
assert()
- Follow the not rocket-science rule of software engineering and codify all checks that can be automated into CI tasks (e.g. linting, style rules, tests)
- Only once this rule is in place can you ensure that changes that don’t meet the constraints/properties of the project are rejected
- You can even enforce properties outside of the code with unit tests, e.g. documentation unit tests
- Use data-oriented design
- What data is actually needed for the program? What minimal set of transformations are required to solve the problem?
- Storing data relationally (column-oriented) is often more data oriented than OOP.
- CppCon 2014: Mike Acton “Data-Oriented Design and C++”
- Andrew Kelley - Practical DOD
- Data-oriented design book
- A relational data model is useful for most problems
- Programmer as wizard, programmer as engineer
- Different extremes of handling failures robustly: The Erlang approach or the mission critical approach
- The Erlang approach: Let it Crash
- Write the happy path, plan for failure. Minimize blast radius and restart subcomponents needed.
- The Mission Critical approach: Clean-room design, test everything, simulate the heck out of it, use formal verification
- The Erlang approach: Let it Crash
- Parsing
- Performance
- I hate slow software. Modern computers feel sluggish because they don’t optimize for low latency user input and response.
- Property-based testing
- Programming sucks
- John Carmack on inlined code
- Handles are the better pointers
- Friday deploy freezes are exactly like murdering puppies
- A Research Codebase Manifesto
- Game feel