Alec Nevala-Lee

Thoughts on art, creativity, and the writing life.

Archive for July 16th, 2017

Coding by divine inspiration

leave a comment »

When you have to fix a bug in a program you never, ever fix the bug in the place where you find it. My rule is, “If you knew then what you know now about the fact that this piece of code is broken, how would you have organized this piece of the routine?” What were you thinking about wrong before? Fix the code so that can’t happen. When you finish with a routine I want every routine you work on to look as if it was just written. I do not want to see any evidence of afterthoughts or things gone wrong followed by something to correct the error or a mysterious piece of code saying, “This routine returns the wrong value every now and then so I’ve got to fix it.” I don’t want to see any of that. I want to see code that looks like through some divine inspiration you got it exactly right the first time.

Bernie Cosell, to Peter Seibel in Coders at Work

Written by nevalalee

July 16, 2017 at 7:30 am

%d bloggers like this: