4 ms·
1) Always write code for someone else. And you don't know who it is. -- similarly: "When I come back to this in a few years after not touching this code, will I
by voiper1 10y ago
1) Always write code for someone else. And you don't know who it is.
-- similarly: "When I come back to this in a few years after not touching this code, will I understand it?"
- jstelly 10y agoI would agree with (1), but add "Most code is read at least an order of magnitude more times than it is written." Lots of decisions that save you time writing code (or save typing) at the expense of reading the code are bad decisions because of this. Also, always put a breakpoint on every code branch and step through it at least once in the debugger. Everyone makes mistakes. Fixing mistakes at the point of writing the code is much more efficient than having someone else fix them later. If you haven't done at least this level of testing, just don't check it in. Assume code is broken unless it has been tested.