I think there’s something really fascinating about building something from nothing. It’s exciting to work in a creative industry such as technology or media production, because that’s exactly what you get to do every day. In software development, you get a choice of where you want to begin the creative process.

I used to be a strong advocate of building projects from scratch. I still think there’s a lot of value in doing so; you’ll never learn as much as you would by starting from nothing at all. However, as I’ve grown as a developer, I’ve learned not to repeat myself by creating more work than is necessary. Now that I have a handle on the foundations of a web app, I no longer feel the need to re-engineer the same thing every time I start a new project. I am no longer hesitant about using time-saving tools like backbone-generator and other high-level tools such as frameworks and libraries.

One area that I still prefer to take hard road with is my development environment. Because I see software development as a craft, not unlike woodworking or gourmet cooking, I never want to be shielded from the essence of it. I don’t use IDEs. Instead, I prefer to use simpler editors such as Vim or perhaps Textmate. I don’t use a Git GUI app, I use Git directly on the command line. I’ve been using Git for years, and although I’m quite comfortable with it, but I still feel that I am learning it. However, I have a much deeper understanding of Git because of how I use it, as none of the necessary complexity has been hidden from me.

I still don’t want to waste time or energy by repeating work. No problem should ever have to be solved twice. When I find a part of my workflow to be slow or inefficient, I try to automate it. Luckily, the UNIX environment that all OS X and Linux users enjoy is optimized for doing exactly that. UNIX was developed at a time when computers were slow, and optimizing a workflow wasn’t just a convenience, it was necessary for getting anything done. The systems that the designers of UNIX developed are still in use today. Programs are configured on a per-user basis via dotfiles, and data streams flow from one process to another. These UNIX features make it very easy to reduce a multi-step process into a single step.

Automating pain points

How often do you have to perform multiple steps to do a simple action? For most computer users, the answer is “quite a lot.” Many GUIs provide a “Save” button. The slow way is to take your mouse, click on “File,” mouse down to “Save,” and then click. If you save often, this is pretty tedious and inefficient. A much better approach is to use the keyboard shortcut, Control/Command + S. This is a simplistic example, but everyone’s workflows are riddled with inefficient processes. We can do better. After all, programmers exist to automate work.

Think of it as teaching your computer to do your work for you. One thing I do a lot is push commits to a Git remote. If I’m on the master branch, I have to do this:

git push origin master

So much typing! And on top of that, I have to make sure that I’m actually on the master branch, otherwise things could get hairy. Rather than deal with this dozens of times a day, I’ve automated it:

# Push the current branch
function psh () {
  git push origin `git branch | grep \* | sed 's/\* //'`

This BASH function determines my current branch and then git pushes it. This could probably be more elegant, but I don’t really care because it’s trivial and abstracted away. And, if I did care, I can change it because I wrote it. This is the beauty of creating your own tools.

There are various ways to customize your shell with your .bash* configuration files.  You can write full-blown functions as above, but you can also make simpler shortcuts with the alias keyword. Here are some aliases that I have in my .bash_profile file and depend on daily:

alias ll="ls -lah"
alias ip="ipconfig getifaddr en1"
alias gs='git status'
alias gb='git branch'
alias gc='git checkout'
alias v='vim'

Everything I know about software development I learned from Zelda

…And that is, you are only as effective as your tools. If you’ve ever played a Zelda game, you know the feeling of empowerment you get by obtaining a new or upgraded weapon. I experience this every time I tweak or add a new feature to my .bash_profile or .vimrc files. There are few workflow limitations that we have as software developers. The more we individually understand our tools, the more powerful we can make them. Don’t just accept what’s been developed by somebody else, take the hard route and learn how things work from the bottom up. After all, Link never took the easy way out, and he’s the hero of Hyrule!

Tagged with: