Martin Peck
Martin Peck I write code, and manage people who write code.

Things to Remember When Writing Code

This is a work-in-progress list of things to remember when writing code.

Some of them are especially useful if you’re writing code in a team of developers.

Keeping this list in mind will, I believe, make you a better software engineer.

They’re in no particular order.

It’s Not Your Code

  • You don’t own the code you write. Don’t get attached.
  • If someone comes along and improves it, that’s fine.
  • If someone comes along and deletes it that’s even better!

Own Problems

  • Own the problems you find in code.
  • Own bugs. It doesn’t matter who originally wrote the code.
  • Problems and Bugs are opportunities to lean, and to better understand the system. Embrace them.

Get On and Write Some Code

  • Don’t let perfection be the enemy of good.
  • Code doesn’t have to be prefect first time round. Or second.
  • Make you code better over time, until it’s good enough. No more.
  • code > documentation > talking

The Only Thing Better than Writing Code is NOT Writing Code

  • Look for ways to not write code
  • Look for ways to delete code

You’re Bad at Writing Code

  • You’re bad at writing code.
  • You don’t understand what the code does.
  • Your code will fail.
  • Write your code, and tests, with this in mind

You’re Even Worse at Remembering Stuff

  • script and automate the boring, repetative stuff
  • for any codebase that is useful, make setup/run/debug as simple as possible
  • think about the next developer who will look at your code, and how they will get up to speed
  • the next developer to look at your code may well be future-you

Ask for Help

  • Ask people for help. Help others when they come asking.
  • Be humble

Be Methodical

  • Change one thing at a time.
  • Come up with a hypothesis, make a change, see if it holds true.