Sunday Selection 2011-11-27

Today’s a bit of a health and fitness special to compensate for all the Thanksgiving excesses. But first, some programming.

Programming

All I Need to Be a Better Programmer I Learned in Kindergarten Sometimes the basics can be boiled down to just a few sentences. Sometimes I think I knew more when I was five than I do now. Of course, that’s a lie, but it’s worth thinking about.

Code Fearlessly I think version control is amazing. I’ve been using Git for a few years now (Subversion before then) and I keep all my writing as well as my code in repositories, backed up to Amazon and a VPS. The great thing about version control is how it lets you make mistakes and try out wild ideas without worrying about how you’ll get back to a working state if you break something.

Health and Fitness

The Creative Brain on Exercise I know, I know. Exercise doesn’t come naturally to most of us spending our days in front of our screens. But given how much of our work is creative in nature, it makes sense to take care of our engines of creation. I think the time spent in exercise will more than pay itself back over the years (in saved medical bills and lost work time if nothing else).

How Getting Buff Can Make You a Better Rubyist. In case you’re wondering about whether any of this exercise and diet stuff actually works or not, here’s some evidence straight from the source. This is worth watching even if you’re not a programmer, but just someone who has a normally sedentary work life.

Tim Ferriss on the 4-Hour Body at the NEXT conference I know that so-called “extreme” advice such as provided by Tim in his book always earns a skeptical look, but I find his idea of minimum effective dose quite interesting. If you’re looking for the most efficient ways to change your body for the better, this is a must-watch.

Eat to Live If you’d rather have advice from a medical doctor who’s also changed the lives of dozens (if not hundreds) of people, this book is your best bet. I tend to think of it as more of a primer on nutrition and health in general rather than just a diet or fitness book. It might take you some time to get through it (though it’s a small book) but again, the investment is definitely worth it.

Deliberate Practice for Programmers

The main reason one should go to graduate school is to do research. To earn a PhD you must have advanced the state of your field. In fact, your PhD defense is all about convincing the guardians of the frontier that the frontier has been moved. That being said, I have a personal goal of improving myself as well. I’m surrounded my brilliant professors and peers and it would be downright stupid if I didn’t take this chance to learn from experts in their fields.

While I want to improve as a computer science researcher I also want to improve as a developer. For me, the fact that we must take our beautiful algorithms, logics and abstractions and express them in terms understandable to a dumb machine is not something to be despised. In fact, I consider it a pleasant challenge and a source of infinite creative joy. I would like my job a lot less if it didn’t involve a significant amount of programming. That being said, how exactly do we level up as a developer? In fact, what does leveling up even mean for a developer?

For the last few months (years?) I’ve been a growing fan of the idea of deliberate practice – the idea that the best way to improve is to take well-defined measurable steps towards getting better where at each step you get feedback as to what you did wrong and how you can do it better the next time. Deliberate practice has been applied by athletes and writers, can we apply it to programmers? In particular, can we come up with something more detailed than “Read code. Write code. Repeat”? Luckily for all of us, Jason Rudolph took some steps on that path a few months ago.

Remember that deliberate practice requires that we have a list of well-defined, actionable goals on our path to excellence. We must know clearly what the goals are and also be able to unambiguously tell if we’ve achieved them or not. Jason came up with a list of simple yes/no goals that will exercise your programming muscles. What I love about Jason’s list is that it combines a lot of what it means to be a good developer. There are goals for learning tools of the trade (different languages, environments and frameworks), goals for learning core concepts (different paradigms and parts of the software stack) and social goals (open source and community involvement). There are a lot of things on the list, but then again, computer technology is a vast field.

Jason’s list is also necessarily incomplete. I’d argue that it’s practically impossible for one man to know all about the computer technology field today. But the good thing is that we have the technology and the community to take one man’s starting point and extend it for our own purposes. Jason’s list is available as a gist on Github and has already been forked many times by people who are using it as their own deliberate practice guidelines. I have my own fork where I’ve fleshed out sections on uncommon programming languages and more theoretical learning goals.

It might be a bit naive to think that just going through a list of programming challenges will make you level up. However, I think the list is a good head fake. The point isn’t really to go and do everything on the list. The point is everything that comes as a side-effect of completing the list. You’ll definitely put in a few thousand hours and churn out thousands of lines of code in a variety of different languages and environments. You’ll expand your mind by learning about programming styles and tools that you would have missed out on otherwise. As you encounter problems you’ll have to ask around on forums, mailing lists and IRC for help. This is important because deliberate practice is useless if you’re practicing the wrong things. In the absence of programming coaches, the global communities of programmers are your best bet to find mentors and guides. If you release your code to the world you’ll gain some street cred, get valuable feedback and maybe even provide something of lasting value to fellow developers. If you follow through on the social and community goals you’ll gain non-programming, but useful skills and meet a lot more people who can point in new and interesting directions. You’ll discover interesting new problems and come up with applications and solutions you might never have thought about otherwise. Maybe, just maybe, you’ll learn enough to level up as a programmer.

As a parting note, let’s all keep in mind that this will not be easy. It will take time and effort. I’m in graduate school so I might be able to make it part of my day job to do some of these things. But a lot of it will have to happen on my own time and energy, when I could be exploring Ithaca’s gorges or watching infinite Star Trek episodes on Netflix. This is even more true for people who have legitimate day jobs and families. We all need to come up with our own reasons for why we want to invest all this time and effort in deliberate practice. But one thing I keep telling myself is that the time will pass anyway and my energy will be spent somehow. I would rather spend it on writing my own operating system than on Star Trek reruns (no matter how much I love Star Trek).

Sunday Selection 2011-11-20

Around the Internet

How an MIT postdoc writes 3 books, a PhD defense and 6+ peer-review papers and finishes by 5:30. One of the best and worst things about being in a PhD program is that it is opened: it can take as long as you want it. Though being at a world class research university like MIT or Cornell is certainly a wonderful experience, I’m not at the point in the life where I want to spend more than a few years in one place. I want to do good work, do it in a focused manner without killing myself and hopefully have a life and get done in a reasonable amount of time.

Thrust, Drag and the 10x Effect Managing your time goes hand in hand with managing your energy and your activities. In the software world there’s a claim that the best engineers are often ten times as productive as mediocre ones. This article aims to give you some tools to help you on your way toward being ten times as productive.

Why Emacs? I make no secret of the fact that I think Emacs is the best text-editing environment on the planet. This post gives a very straightforward but informative introduction to the question of “Why Emacs?”

Video

Derek Sivers’ Speech to Berklee College of Music I have a tremendous amount of admiration for Derek Sivers. While this speech is geared towards music majors, most of his lessons and advice can be generalized to your profession and life in general. There’s a lot of wisdom packed into a few minutes.

Software

Readability is an awesome tool in the fight for a reading-focused, cleanly designed web experience. They started as a browser plugin that strips a page of unnecessary clutter and presents just the text in a clean, visually pleasing format. They’ve released upped their game with a payment model for publishers, a rich web application and a review-pending iOS app. If you read a lot on the web you probably want Readability in your toolbar.

Music from the Command Line

In addition to programming I also love music. If I’m not listening to music I’m probably not working. While I love Pandora, my slightly off-mainstream musical tastes means that I start getting repeats pretty soon. I carry my personal library on my iPod but I don’t like listening on my iPod all day. Also, if the office is empty and my computer has speakers I like to take the headphones off and turn up the music. Last week I realized that my work machine had a 500 GB hard drive in addition to the SSD so I decided to copy my personal library on to it.

I know that there are a number of good music players for Linux but I personally wanted a very lightweight setup and didn’t need any “management” features (I have everything neatly organized into Artist and Album folders anyways). So I decided to use a little gem called MPD – the Music Player Daemon.

MPD is a daemon – it runs in the background and plays your music. It doesn’t provide an interface itself but you can connect to it using a number of clients. I love MPD becuase it’s very UNIX-y and just gets out of your way. You tell it where your music is and point it to a number of files it needs for operation (logs, a database and some state information). You then tell MPD which user to run as and a port on localhost to listen on. Here’s my config file.


music_directory                 "~/Music"
playlist_directory              "~/mpd"
db_file                         "~/mpd/mpd.db"
log_file                        "~/mpd/mpd.log"
pid_file                        "~/mpd/mpd.pid"
state_file                      "~/mpd/mpdstate"

user                            "username"
bind_to_address                 "127.0.0.1"
port                            "6600"

. As you can tell from the screenshots, it’s a lightweight but fully functional client.

This kind of setup probably isn’t cup of tea but I don’t want to convince you that it’s better than whatever current setup you have. For me this is amazing for a number of reasons. Firstly it’s quickly configurable and it stays out of my way after that. Second it’s very lightweight. Ncmcpp comes up in a second, I can quickly go through my library and add a few hours of music and set it to play. Then I can close it and not give it a second thought as I do my work. Since it’s so quick to come up, I can keep the client closed and open it if I do need to do something (like skip a track or see what’s playing). Since I have a terminal (or five) open at any time, it’s a quick process the few times I do have to do it.

Reason three is the client-daemon model. I think there are graphical clients that give you more standard functionality, but since I don’t need any of that, it isn’t forced upon me either. There is however an even lighter client called mpc (that is part of the standard MPD install) which lets you execute some actions like play, pause and skip without even opening a full client. Thus interaction is even faster.

In conclusion, if you’re looking for a simple, efficient music player that will play your music and stay out of your way then MPD is worth a try. If you’re not a command-line afficionado you might like one of the graphical clients. I’ve used Sonata myself in the past and liked it.

Sunday Selection 2011-11-13

Around the Web

I hate writers because Real Artists Ship and real writers, you know, write

Structured Procrastination from a comment on my previous post on salvaging dead time.

BE ON FIRE uses simple words and simple drawings to get across an important message.

Video

Automating Inefficiences is a great watch for all the times when programming stops being fun and becomes a drag. Happy Hacking.

Software

Tyrs comes along at a great time when yet another change to the Twitter website makes it even less usable. Need a clean, fast, no frills Twitter client? Love running cool software in a terminal? Get Tyrs.