• Any project task will have three valuable programming stages:
    1. Prototype: here you write a usable prototype of the task. For example, if the task is generic addition, the prototype can add 2 and 2 (and always returns 4).
    2. Understand: here you write a usable version of the task, which does the job. Usually it's quick and dirty but gets it done.
    3. Perfect: with two versions of the code, you now know how it's likely to be used, you know what it has to do, and you've done things the simple way. The third stage lets you pefect the code to do exactly what's needed, the right way.

    Understanding these stages and using them will make your code much better. Never stop with the prototype, it's experimental. Never stop with the second (simple) solution, you wrote it while you didn't understand the problem yet.

  • If you can avoid memory management, let someone else worry about it. Easily 60% of the bugs I ever found in my code and others' code were memory management bugs. I like Perl, Java, Lisp, etc. for many reasons, but their memory management facilities are probably the biggest reason why I avoid C/C++/etc.
  • When a program's input has Readline support, rejoice. Readline is easily the most useful tool you have at the command line and at various prompts. The biggest keyboard shortcut you must know is
    Control-R
    (interactive backwards search). Learn it, love it. Press it and start typing; the last command you typed with that string will show up. Hit it again, and the one before will show up. For example, imagine a SQL shell with Readline support (yes, there are many):
    1. INPUT:
      Control-R

      sel
    2. OUTPUT:
      select count(*) from users;
      (the last command you typed with sel in it).
    3. INPUT:
      Control-R
    4. OUTPUT:
      select name,address from users;
      (the select you ran before the one above)

    This works at the shell prompt, too. Learn this and you'll fly through any interactions with Readline-enabled command-line applications.

  • Learn and use ZSH, if you can handle it. It's not perfect but it's really nice for what it does.
  • Learn and be very good at both Emacs and vi (vim, preferrably). You'll learn more about editing that you ever thought possible, and the different abilities of both editors will inspire you to look at programming tasks in different ways too.