Posted by

Grit for Programmers

It turns out that the best indicator of success isn’t IQ or natural talent or how well off you were at birth. Rather it’s something called grit – the perseverance and passion for long-term goals. Grit requires a clear goal, self-confidence and a careful balance between stubborness and flexibility. For the last few months I’ve been living one of the most productive (and most challenging) times of my life. I’ve been building a system that has more parts, does more things and is much larger than just about anything I’ve built before. It’s been challenging and rewarding work and I couldn’t have done it without lots of support from great mentors. As I’ve stumbled, fallen down, hit brick walls, picked myself up and kept going I’ve been wondering – does grit apply equally to programmers and success in building good software?

Programming culture is generally synonymous with hard work and long hours — death marches, all-nighters, 80 hour work weeks, we do them all. But we’re talking about grit here, not masochism. Grit isn’t strictly equal to working obscenely hard, long hours. Part of the problem with thinking about grit in relation to programming is defining what success means for a programmer. Is your definition of success simply finding a working solution? Does it mean finding the most efficient solution? Are you successful if you cover every single edge case or is it enough to just take care of the most common ones? Is your program really better if it handles everything you could throw at it or should you handle core uses cases well and fail gracefully on the others? Part of the problem of coming up with a good solution is asking the right question. This is especially true of building software. However merely coming up with the right question requires a certain amount of grit. We need the patience to look beyond the obvious problems and solutions and ask the hard questions.

So now we’ve found the right question and defined bounds on the possible solutions. What next? How does grit help with the actual act of writing code and building stuff? Programming is not easy. It can be fun and exciting and uplifting, but sometimes it is downright hard and depressing. Sometimes we spend hours sifting through possible solutions before hitting upon the appopriate one. Sometimes we spend several intimate hours with a debugger tracking down pointer bugs before finding that one variable we forgot to initialize. Being tenacious and persistent in the face of seemingly unrelenting roadblocks is not an added benefit for a programmer – it is a bare necessity. When it comes down to the act of sitting down, writing and debugging code grit is not optional. Without it not only can we not be good programmers, we can’t even be an average ones.

But if our goal is to be a good (maybe even great) programmer, then grit will continue to help. One of the qualities of good programmers is that they get a lot of stuff done. In particular they do a lot that isn’t strictly their job. This includes fixing and extending their tools and improving core infrastructure. They do this even if they aren’t in charge of infrastructure because they realize that their code depends on what’s underneath. Grit is the difference between waiting for someone else to fix the annoying bug in the library that you depend on and diving in and fixing it ourselves. When Steve Yegge talks about the difference between “superhumanly godlike” and “smart”, grit is a part of what he’s talking about. Not that there’s anything wrong with being smart, but it might not be enough. Of course to cultivate that level of grit we need to cultivate a good deal of courage. Diving into someone else’s code and fixing it can be a daunting task but it’s one that has to be mastered.

While I’ve always liked programming it’s taken me a long time to understand the importance of grit. When you do something because you like it (mostly) it’s tempting to stay away from the parts that are painful and hard. For a long time I avoided writing large programs because I was afraid of all the complexity that was involved. I was afraid of becoming familiar with complex algorithms because I was afraid of the possibility that I’d get it wrong. I understand now that I can’t become a good programmer if I don’t push myself to do the things that I consider hard and dislike. I need to have the grit to handle large complex problems and spend the time to understand and apply advanced algorithms. The good news is that just like perseverance and discipline, grit can be trained and improved. I’m no longer as afraid to dive into unknown codebases as I was a few months ago. I now find it much easier to hold complex code paths in my head. I’m certainly far, far away from being superhuman, but I try to suck a little less every day.

Tagged ,

Sunday Selection 2012-04-29

I know it’s not Sunday in most parts of the world, and it’s almost not Sunday anymore here, so I’m going to slip this in quickly.

Around the Web

How Geniuses Think I’m always interesting in what drives ingenuity and creativity. This doesn’t go very deep into details or give exact references, but it’s a good set of points about how creative, insightful thinking works and how we can get some of it into our own thinking.

Walking the Line Between Good and Evil Andrea Kuszewski is quickly becoming one of my favorite science writers. This article is probably one of her best. It takes a look into modern conceptions of heroes and villains, what their psyches are like, what sets them apart and (most importantly) how close they actually are to each other.

Stop working more than 40 hours a week Productivity is always an interesting battle. Is it really worth working as much as you can if you’re not getting any more done? I’d like to think that there is a peak point in the number of hours after which productivity. After that you should take a break and relax. I haven’t looked up the research to see if its true, but I do like the idea of keeping my sanity.

Looking beyond blogs

Every few years there seems to be some new blogging platform that’s going to solve all (or at least some) of the problems of the old ones. A few years ago Posterous made a splash with its idea of being a hub for your social media and driving everything by email. A few weeks ago a new, invite-only platform called Svbtle made the rounds (disclaimer: I signed up for an invite to check out the new hotness). Svbtle aims to take some of the pressure of blogging by allowing you to save quick, private, spur-of-the-moment “ideas” as well as more permanent, public posts. Though I love to see new platforms and all the innovation brought to bear on web publishing, I have some nagging doubts. I’ve been blogging on and off for about five years and I’m starting to think that blogs are the wrong model.

To be clear, they’re not the wrong model for everyone and everything. But they’re certainly not the end-all and be-all of web publishing. As I start measuring the lifetime of my blog in years instead of months, I’m starting to get just a bit frustrated by a platform designed for immediacy. Blogs are fine if you’re writing about what’s happening in the world right now. Blogs are great if you want an online diary of your life. Blogs are wonderful for documenting the growth of your project and community over the years. However blogs are perhaps not so great for people who want to use their writing to augment their thought process. They are not all that great if there are a handful of topics and ideas that you keep revisiting and refining over time.

For example, I’ve written about writing for the web and publishing models before. This will be the third in the de facto series. However, the posts are widely separated in time. In a typical blog format they won’t appear side-by-side unless I remember them and put in links. It would be great if I could have a single web page, at a fixed URL that holds the evolution of my thoughts on the matter over time. As a visitor to the site you could see each of the versions, not just the most recent one. You could comment on each of the versions, or on the combined document. While we’re at it, I’d also like to see paragraph-level comments and version histories (but with a UI better than standard diff).

What I’m describing is more of an essay platform than it is a blogging platform. However I don’t want stiffly siloed platforms either. I’d like to be able to post articles like the one about what I learned in my first semester of graduate school. These posts would fade into the background over time, just like a normal blog. Writers like Craig Mod do a good job of creating large, permanent articles surrounded by smaller “satellite” articles. But when I last asked him (over Twitter a few months ago) he maintained it by hand. Another solution is two have two separate sites like Dustin Curtis does: one for permanent works and one as a traditional blog. But personally I’m of the opinion that software should do as much work as possible and I’ve already separated some of my writing.

The strange thing about the web is that it is both ephemeral and permanent. Today’s hot articles will be lost and forgotten tomorrow. And yet nothing that gets put online ever truly gets deleted. What I want is a writing and publishing platform that reconciles these two opposite natures. There are other technical and interface aspects I could highlight, but they’re orthogonal to the overall purpose of this platform: let me post time dependent pieces which can be archived after a few days, but also let me have long running, heavily edited works.

I don’t know that such a platform exists. I also don’t know for certain that such a platfrom doesn’t exists. I suppose that the only way to really get what I want is to build it (after all, talk is cheap, show me the code) and I hope one day I’ll actually get around to it. Till then I’ll keep thinking about how we can support writing and publishing for the bipolar web (and linking back to older versions). I’d love to hear what you think about the matter.

Create More, Consume Less

I don’t like buying things. It’s not that I don’t have money or that I live beyond my means. As a starving graduate student I make enough to get by and I can generally stay within my income. What I don’t like is accumulating stuff. I have a rather visceral negative reaction whenever I buy things that I will keep around for a long time. This includes essentials (clothes, books) as well as non-essentials (gadgets, artsy things). Part of it is just practicality: the more stuff I have the more I need space to put it all and the more I need to lug around when I move (which happens every year or two). The more important reason is that right now I want to be a creator, not a consumer and buying stuff is opposed to that.

Compared to the energy of creating and making things, consumption almost always feels draining. There is a difference between buying things and consumerism. For better or for worse it’s possible to be a consumer without spending money. Thanks to all the free content around the web I can easily spend hours and days consuming without spending a dime. Netflix, YouTube, Vimeo, Spotify, etc. are all incredible (and seemingly unending) sources of consumable content. I don’t spend any money (or at most very little money), but I do spend a large amount in terms of energy and time. It’s so easy to sit on the couch and just hit the next button. Before I know it, it’s dark outside, the day is gone, I’ve forgotten to get dinner and accomplished pretty much nothing. The problem with this form of empty consumption is that it’s not relaxing or refreshing and it’s definitely not useful. The day just melts away into a sea of unproductiveness.

Television is particularly soul-sucking. It’s almost drug-like in the effectiveness with which it shuts down my brain and makes the rest of the world go away. When I sit on the couch and turn on Netflix I can feel my brain turning off. There’s a fog of semi-consciousness descending on my mind. I’m awake, I can see and touch and feel, but I’ve lost all the will to act or do anything other than hit the next button. After a few minutes it’s more work tearing myself away than hitting “next”. I suppose this is what being a zombie is like. This is my brain on television and in hindsight it’s quite terrifying. Perhaps there’s a reason it’s been called the “idiot box”.

Modern society seems to be predisposed towards consumers. Everyone is a consumer whether or not they want to be. Even the point of creation is to make money to be used for more consumption. I’m not about to make a grand sweeping statement like “consumption is evil”. Personally I think the occasional (even regular) indulgence is fine, maybe even healthy. But for me, consumption as a way of life is depressing. It’s synonymous with days sitting on the couch watching bad television, feeling my brain gradually atrophy a handful of neurons at a time. It’s synonymous with buying a nice shirt and then wearing free t-shirts to class everyday. Even though it might feel good in the moment, it quickly turns to disappointment and regret. Personally, I’ll take the pain of discipline over the pain of disappointment and regret.

Creation is different. Creation should be harder, it should take up more energy, it should leave me feeling trained and tired. And sometimes it does. But even if I feel physically tired, at a deeper level I feel energized. It feels good to know that today I made something. It makes me look forward to getting up tomorrow morning and making it better. It’s good to be able to show something to people, to get their opinions and ideas and then go back and polish. It’s good to know that I can the change the world in some way and maybe, just maybe I can make a bigger difference. Creation is good.

I don’t know why being creative feels good. I’m sure there’s some reward pathway in the brain that gets triggered by designing something, making plans to make it happen and then actually following through on those plans. I would like to believe that what I make helps other people in some way. Even if it doesn’t, I think I’m fine with pursuing creativity for personal reasons. I’m hoping that a life with less random television, fewer RSS feeds and less time glued to Twitter and Facebook will translate to more blog posts, more working code and more meaningful connections with real people. I’m hoping that it’ll also keep away the dreaded feeling of brain decay that a few hours of “entertainment” produces. Even when I do consume, I’d like it to be good books, good music and movies, blog posts that are actually insightful and interesting and not shallow proclamations of half-formed thoughts.

What I consume should be what I aspire to create. I want to create more than I consume.

Staying Alive

I’m not a religious person, I’m not particularly spiritual either. When I do meditate it’s to calm my mind more than anything else. There is one thing I do believe in: Life must be preserved. Life gives rise to intelligence and intelligence gives rise to sentient beings capable of experiencing and understanding the Universe. While “live and let live” is a part of this, there’s another, perhaps even more basic component: we should take care of our own lives. In particular, we must take care of bodies because we depend on them so much. Unfortunately this is easier said than done.

Part of the problem is that there are large gaps in our understanding of how our bodies work and how they are affected by our environment. We’re not sure if sugar is toxic, we’re only just starting to understand how aging works, our brain is still a place of great mystery. On top of it much of our decisions about our bodies are driven by convenience and market pressures rather then science.

However, each day we learn more and more about how to preserve our bodies and our lives. We learn that our bodies are made for endurance running. We learn that just half an hour of exercise on a daily basis can dramatically reduce our chance of disease and increases our quality of life. We learn that reducing caloric intake greatly extends the lifetimes of worms and that humans share many of the same metabolic pathways. And there are people trying to help us live longer, perhaps forever.

As we learn more about our bodies, about disease and health I hope we can also rethink our ideas about health, life and death. Perhaps one day we’ll realize that simply being disease-free is not enough. We’ll understand our bodies well enough to be able to determine what each individual’s optimal body state is and how to get there. Perhaps one day “normal” will be defined as “optimal” and not just “not sick”. And maybe, just maybe, one day we’ll start to think of death as a disease, the last human disease and work to eradicating it.

The effort to preserve and optimize our lives brings its own challenges. What happens to agriculture and food supply chains in a world of health-conscious eaters? What happens to the planet’s natural resources (especially the scarce ones) when there are fewer deaths and large numbers of healthy, active people? If we do get on the path to eradicating death, how many people will the Earth support? Will it finally force our hand and push us into colonizing other planets?

Who knows?

I think we’re entering (and maybe we’re already in) a golden age of biology and health science. Backed by incredibly precise biochemical tools and powerful computational strength we’re going to have an unprecedented amount of knowledge about how our bodies work and react to various conditions and inputs. How are we going to use this knowledge? Will it substantially improve the condition of the human race? I hope so.

Live and let live. Let’s start with ourselves.

Follow

Get every new post delivered to your Inbox.

Join 331 other followers