DEV Community

Cover image for It's a Marathon, Not a Sprint
Andrew (he/him)
Andrew (he/him)

Posted on

It's a Marathon, Not a Sprint

I hated running in high school. But our dad made me and my brother stay involved in sports to foster a healthy lifestyle which has -- to his credit -- persisted with me to this day. I was a member of the Cross Country Running team sophomore year but skipped the second half of the season because I couldn't be bothered to do it. I remember one meet I was the second or third slowest kid to finish out of a few hundred from all the nearby school districts. I just had no motivation to practice, and it showed in competition. My dad, frustrated, said we could either do a sport or get a job (so long as we were occupied for a bit after school hours). I immediately got a job and thought, thankfully, that I would never have to run a 5k again.

But last year, I signed myself up for a marathon in beautiful Connemara (cover image), on the west coast of Ireland. Running is probably the easiest and cheapest individual sport you can do and it's a good way to get exercise if you don't want to work around a team sport's schedule or lift weights at the gym three to five times a week. That marathon is this April and I'm currently on a 16-week training plan to get in shape for it.

What bored me in high school, I think, is the endurance aspect of long-distance running. Sure, there may be some scenery and you may be able to listen to music, but for the most part, you're alone with your thoughts while you're running. It's hard to stay motivated when all you're doing is left foot, right foot, left foot, right foot over and over...

Sometimes, I feel that way about software development, too. But with both running and programming, I need to remind myself that...


You Absolutely Must Practice

No one wakes up in the morning and decides to run a marathon without having trained for it.

...or, if they attempt it, they have a really rough time at it and maybe don't finish. The same goes for software development -- not one person has ever woken up in the morning and become a programmer with zero practice. It takes months of practice to become a decent programmer and years of practice to become a really good one. You simply have to put the time in, there's no way around it. That might lead to another issue, of course...

It Might Get Boring Sometimes

Every day, new parents have their lives turned upside-down by their infants. It's a monumental change, going from a life where you can do (almost) anything that you want to do at a given moment, to one where your whole life revolves around taking care of an infant who can't take care of themself. It can be incredibly difficult and disorienting. But -- for fear of public shaming or personal guilt -- many parents are loath to admit just how hard it is.

But it's okay (and healthy) to admit that you're having a difficult time, or to ask for help, or to admit that maybe the thing that you've worked toward for so long is a lot harder -- and maybe a lot less fun -- than you expected. It's okay to admit that you're bored with your work, even if you thought it would be your dream job. Sometimes, we need to do boring, repetitive things. Computing is supposed to help minimise how often that happens, but those tasks are still out there and we still have to deal with them occasionally.

Writing documentation is one thing that is extremely tedious to me. I know it has to be done, but it can be really repetitive and boring and I know how my code works so does it really matter? Marathon training requires you to run somewhere around 30-40 miles per week, every week, usually for a few months prior to the race. Even at a decent pace, a 10-mile training run can take an hour and a half. Doing this multiple times a week -- especially indoors, on a treadmill, in the winter -- can be mind-numbingly boring.

You can remedy this by switching things up. With running, you could run a different course, or you could listen to a podcast, or you could time yourself on different intervals. One thing I'll do on the treadmill is set myself mini-goals of 1/4-mile or 1/2-mile intervals. Breaking a goal down into smaller steps is a great way of making it pass more quickly.

You can switch things up while programming, too. Maybe take a break from your regular work to explore a new programming language. Read a blog post about a new piece of software you've heard about but haven't played around with yet. Diagram your code to get a big-picture view. There are lots of things you can do to break up the monotony. And if you come across one method that really works for you, you might find that...

Sometimes You'll Get In A Groove

When you run frequently, you learn your pace in steps per minute. Mine is usually around 150-155. Like a lot of runners, I have a playlist of songs that are right around my tempo and one thing I'll do to keep on track is listen to this specific playlist. The songs get old after a while but the beat is just right and it keeps me focused on running, so I can ignore any other distractions.

Sometimes I get in a groove with programming, too. I'll find that I just want to finish this module so that I can incorporate it into this other one so that I can add this UI so that I can test this reactive code... One thing leads to another leads to another and before I know it I've written 1,000 lines in one day. I think it takes a bit of time to know a language well enough to be comfortable jumping from bit to bit like that, but once you're at that level, it's really satisfying to watch things flow naturally. Whether you listen to music while you code or have Netflix on in the background or work in complete silence, remember that...

There Is No "One Right Way"

I bought my first pair of expensive running shoes a few months back, from a running shop here in Dublin. They were about 5x the price of my previous pair of shoes, some Skechers that I bought from a department store. I have to tell you, I can't really tell the difference between the two pairs of shoes. They did a gait analysis at the running shop and claim that they've improved my form, making me less prone to injury, but I don't feel any different, or faster, or less tired. The difference is probably negligible.

I could just have easily run with my old, cheap shoes, and probably achieved roughly the same results. Some runners wear expensive shoes, and some wear cheap ones. Some wear those weird foot gloves (with the individual toes), and some go barefoot. None of these options are inherently better or worse than any other. As long as your form is good, you can run just as fast and just as safely with most kinds of footwear (or lack thereof).

The same goes for coding. As long as you're not doing anything unsafe (no SQL injection vulnerabilities, no infinite loops, no out-of-bounds array accesses) and you're getting the job done, there's little difference in how it gets done. There are more and less elegant ways of writing code, and more and less appropriate languages for certain tasks (try rewriting the Linux kernel in Whitespace), but ultimately, the job of the programmer is to make things easier for the end user. If the user can do what they want to do in a reasonable amount of time, it doesn't matter if you used vim or VS Code or tabs or spaces or for loops or lambdas. The end result is the important thing. Do whatever feels right.

But the most important thing, I think, that running can teach about programming is that...

It's a Marathon, Not a Sprint*

Assuming you're in your 30s now, you've got -- statistically -- a good 40 to 60 years ahead of you. That's lots of time. Nobody expects you to know everything there is to know about your chosen language or framework at 20 or 25 or 30. People google things every day, even experts. Even simple things. I always forget, when making a soft link in Linux, if it's ln -s <src> <dest> or ln -s <dest> <src>. Do you know, without googling?

I have a big list of things I'd like to learn. I want to get better at Haskell. I want to learn Assembly. I want to re-build my website with a reactive JavaScript framework. I want to read more books on software development and UI/UX and design. I want to travel. I want to improve my French. I want to own a minimum** of two dogs.

But I'm not going to go out and do all of these things tomorrow.

It takes time. You've got to plan and practice and be patient. Don't get overwhelmed by the amount of stuff you want to learn and just enjoy the process of learning. One day at a time, one step at a time.


* Note: does not apply to actual sprinting.

** Absolute bare minimum. Dogs >>>>>>>>

Top comments (3)

Collapse
 
vintharas profile image
Jaime González García

That's a really healthy way of looking at programming and life :D Thanks for writing about i!

Collapse
 
awwsmm profile image
Andrew (he/him)

Thanks! It's hard to stick to sometimes, but it's just something I keep having to remind myself of. It's easy to try to do everything all at once and end up getting nothing accomplished -- better to stick to one thing for a few weeks or months in order to really understand it.

Collapse
 
vintharas profile image
Jaime González García

Particularly in these times with the infinite proliferation of content and FOMO :D