Programmer Mike

A collection of my thoughts on programming, music, and life.

My .emacs File

Welcome back for part two of useful things I think every programmer should know. On Monday, I posted a list of my must-have shell settings, which if you haven’t read, I highly recommend you do. It contains some simple functions and aliases that I can’t live without. I hope they’re helpful to you.

Today I’ll be sharing some code from my .emacs file. I use emacs for all my text processing needs (including writing posts like this one). Due to the nature of emacs, that is, how bat-shit crazy/awesome it is, I’m only posting a condensed version of my .emacs file. I’ve included most of the things I think a new emacs user would need in their first year of using emacs, but I’ve tried to keep it from being a kitchen sink of gobbledygook. Some notable ommissions are my settings for syntax highlighting, individual languages, some random functions, and my CEDET settings.

This post was inspired by a similar post by Steve Yegge, programmer/blogger extrordinaire. If you haven’t read his blog or his other blog, I suggest you check them out. I’ve learned more from his (exceedingly numerous and extremely lengthy) writings than from any other single source. Not only will you learn lots about writing software, programming languages, hiring practices, and what writing software in the real world is like, but also hopefully you’ll be inspired to push yourself and become a better progammer, like I was.

Must-have Shell Settings and Commands

After a few years writing code, you pick up a lot of crucial commands and settings for your various software tools. Some of them are useful, some are not. Here is a list of shell commands and settings that I’ve used repeatedly and help me get things done. This post isn’t meant to serve as a shell tutorial, but I will explain a few details that may be helpful.

Holidays Are a Distraction

Holidays are important to everyone. Why is that? I’ve been thinking about this for most of December, and I think I’ve figured it out. As another year winds down, I naturally reflect on the previous year, specifically on my goals and which I’ve achieved and not achieved. But I’ve had a hard time doing this because I’ve been busy with “holiday stuff”.

I’m guessing a lot of you guys have felt the same way. Maybe you’re travelling, or just spending time with family, and there’s a lot going on. It seems that everyone gets a little more stressed in December, with mall parking and last minute shopping and the like. Because I’ve been stressed and busier than usual, I’ve had to put my year-end introspection on hold until after the 25th. What if that’s the real purpose of “the holidays”?

Stop Waiting for Permission

One thing I’ve learned recently is that there’s not a whole lot of situations where asking permission is necessary. In fact, if you’re over the age of 18 (let’s say), in most situations, asking for permission makes you look weak. If you’re over 18, or 21, or even if you’re not, you don’t need someone to tell you can do things. I think one of the worst things we do to children is require them to ask to use the bathroom in school. Here we are, educating them, telling them to think creatively, and expanding their minds with knowledge, and then we make them ask permission to do something that’s 100% expected and universal among all people. I think the message we send kids is “Learn, but only what we tell you, and only when you’re here”. I don’t remember exactly when it was, but it was a huge moment for me when I realized you could learn stuff outside of school.

Techno Music Is Like Classical Music

I’m a really big fan of Tron: Legacy. In some ways, I feel like that movie was made just for me. In the first few minutes, you see a board meeting with some executives talking about the latest version of their operating system they’re about to release. When the topic of new features comes up, the CEO remarks that “This year, we put a 10 on the box”, intimating a madden-esque style of iterating for the sake of iterating. Shortly thereafter, the main character breaks into a server room and uploads a copy of the OS to the web. I was absolutely delighted by this; the movie just gave big software companies like Microsoft and Apple a big middle finger. Take that Corporate America!

Objectivity vs. Subjectivity

As I grow older, I find myself thinking about things differently that I did when I was younger. One way to over-generalize would be to say as a child, the world was black and white. There were good people and bad people, and things were right or wrong. This is, of course, a grossly incompetent way of looking at the world. The classic example is the man who steals medicine for his dying wife. The couple has several children and they can’t afford the medicine legally. If she doesn’t get it, she will certainly die soon. Is it right for the man to steal the medicine? Objectively, no, it’s not right to steal under any circumstances. But what if it was your loved one? When you picture yourself in the problem, it gets foggier, it gets more grey and uncertain. This is subjectivity.

Bad Habits

Change is hard. I know this because I’ve tried making changes in my life like eating healthier and exercising more, but so far I haven’t made much progress. This is because I, like every other person, am comfortable with my current lifestyle. I go out to eat too often but how does that perceptibly affect me? Not really a whole lot. Tell me if this argument seems familiar: I went out to eat a lot last week, and I’m ‘fine’ this week, ‘fine’ being whatever criteria on which you judge your own well being. Therefore, I will eat out the same, but no more, next week, and I will also be ‘fine’. This is flat-out wrong. This kind of thinking leads you to believe that you can eat out this week, and next week, and the next, indefinitely with no serious consequences. Of course, if you went to eat out constantly, you’d gain weight and spend more money than you intended. The solution is to change your thinking and zoom out, focus on the issues in context.