97 Things Every Programmer Should Know

(Chris Devlin) #1

Collective Wisdom from the Experts 193

You want to write good code. You want to be a good programmer. So, you care
about the code:

  • In any coding situation, you refuse to hack something that only seems to
    work. You strive to craft elegant code that is clearly correct (and has good
    tests to show that it is correct).

  • You write code that is discoverable (that other programmers can easily pick
    up and understand), that is maintainable (that you, or other programmers,
    will be easily able to modify in the future), and that is correct (you take
    all steps possible to determine that you have solved the problem, not just
    made it look like the program works).

  • You work well alongside other programmers. No programmer is an
    island. Few programmers work alone; most work in a team of program-
    mers, either in a company environment or on an open source project.
    You consider other programmers and construct code that others can
    read. You want the team to write the best software possible, rather than to
    make yourself look clever.

  • Any time you touch a piece of code, you strive to leave it better than you
    found it (either better structured, better tested, more understandable...).

  • You care about code and about programming, so you are constantly
    learning new languages, idioms, and techniques. But you apply them only
    when appropriate.

Fortunately, you’re reading this collection of advice because you do care about
code. It interests you. It’s your passion. Have fun programming. Enjoy cutting
code to solve tricky problems. Produce software that makes you proud.

Free download pdf