I know I fixed this bug before. But how?

Gandalf: I have a vague memory of this place

Store in wetware (our brains)

Make the solution public

Remember in-house

> Value for SWIFT_VERSION cannot be emptySolution: Go to `[Target] Build Settings > Swift Language Version` and set it to `Swift 4.2`> Your development team, "______", does not support the Network Extensions capabilitySolution: Use the company developer account, instead of your personal account.> Unlock [device] to Continue.  Xcode cannot launch [project] on [device] because the device is locked.Solution: Leave XCode running.  Unplug the device's USB cable and plug it back in.

Keep private notes

Tip: Track down what the actual solution was

The best time to do a thorough investigation is when you have all the pieces in your mind already.

Tip: Ensure your testing cycle is smooth

Having a fast and automated development-test cycle is important for such investigations.

"start:watch": "nodemon -w src -e '*' -d 2 -x 'yarn run start'",

Tip: When things are fubar, throw an error with a sensible message

// Bad code: If the type is invalid, the caller gets back a null.
// Some time later the null value will cause an error, but the
// source of the problem will not be clear!
function getVehicle(type, opts) {
if (type === 'car') {
return new Car(opts);
} else if (type === 'bicycle') {
return new Bicycle(opts);
}
return null;
}
// Better code: If the type is invalid, the program immediately
// informs the developer, with a clear message and stack trace
// that can direct the developer to a solution.
function getVehicle(type, opts) {
if (type === 'car') {
return new Car(opts);
} else if (type === 'bicycle') {
return new Bicycle(opts);
}
throw new Error(`Vehicle type '${type}' not recognized`);
}

Anecdote: Putting obstacles in front of junior devs

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store