9 ms·
I'm not a grandmaster by any means, but these are things that I focus on: 1. Aggressively avoid techniques and abstractions that have produced bugs in the past
by notaddicted 13y ago
I'm not a grandmaster by any means, but these are things that I focus on:
1. Aggressively avoid techniques and abstractions that have produced bugs in the past. The "backwards conditional" is an example of this, in languages like C that will accept x = 0 as a conditional, it is safer to do 0 == x in an if statement in case you mistype. Mutability trips me up sometimes, so I try to never re-assign a variable. I keep links to the source code of key libraries in my bookmarks bar so I never have the guess how something actually works. Static analysis tools, and bug prediction tools [1] are two steps I haven't taken.
2. Seek out code written by experts and inspect it [2]. If I'm considering using a new language or library one of the first things I do is to search for large scale OSS projects. For a new language looking at some of the popular 3rd party libraries can be really illuminating. Especially if you're already familiar with the problem space.
3. two words: learn to fuckin' type.
4. Get familiar with what the history researchers call the Primary Sources. Not just the actual source code but the proposals, the specifications, and the research reports that are written by the people who conceived the tools that you are using.
[1] http://google-engtools.blogspot.ca/2011/12/bug-prediction-at-google.html http://google-engtools.blogspot.ca/2011/12/bug-prediction-at...
[2] (EDIT) According to Paul Allen, in high school Bill Gates actually went dumpster diving for source code: http://www.businessinsider.com/10-things-you-didnt-know-about-bill-gates-2011-4?op=1 http://www.businessinsider.com/10-things-you-didnt-know-abou...