Writing Good Code

From AIRWiki
Revision as of 19:49, 2 May 2008 by BernardoDalSeno (Talk | contribs) (Initial creation; no content, yet :-()

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Why this page

When tutoring students for their theses or projects, I often find many problems with the code they write. I'm not referring to bugs; bugs happen, as flu happens, although there are some things you can do to make them more unlikely. The problem here is Bad codeTM, i.e., code that nobody can read or understand, not even its author. So I've decided to write this page with some advice on how to write Good codeTM. Please note that everything you find in this page should not be considered as strict rules, as it expresses the point of view of its author(s); but a reasonable piece of advice needs a good reason to counter it, in order not to follow it; so at least think about it. Contributions are welcome.

--Bernardo

General

C and C++ code

Matlab