Home » Programming Best Practice » How to Become a Better Programmer

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 ProgrammingThe 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.Programming is relational, work on listening  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.As a programmer, 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.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?”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.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.We spend most of our day programming and like to solve problems. We 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.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 exerciseYou feel better when you exercise
  • Exercise will make you more confidentExercise 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 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.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 experienceHow people interpret what you say and do is influenced by their own experience
  • Say “thank you” whenever it is even remotely appropriateSay “thank you”
  • Find out what people want and give it to them (if at all possible)
  • Everyone wants to be God, treat them accordinglyEveryone wants to be God, treat them accordingly
  • Don’t let the perfect or the ideal be the enemy of getting started or good enough.Don’t let the perfect or the ideal be the enemy of getting started or good enough.
  • Improve by just 1%Improve by just 1%
  • Who do you want to be?Who do you want to be?
  • What is holding you back?What is holding you back?
  • Failure is good. It is how we grow.Failure is good. It is how we grow.
  • If you aren’t failing, you aren’t growing.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.

In what ways are you attempting to be a better programmer?  Leave me a comment and let me know.

 

Other post in Programming Best Practice

Related Post

  • 15 Ways To Write Beautiful Code [That Have Nothing To Do With Testing]15 Ways To Write Beautiful Code [That Have Nothing To Do With Testing] I got a question this last week that I answered very briefly but I felt that to answer it completely would take a blog post.  So here’s the blog post. Should the author of a piece of […]
  • I, J, and K Should DieI, J, and K Should Die One of the hardest things we do as programmers is naming things.  But the easiest thing to name is counter variables and most of us do it wrong several times a day.Of course, I’m […]
  • TDD Saves Time – A StoryTDD Saves Time – A Story I recently had an experience writing code that proved to me, once again, that using Test Driven Development really is faster than the way I have been working.You will remember a couple […]
  • 5 Reasons Learning Terminology Increases Your Effectiveness [As A Programmer]5 Reasons Learning Terminology Increases Your Effectiveness [As A Programmer] A couple of weeks ago I wrote a post “7 C# Interview Questions to Weed out Losers” which was my most popular post yet.  As of this writing, it has received over 13,000 views.  It also […]
  • DRY ProgrammingDRY Programming Today I thought I’d talk to you about the programming principle known as DRY.  As you may know, DRY stands for “Don’t Repeat Yourself” and it shows up in a lot more places than you might […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer focusing on ASP.NET, C#, Node.js, JavaScript, HTML, CSS, BootStrap, and Angular.JS.Does your team need additional help in any of the above? Contact Dave today.

One Pingback/Trackback

  • Good post!

    I believe what makes you a better programmer is all these small habits that you develop over time. This realization does not stop me to wish there is some magical “Silver bullet”, that will make me suddenly so much better. Truth is – it just does not happen. We always learn and each thing we do will lead to the other.

    I remember when I thought TDD is the “secret”. So I started using it – it was great! Suddenly I “discovered” the value of refactoring. That lead to the “discovery” of SOLID principles and, later, an interest in Functional Programming Paradigms. I wonder what is next in line 🙂

    I had a very similar experience with other, not that tech related stuff. 10 years ago I thought all that mattered is my personal skills. 5 years ago I was convinced process is what make organizations tick. It took me years to understand the value of culture and how culture>process>individuals.

    So the secret to become better – make sure you are always improving. Small things add over time, there are no shortcuts. Its hard work. But there is no other way 🙂

    • Yep, becoming a better programmer is all about becoming a better you.

  • I’m really glad you put the human aspect at the top of the post Dave.

    Always understated. We emphasise so much about the technical aspects of being a developer but if we’re honest to ourselves what sets us apart from being an average developer in the pack is our ability to handle the human side of our jobs. We need to be able to communicate with stakeholders.

    If we think of a hypothetical stuation where a potential client has a choice between a consultant who is technically slightly better than another consultant who is more amenable, they will almost always choose the developer who they think they will work better with – it’s just human instinct.

    Test-driven development for me has been absolutely essential as part of my development as an engineer over the past few years. It gives you new found confidence and allows you to refactor in a safe sandbox with safety nets everywhere. When I was asked by a member of Senior management at my work what the benefits of TDD were and if we could get away with doing less or none I said I would bet (£1,000) or my own money that the developer who uses TDD would allow fewer bugs into production. I was so confident this would be the case. I’m not sure anyone from management would have the guts to take me on. If developers are this confident it must be the right practise?!

  • Pingback: Automate the Planet()

  • Kevin O’Shaughnessy

    Great post Dave!

    TDD has certainly done a lot to help me with the technical side of things, but no single practice is a silver bullet so we must keep working to stay sharp and improve our code quality.

    As you say, the human side of things is so important. Communicating and empathising with others. I think this is really the key to improvement. There are so many other smart and passionate developers out there. Nobody has enough time to self-learn everything, but we can save others so much wasted time by sharing the key lessons with each other.

    It’s also important for motivation. Any of us can have a bad day at work: bad news from the boss, the customer, and the compiler can take the wind out of our sails. Finding the right people to inspire us can lift us back up again more quickly and help us keep improving.