Filed under Productivity

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 ,

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.

Sunday Selection 2012-04-08

Today’s selection is something of a health special. For better or for worse our minds are intimately tied to our bodies. Until the day we have seamless uploading technology we’ll have to take care of bodies if we want our minds to work well. And in order to do that we need to know about how our bodies actually work and what’s good for us.

Around the Web

Is Sugar Toxic? The title is perhaps deliberately inflammatory, but the notion behind is perhaps just as troubling. Is is possible that sugar (not just high fructose corn syrup) is not just harmful in large quantities but something that’s dangerous by nature?

Humans: hot, sweaty, natural-born runners I’ll be the first to admit that I’d be happy if I could get away with doing no exercise at all. Unfortunately that’s not the case. The good news is that evolution has equipped us with the systems we need to be powerfully capable runners. Being a regular runner doesn’t require superhuman feats of dedication – it’s in our genes, we just have to tap into our latent biological potential.

From the shelves

The Four Hour Body I don’t really agree with Tim Ferriss’ Four-Hour Work Week ethic, but I do like the compendium of practical health and fitness information that he’s assembled in this book. While some of his advice is probably best taken with a physician’s advice this book will give you some great ideas and actionable guidelines for becoming healthier and stronger.

Moving Pictures

What Would You Do With Your Own Google? That, is a very good question. Cure cancer? Cure aging? End poverty and world hunger? We’re living in a world of unprecedented computational power and incredible amounts of data to crunch. What could we learn from all that data and how can we use it to change the world?

Tagged , , , , ,

Predicting Human Intent

Readability is one of my favorite web services. Readability is well designed, carefully made, unobtrusive and they’re not trying to wring me of personal information to datamine and sell at every turn (at least I don’t think they are). Their web service gives you browser plugins that strip out everything but the content of a page and present it in a clean, crisp format. If you sign up for an account you can make use of their “Reading List” to store pages for later reading. Recently they released beautiful iOS and Android apps that sync with your reading list allowing you to stock up on things to read at your computer and read them on the move.

Though Readability is a great service and they have great supporting apps they have one flaw. However, it’s not entirely their fault: I think it’s a side-effect of the difficulty of predicting human intent. The problem has to do with Readability’s reading list. When you install the browser plugins you get three buttons: a “Read Now” button, a “Read Later” button and a “Send to Kindle” button. The “Send to Kindle” button formats and sends the web page you’re on to your Kindle (assuming you’ve set up and connected your Kindle properly). The “Read Later” button saves the page you’re on to your Reading List which can be synced to your iOS or Android devices. The “Read Now” button will do the Readability formatting on your current page and show you the cleaned up version right then for you to continue reading.

That’s all great. However, the “Read Now” button also drops the page you just converted into your Reading List. This is great if you start reading a long article and then have to leave your machine. You can come back to it later, on another browser or another device entirely. But what happens if you finish reading the article right there and then? The article still ends up in your reading list. That would be fine if the list was simply a history of things you’ve read. However the Reading List is also a list of things you’re going to read. So the Reading List now contains things I’m going to read, things I’ve read and things I might want to read again. I think this problem stems from the fact that Readability started as a formatter and added read-later functionality unlike services like Instapaper which are designed for savings articles for later.

How can we differentiate between all these types of articles? Readability provides the ability to “Archive” and “Favorite” articles. Once I’m done with reading an article I Favorite it if I’m going to read it again and Archive it otherwise. But could Readability do this for me? Could Readability somehow figure out what I want to happen to the article? The simplest solution would be to archive whatever I Read Now and only add to the Reading List ones that I mark to Read Later. However that means that if I start reading something and then have to leave it ends up in the Archive where I might never look at it again. Could Readability be a little smarter? One heuristic would be to check where I am in the article. By default an article is always added to the Reading List as it is now. But when I scroll to the bottom Readability takes that to mean that I’m done reading and moves it into the Archive. If I liked it and wanted to come back to it I manually mark it as a Favorite. (I don’t expect Readability to be that clever. Yet.)

Without having actually tested the solutions, I can’t say how well they would work. There are certainly edge cases: what if I scroll down to read a footnote and then scroll back up to read the rest of the article? What if I get to the end and then go back to re-read a particular section? What if I quickly skim through an article to get to the end and want to come back later to read it in more depth? I think there’s no clear answer because fundamentally we’re trying to have Readability “guess” what we’re trying to do without giving an unambiguous signal. Sure, all of them could be solved with a few manual interactions. But the whole point of having advanced software is so that I don’t have to tell my computer what to do in excruciating detail.

Like I said at the beginning I don’t think that Readability is necessarily at fault for how their service works. Any attempt to automatically manage the Reading List would require making some assumptions as to what it is the user wants to do. Even if those assumptions are right most of the time, there will almost certainly be times when they’re wrong. We are, after all, dealing with people here, and people aren’t perfectly predictable agents. If they were, human computer interaction and economics would both be very different fields.

Predicting human intent is a hard problem. Ultimately, some amount of direct intervention might be inevitable. While Readability is meant to be a product it would be interesting to see researchers using it (or similar services) for doing research with real users about how our software can make choices for us in a way that closely reflects what we would have done ourselves. Unlike some people I don’t want my software to do less and have fewer features. I want it to do more so that I can concentrate on more important things. Like saving the world.

Generation Flux

A few months ago Fast Company run a multipart piece on “Generation Flux”. The piece had two intertwined themes. The first is the idea that we’re living in age of constant (and perhaps accelerating) change and that to stay competitive businesses and institutes have to ride this wave of change and go with the flow. The second idea is the notion that the most successful people are those who are intimately familiar with this state of flux and can craft their lives to take advantage of it. As part of the piece they profiled several members of Generation Flux – technologists, businesspeople and researchers like danah boyd and DJ Patil.

Though the piece focused on the tech industry and business, I think the basic ideas apply to all fields including (especially?) academia. In fact I think that the best researchers and scientists have always been those who have been spread out over a number of areas. While focus and diligence are necessary for productive research, I’m starting to think that it’s important (if not fundamental) to have a wider halo of interests and knowledge surrounding your core area.

As a new graduate student this is a question of great personal interest: I have a limited amount of time and energy in grad school (and later) and it’s in my best interest to make the most of it. As with many important things there’s a dilemma: if I spend too much time and effort on one thing I’ll miss out on everything else and that can be very limiting. I already know this first hand: I know a good amount about programming languages, but I’ve been scrambling to teach myself about networks and know next to nothing about AI. But on the other hand if I don’t dig deep enough into one relatively narrow area I’ll never have the knowledge or the insight to know what the important problems and come up with appropriate solutions.

So what are the lessons of Generation Flux and how do they apply? Accepting and adapting to change is definitely a big part of it. As danah boyd tells us: “We all have to learn new skills. Being able to live on one set of skills over a career is not realistic. Change is going to happen, not all of it good, in serious ways.” But simply being able to ride the wave is not enough. And it’s certainly not advisable to jump ship to the next shiny thing at the first sign of trouble. DJ Patil has more personal advice to offer: “At the end of the day, you have two things: your energy and your intellectual curiosity. If you’re willing to apply them, try to add value to the world, the possibilities are so endless.”

Patil, boyd and the other Gen Fluxers seem to be able to strike a balance between change and constancy. In times of perpetual change the key to success seems to lie in two complementary values: first is the ability to live on the edge of chaos and move fluidly from one spot to another. But second (and just as important) seems to be the ability to be tenacious, diligent and sometimes downright stubborn. Patil for example taught himself mathematics and worked midnight to morning to get computer access. While he’s worked on amazing projects he’s also turned down lucrative offers because they didn’t fit his vision of what he wanted to do.

Viewed through the lense of graduate school the lessons become: Explore broadly and lightly across areas related to what you’re interested and then buckle down, dive deep and keep going until you get to something novel. Of course the timing is critical and to some extent they have to happen in parallel. As Matt Might puts it: going rogue too early or too late can be fatal. Luckily that’s what advisors, mentors and colleagues are for.

Personally I’m still in stage 1: I’m still taking classes and exploring the broad regions of computer science but I’m also making forays deep into some areas (particularly programming languages and datacenter networks). Looking further ahead I think it’s great that we’re going to be living in a time where being a member of Gen Flux is a good thing. Gen Flux is perhaps just a modern term for Renaissance Men (or Women) – people with a breadth of knowledge and skills but also with singular and far-reaching accomplishments in some of those fields. And that seems like a goal worthy of a lifetime worth of time and energy.

Follow

Get every new post delivered to your Inbox.

Join 338 other followers