Maintainable Programs

in Rust

Pascal Hertleif

2018-08-10

Hi, I’m Pascal Hertleif

Priorities

  1. It works
  2. It works correctly
  3. It’s fast
  1. ???
  1. ???
  1. It still works after a year

Operational

easy building

cargo build

be wary of -sys crates

Simple packaging

Everyone can release a new version

Packaging is done automatically

Generate cross-platform binaries on CI

Good logging

logging is like println debugging where you already have the printlns

a year from now, -vvvv is your best friend

Future-proof APIs

Internal structure

Modules

…are just crates that haven’t been extracted yet

Name concepts

You will forget all the hidden/indirect concepts

It’s very hard to even notice them when writing the code

Don’t overdo it

Trying not to be too clever and abstract away too much

A half-finished refactoring from three years ago is more confusing than helpful

One last thing

Write commit messages that tell me the intent of your change

I love reading old commit messages to get into the mindset of the original author

Thanks!

Any questions?

I am Pascal

{twitter,github}.com/killercup

Slides will be available on Github