Eric Lippert on Cargo Cult Programming


This blog posting from Eric Lippert has a ton of good advice for new programmers. It’s not specific to C++, but the principles all apply:

Syntax, Semantics, Micronesian cults and Novice Programmers

There are lots of cargo cult programmers — programmers who understand what the code does, but not how it does it. Therefore, they cannot make meaningful changes to the program. They tend to proceed by making random changes, testing, and changing again until they manage to come up with something that works.

Bottom line… understand the meaning and purpose of every line of code before you try to change it.

Comments (1)

  1. Alan8 says:

    <i>Bottom line… understand the meaning and purpose of every line of code before you try to change it.</i>

    Sometimes you can’t understand the meaning because of inadequate documentation. This often happens with MFC which has HORRIBLE documentation.

    I’m seeing it again with HTML dialogs/C++. There’s no good documentation on this; MSDN is worthless for this topic.