Soft Skill: Avoiding Arrogance

At my day job, I just had a code review. Code reviews are, in general, awesome, because you find out what you’re doing right and wrong, and you get to talk to other programmers; talking to other programmers is awesome because they know things you don’t, so talking to them causes learning, which is our goal.

Anyway, at this code review, we talked about some stylistic inconsistencies I had introduced into the code base. (In this case, using named booleans in conditional checks, rather than inlining the whole check, but that’s not what this article is about.)

One of my colleagues said something very wise (paraphrased heavily): Lots of stylistic decisions don’t matter that much, but introducing stylistic differences is bad; code is easier to read if it all follows the same conventions, even if those conventions are not the best conventions in the world.

Now, I knew I was introducing a stylistic difference; the problem isn’t that I wasn’t paying attention. The problem is that I thought I knew better. Maybe named booleans make if statements easier to follow, and maybe they don’t. But a code base where half the people follow one convention and half the people follow the other is definitely harder to read than a code base where people consistently follow either convention.

There’s a short, unpleasant word for making the wrong decision because you think you know better: arrogance. Looking back, I realized I was sitting there thinking, “these guys obviously didn’t read Code Complete enough times; I’ll show them.” Instead, I should have been thinking, “why am I the only one here whose code looks like this?”

I still like named booleans, because they tell future programmers what you thought the result of the conditional check meant, and in my own projects I’ll probably continue to use them. But I learned an important lesson at this code review: If you find yourself doing something the other developers don’t, because you “think you know better,” please reconsider. Or better yet, ask someone why they do it that way. But don’t sit in your cube, decide they’re wrong, and make the code a little uglier in the process.

Arrogance is a major obstacle to learning, and I’m glad I went through a code review before this particular instance of it went on any longer.

Here’s a thought: the next time you think, “this is an ugly method. I would have written a method that was elegant, and efficient, and easy to read, where everything had clear, even beautiful names. I could do so much better,” copy the signature of that method into a blank code file and try to write it better. There are only two possible outcomes of this exercise, and they’re both good: You’ll either come up with a better method, which you can suggest as an improvement. Or, and much more likely, you’ll realize that the problem that method solves is harder than you thought, and you’ll be a little more generous when you read code in the future. In both cases, you learn.

Till next week, happy learning!

-Will

 

Benefit of Courses: Externally Imposed Deadlines

How many times have you written a research paper soon (ahem, ‘immediately’) before it was due? Now, in contrast, how many times have you written a research paper just because? Or well in advance? The answers here tell us something important: deadlines boost productivity.

Much like the steep learning curve, the deadline is an oft-maligned but incredibly helpful productivity tool. If we know when something has to be done, we tend to do it.

I think deadlines were a major reason I learned so much more during year 2 than I did during the previous years. Coursera imposed real deadlines. Deadlines made me get that extra hour of work in when I really didn’t feel like it.

But what about the effortless font of creativity? After all, Beethoven, in all the movies, is so caught up in love of music that it just flows out of him, whether he makes time or not. Aren’t we all supposed to be movie Beethovens of code?

I think not. I’m not an expert on the real Beethoven, but I bet, at least once or twice, he had a cold and practiced hard anyway. I bet there were times when his symphonies were 3/4’s done and he was sick of them, and he finished them anyway.

Now, if you find yourself with a boundless font of creativity, by all means, work away. My point is not that you ignore the natural enthusiasm; that enthusiasm is why I started writing code in the first place. My main point is this: If you only work when you feel like it, and only do what you feel like, you will get less done than people with external deadlines get done.

A simple case in point: I started this blog in June. I posted twice. Then it sat for months and months. I love writing; there were times over the summer when I could have written for hours, but I didn’t. It’s not that I had no natural creativity, no enthusiasm during that time; it’s that I didn’t make it a priority because no one was going to care if it didn’t get done.

So, if you have something you want to get done, and no one is making you do it, take a class. Or make a schedule, and tell people your schedule. Believe me, once you have a deadline that is not within your control, you will become a lot more productive.

I restarted my blog thanks, in large part, to Simple Programmer, and their course on blogging for programmers. And let me tell you, there’s nothing like an external deadline to put your publishing schedule on track.

Till next week, happy learning!

-Will

 

Mindset Post: The Efficient Learning Curve

I really like graphs, both the data structure and the run-of-the-mill, let’s put some stuff on some axes kind of graphs, so when I hear about learning curves, I think about something like this:

stuff graph

So let’s graph our topic of discussion. Here’s the “Steep Learning Curve”:

steep learning

I don’t hear about the other kind of learning curve very often, but I suppose it’s a “shallow learning curve”, and it looks like this:

shallow learning

Boy, look at the difference! In the first graph, after 18 times, whatever those are, you have almost 800 learnings! In the second graph, you only have about 21 learnings. Sadface.

Bogus units aside, this leads me to an interesting observation: Why do we talk about steep learning curves as if they were bad? Doesn’t the first one look more fun?

Here’s the thing: Learning is good. Time is limited. In every other situation where we graph our ability to attain something good against our expenditure of something limited, steep curves are good. We never talk about a revenue curve that’s “too steep”. (Darn! The graph of this investment’s value over time curves too steeply upward. Better sell!) We never talk about an acceleration curve that’s too steep. (My car just accelerates too quickly! I’m going to trade it in for a ’98 Ford Taurus with a shallower acceleration curve.) So why does the learning curve get picked on? Why is it the only “good stuff over time or effort” type graph that’s not allowed to be steep?

I think it’s because a lot of people label the x-axis wrong. They label it “effort” or “how much this will suck” or “parties I will have to miss while studying.” But if I can convey only one message with my blog, this is it: Learning is fun, and learning about computers and how they work and how to change how they work is especially fun. So let’s throw out our pessimistic x-axis labels and get to work. We can label the x-axis “hours of sustained concentration” if you want. Now steep curves are back to being efficient, not bad.

There’s something I like to say to myself, when I am working on something that’s hard, like taking an algorithms class, or trying to get a really tricky piece of code to behave. My saying is: “You are now entering an area of highly efficient learning.” Doesn’t that sound nicer than the steep learning curve?

My point is not to beat your head against the most difficult thing you can find; rather, my point is to start looking for opportunities to master something that’s a little beyond you. Sometimes, at the beginning of an online course or a programming book, I can tell that I’ll need to learn a whole new way of thinking to get through the course. That’s when I get excited! I say to myself, “You sir, have just entered an area of highly efficient learning! Clear out your schedule, and focus hard! This is an all-you-can-eat buffet of interesting thoughts and creativity!”

Occasionally, after this burst of enthusiasm, I discover that I really do need to calm down and study something easier for a bit. (For example, I once signed up for a hard physics course without taking the math prerequisites. That didn’t work.) But most of the time, this burst of enthusiasm is followed by really learning a lot, and then feeling very happy with what I’ve accomplished.

What was the last book, blog post, online course, or whatever, that you took, that gave you the feeling that you were going to learn exponentially fast to get through it? Post your answers in the comments!

Till next week, happy learning,

-Will

Learning to Code, Year 2, part 2: Coursera Was My Job

After last year and the one before, I was off to a pretty good start. I had written a few automated processes that really made my life easier, such as a Python script that spat out vocab quizzes, and I had helped write a program that took old, gross ALL CAPS stories from a database and made them into non-screaming English.

Then the school year started. I missed the summer of writing code. I spent time when I should have been grading wondering how hard it would be to write a program that scored Latin translations. (Hint: it would be hard.) I got distracted during the day thinking about C# and Javascript. And then I realized that I really loved writing code.

A few minutes later, I realized that some people get paid for writing code. I could get paid for something I love to do! The problem I had was that I had limited money and no degree.

My first thought was to get a degree, then get a programming job. I got in touch with a computer science professor at the nearest university, and asked him what kinds of classes were pre-requisites to his program. He was very kind and helpful, and told me basically everything I would have to do in order to probably be admitted to a Master’s program in comp sci in  about a year.

Now the problem is that taking a year of random classes, part time, in order to then take two years of classes full time, is slightly less cost effective than selling home videos of your friends burning your house down.

But I had gained one important thing. I had this map of classes, what to take when, that would make me qualified to apply for an M.S. in computer science. I took this same map, and started trying to figure out how to cross it.

I discovered many of the same courses were available on Coursera for free. I thought that, maybe if I took some of them, I would be just as qualified for a programming job.

So I buckled down and made Coursera my job. I took algorithms classes that were too hard. I signed up for things left and right, kept the ones that worked and dropped the ones that didn’t.

To study, I did three things: I would get up an hour earlier than I had to for work, drive to the coffee shop nearest work, and study for an hour. After dinner, I would drive to the coffee shop nearest home, and study for an hour or two. And a third thing: On Saturday, I would drive to a coffee shop first thing, and work until I couldn’t stand it.

The hard thing about online courses is that you have to put in the hours. No one will ever ask you whether you did your homework. No one cares if you’re sick or absent. The awesome thing about online courses is that you get to take world-class courses from fantastic professors for free, from the most convenient coffee shop. That’s a fair trade, if you ask me. All that coffee was paid for in my first paycheck as a programmer, and I couldn’t be happier.

Year 2, part 2: Coursera Was My Job

After last year and the one before, I was off to a pretty good start. I had written a few automated processes that really made my life easier, such as a Python script that spat out vocab quizzes, and I had helped write a program that took old, gross ALL CAPS stories from a database and made them into non-screaming English.

Then the school year started. I missed the summer of writing code. I spent time when I should have been grading wondering how hard it would be to write a program that scored Latin translations. (Hint: it would be hard.) I got distracted during the day thinking about C# and Javascript. And then I realized that I really loved writing code.

A few minutes later, I realized that some people get paid for writing code. I could get paid for something I love to do! The problem I had was that I had limited money and no degree.

My first thought was to get a degree, then get a programming job. I got in touch with a computer science professor at the nearest university, and asked him what kinds of classes were pre-requisites to his program. He was very kind and helpful, and told me basically everything I would have to do in order to probably be admitted to a Master’s program in comp sci in  about a year.

Now the problem is that taking a year of random classes, part time, in order to then take two years of classes full time, is slightly less cost effective than selling home videos of your friends burning your house down.

But I had gained one important thing. I had this map of classes, what to take when, that would make me qualified to apply for an M.S. in computer science. I took this same map, and started trying to figure out how to cross it.

I discovered many of the same courses were available on Coursera for free. I thought that, maybe if I took some of them, I would be just as qualified for a programming job.

So I buckled down and made Coursera my job. I took algorithms classes that were too hard. I signed up for things left and right, kept the ones that worked and dropped the ones that didn’t.

To study, I did three things: I would get up an hour earlier than I had to for work, drive to the coffee shop nearest work, and study for an hour. After dinner, I would drive to the coffee shop nearest home, and study for an hour or two. And a third thing: On Saturday, I would drive to a coffee shop first thing, and work until I couldn’t stand it.

The hard thing about online courses is that you have to put in the hours. No one will ever ask you whether you did your homework. No one cares if you’re sick or absent. The awesome thing about online courses is that you get to take world-class courses from fantastic professors for free, from the most convenient coffee shop. That’s a fair trade, if you ask me. All that coffee was paid for in my first paycheck as a programmer, and I couldn’t be happier.