Dave's Notebook

How to Become a Better Programmer

ppl-men-058

As you advance in your career, you will inevitably want to improve as a programmer.  And as you search the Internet and read various web post on the subject you will also inevitably end up with a bunch of task you should perform that will make you better. For example, if you’ve been following this blog lately, you’ll notice that I’m a big proponent of Test Driven Development.  You would naturally expect me to state that to be a better programmer, you should practice Test Driven Development. There has also been a lot of emphasis recently on good basic programming principles like DRY and SOLID. The list could go on.  Here are a few you may be interested in experimenting with:

  • Code Reviews
  • Paired Programming
  • Learn and Implement Design Patterns
  • Reduce Method/Class Complexity
  • Practice Code Katas
  • Participate in the Community
    • Start a Blog
    • Participate on StackOverflow
    • Read and  Comment on other people’s Blogs

And while all of these and more are good ideas, none of these ideas will actually MAKE you a better programmer.  Why?  Because becoming a better programmer is mostly about becoming a better person.

The Human Side of Programming

You see, as much as many of use would like it to be otherwise, programming is a relational occupation.  I think, when I started, I was attracted to programming both because I liked programming and because it seemed like something I could do without too much interaction with people.  I because a consultant because I wanted to be my own boss.  But I quickly found out in both cases that in running away from relationships I was running smack in the middle of them.  We have to talk to clients to get the requirements.  We have to ask good questions.  We have to argue for what we think is right without alienating other people.

And that being a consultant thing?  I found out pretty quickly that no matter what you do, there is always someone in charge.  If you have multiple clients, you have multiple bosses.  Being your own boss is a myth.  Fortunately, I like consulting for other reasons.

Listen

Because programming is so relational, much of programming requires communication.  So the first thing we all need to work on is our listening skills.  Don’t go into a meeting with any preconceived idea of what the answers should be.  If you have a tendency to talk a lot, be quiet.  I’ve found that if I keep my mouth shut long enough, eventually others will say the same thing I was going to say.

Killer Questions

When you do talk, ask questions.

I have a friend who says, “You’ll never own the answers if you don’t own the questions.”  So, don’t tell anyone anything that you can’t lead them to with questions.  Yes this takes longer but, it does two things for you.

First, it makes you sound interested in what the other person thinks.  This only works, of course, if you really are interested.  The questions are just a way of helping you express the interest that you already have.  You can’t make interest a formula.  But, I would say that many people who are interested don’t sound interested because they only know how to state things.

Several years ago, I learned about “Socratic Questioning”  These questions are designed to get at the person’s thinking process.  Sometimes, just in asking the question, the person will realize they don’t know why they think what they think.

I remember the gist of this by using these four questions:

  • What do you mean by…?
  • How do you know…?
  • What difference does it make?
  • What if you’re wrong?

The danger is in using these questions to win arguments.  I would suggest that instead you use them to understand where the other person is coming from.  Remember, these are questions to help you listen, not to help you win.

“What I think I heard you say…”

I just learned this one recently and I’m still learning to incorporate it.  It is the follow up statement to Socratic Questioning.  This is your chance to make sure you’ve understood what the other person said by repeating what they’ve said in your own words.

It is a funny thing about language, but people can use the same words and mean two entirely different things.  Have you ever had a situation where you’ve said something with absolutely no malice intended and the other person was offended?  That’s because we hear things based on our past, what happened previously in the day, and the stuff we are worrying about.  People are funny that way.

The Golden Rule

OK, so everyone knows the golden rule, right? “Do unto others what you would have done to you.”  But, I’m going to put this in new terms.  “Everyone wants to be God.  Will it kill you to let them continue to think they are?” Yeah yeah, I know.  They aren’t God.  But, we all want to be.  And all conflict starts because my desire to be God is conflicting with your desire to be God.  To eliminate conflict one of us has to admit that we aren’t.  You can’t control the other person, so the only way to solve this is for you to admit that you aren’t God.  But even better if you go ahead and treat the other person like they are.

Diet, Exercise & Sleep

You may wonder what your health has to do with being a better programmer.  Especially if you don’t pay any attention to these things now.  But here are a few things I’ve noticed as I’ve started to pay more attention to my own health.

  • I think better.
  • I’m not as tired during the day.
  • I’m not as tired at night.
  • I can get more done.

I’ll leave exactly what that looks like to you.  But, for the curious, here is what this looks like for me.

High fat, low carb diet (HFLC).

I started HFLC because I wanted to loose weight.  I was able to loose 30 pounds in a year.  But, what I found is that many of the health issues I had been experiencing were ultimately caused by the carbs I was eating.  I used to get headaches periodically that would last all day.  I guess they were migraines?  They were never diagnosed.  All I know is that I didn’t have one the whole year I was on a strict HFLC diet.  I also found out that my lactose intolerance was cured by this diet.

Strength Training

One of the things I found out when I was dieting was that strength training helps burn calories even when you aren’t exercising.  So I added modest strength exercises into my routine in the morning.  John Sonmez has convinced me to add a cardio element to my routine in his book, Soft Skills.  Since I know that my resistance to discomfort will keep me from running when it is raining, hot, or cold, I’m looking for a treadmill or an elliptical machine so I can start C25K.

Sleep

Sleep has never really been an issue for me.  I was once asked, “what keeps you up at night?”  My response, “Nothing!”  Seriously, I can sleep in the middle of the living room with all kinds of stuff going on.  And while I do have particular things I “worry” about, I don’t worry about them when I’m supposed to be sleeping. But, I was finding that I was kind of sleepy during the day a lot of times.  That’s odd because I tend to get a good seven and a half hours of sleep and I’m pretty much done sleeping by the end of the time period.

Then I found this app called “Sleep Cycle” that wakes you up before you fall back to sleep.  After a couple of weeks using this, along  with getting up at the same time every morning even on weekends, I’m much less likely to be dragging by the end of the day.  I find that people either love this app or hate it.  It has some other features that I don’t find very useful.  Like it tells me I had a N% good sleep.  I’ve never achieved better than 85%.  Last night it gave me a 50% score.  But in both cases, I don’t get tired until an hour before I plan to go to bed.  I’m not sure it is very accurate.  It also checks your heart rate in the morning.  But, that using the flash on the phone which bothered my wife so I’ve stopped using that.

Don’t Be So Critical

I think because we spend most of our day programming and naturally like to solve problems, we tend to come off as critical.  We probably are.

Ever thought or heard things like, “The boss has no clue what he’s doing.”?  “This place would be better if…”  “If only they’d …” Here’s something to think about.  If you know so much, why don’t you start your own company? Here are a few things I’ve learned over the years.  They’ll seem obvious once I state them, but I think we forget.

My Boss Has a  Boss

I can’t tell you how many times when I’ve actually asked my boss to explain something, the answer has been, “that’s what my boss wants”

Everyone Is Doing The Best They Can

I know this may come as a shock.  But seriously, most people, while not perfect, aren’t deliberately thinking, “how can I make everyone’s life difficult today?”  Often the thing we look at as a stupid requirement or a stupid rule is because someone in the organization is trying to solve a problem and this is the best solution they could come up with.

Everyone Has a Life

I think we forget, while we are at work, that everyone has a life outside of work.  The kids get sick.  Our important relationships are strained or worse.  We were abused as kids and we are trying to deal with the psychological impact that’s had on us AND hold down a job at the same time.  The real sock is that many times the person who we find difficult doesn’t even know they have issues.

When ever I find someone who is difficult, I always wonder, “What history got them to be like that?” Not that we use our history as an excuse.  But I think that if we knew what was really going on, we’d be a bit more sympathetic.

Fail

One of the tenets of Agile is “Fail Fast” and yet the one thing we hate to do as programmers is to fail.

I used to say, “Programmers are either the most well adjusted or the craziest people in the world.  Think about it!  We spend eight hours a day in front of an inanimate object that mostly tells us that we did something wrong.  We can’t even argue about it.” But really, we tend to do what’s safe.  When is the last time you did something really risky?  As I’ve been pushing TDD on those of you who believe you can’t do TDD where you work, what I’ve really been saying is, “Take a risk, do it anyhow.” Or what about starting a blog, or speaking at a users group meeting?  There are multiple ways you can risk.

If you aren’t failing, you aren’t learning.

Smile

You’ll feel better and people will enjoy being with you more.  Even if you have to fake it, intentionally smile three times a day.

Daily Reminders

Maybe you’ve heard about daily affirmations.  I’m not a big fan of affirmations.  I’ve tried them, but then my wife pointed out to me, and I’ve had it confirmed by another source, that affirmations essentially make you lie to yourself because you are stating what you want to be true as though they already are true.  This causes tension within you that makes it difficult for this to work.

In, I believe it was, the 1800’s they did this thing called “Resolutions” which were statement of what you would put your effort into.  This gets a bit more to the point.

But, I just call them daily reminders.  Things I want to remind myself about.  Much like affirmations and resolutions are designed to do without all of the weight. Here are some of mine so you get an example of what they look like:

  • You feel better when you exercise
  • Exercise will make you more confident
  • What do you mean? How do you know? What difference does it make? What if you are wrong? What would you accept as evidence?
  • What are you thankful for?
  • What I think I heard you say is …
  • Carbs will eventually give you a headache and will eventually kill you.
  • Just because someone says something is true, doesn’t mean that it is.
  • How people interpret what you say and do is influenced by their own experience
  • Say “thank you” whenever it is even remotely appropriate
  • Find out what people want and give it to them (if at all possible)
  • Everyone wants to be God, treat them accordingly
  • Don’t let the perfect or the ideal be the enemy of getting started or good enough.
  • Improve by just 1%
  • Who do you want to be?
  • What is holding you back?
  • Failure is good. It is how we grow.
  • If you aren’t failing, you aren’t growing.
  • Worry about success

I also have reminders on my computer screen.  Pictures or “motivational posters” that remind me of various things.  For example, I have a screen sized smiley face to remind me to smile.

So there you go.  This post ended up being a lot longer than I thought it would.