razzi.abuissa.net

Razzi's guide to dealing with wrist pain

2023-09-22

This is going to be a little different than my usual coding guides.

Much like the episode of Is It Sh*t where Nat review’s depression and anxiety, I like to think I’ve become something of an expert in managing wrist pain while coding.

Here’s a summary of things I’ve tried, rated for effort and impact.

Note that this is my subjective personal experince: what worked for me, and what didn’t.

Summary

  category effort impact
limit work hours behavior *** *****
see a doctor professional help **** *****
modify keybindings software **** *****
swimming exercise ***** *****
break reminder tool software ** ****
learn your editor software **** ****
low profile keyboard hardware * ****
split keyboard hardware ** ****
read a book professional help ** ***
adjustable desk hardware *** ***
ambidextrous mousing software *** ***
avoiding the mouse software *** ***
yoga exercise **** ***
rock climbing exercise **** ***
wrist stretches exercise ** **
aerobic activity exercise *** **
wrist ice packs hardware ** *
alternative keyboard layouts software **** N/A
thumb-oriented ergonomic keyboard hardware ***** N/A
voice coding software ***** N/A

My story with RSI

I first felt wrist pain as a sophomore in college. I was 19 years old. I had always spent a lot of time at my computer, but it kicked up a notch when I took my first computer science class.

I felt a burning sensation in my right wrist that got worse the longer I typed at my keyboard. Which was a real problem, homework assignments took hours of typing, and projects could take dozens of hours. And they had deadlines.

After about a month of feeling the pain, I saw a doctor, who told me I had RSI. I don’t remember what exactly he recommended, but we talked about ergonomics and painkiller/anti-inflammatory medications. I told my professor I needed an extension on the homework assignment, which she granted (lesson: communicate your issues). I felt this was going to be a recurring issue, so taking medicines to reduce the pain didn’t seem like a long-term solution. But they are certainly out there, and they might help you in your situation.

I finished the homework assignment with the extension, but my wrist pain kept getting worse. As I added to my computer science class load, I simultaneously added coding projects which would routinely have me on my computer around the clock.

At the time, I was coding on my laptop on a desk that wasn’t designed for computers. Knowing my keyboard to be part of the problem, I purchased my first ergonomic keyboard, the Kinesis Freestyle2. To this day, this remains one of my favorite ergonomic keyboards; I’ll put the full description in the section on split keyboards. I set it up on my desk with a Rain Design laptop stand and an external monitor, which helped my posture as my screens were closer to eye level.

That setup served me pretty well for my remaining college years, including a full-time coding summer internship before my last year in school. Even at that internship, I remember talking to a designer and another software engineer about wrist pain: the designer in particular was feeling it, spending all day clicking and dragging to produce visuals. I had another cool coworker who had attached his wireless keyboard to a piece of wood and which he hung over his shoulder with a guitar strap, which was a cool way to rock the standing desk (I tried this later myself but it felt like all the blood ran to my hands and I gave up). That same coworker introduced me to the Keyboard.io Model 01 (I got one of those too, but found its learning curve too high and never really invested in it).

My wrist pain would flare up occasionally, but overall I was able to stay on top of it at that time. It also helped that I was an otherwise mostly healthy, in my early 20s, and outside of coding was staying physically active with yoga, dance, and swimming.

My first job: things got bad

I started working at a small startup right out of college, where my RSI got to an unbearable level. We were working long days and even working on weekends, building a product from scratch. As my time working at the keyboard increased to unsustailable levels, my self care diminished. I quickly became irritable at work, lashing out when a coworker would requested changes, since I knew that would require me to type more.

I ordered ice wrist wraps online and started taking breaks from coding to ice my wrists. It gave me some relief but the cold also made my wrists feel more sensitive, and while they were still cold my hands moved slower and felt less coordinated. If you give icing a try, it’s probably best to do at the end of the day, or at least to give your arms time to warm back up before you get back to typing.

One image stays with me from this time: me sitting outside on the curb with big blue wrist wraps on either wrist, and the CEO of the startup walking past me, acknowledging I was struggling and in pain. But we were all inexperienced, and the worload was unrelenting.

My next job: things stayed bad

I quit that first job shortly thereafter. I left for other reasons, but it certainly didn’t help that the work I was hired to do was physically painful, and the pain increasing in intensity and frequency. But I kept coding and applying to jobs, and in a few weeks I was hired to a new software engineering position.

The new startup was more mature, with around 25 employees rather than my previous one’s 5. For a while I was able to code without much issue, though I was trying to impress my coworkers and had to manage my wrist pain as I sometimes worked later into the evenings. Overall the work life balance was much better. But there were a couple instances when aggressive timelines had me working additional hours. With the extra time at the keyboard came the pain, and with that, my snappy attitude.

I asked my office manager for an ergonomic evaluation, which provided some useful information. More than anything else I wanted to express my pain and frustration, as my wrists (especially my right one) kept getting worse. One thing I realized from the evaluation was that my desk was actually too high: my arms were being kept raised by my desk. I put in a request for a standing desk, and eventually got it (though it took several frustrating months). The standing desk could go lower than the desk I was using before, and my arms could relax.

Around this time I had a friend who was also suffering from wrist pain, and he gave me several tips which made a big impact. The biggest one was software that I configured to make me take breaks every 45 minutes, and also limited my typing hours to 4 hours per day. That software is called RSIGuard. It costs $65 and doesn’t have the prettiest UI but it really helped me. I also started investing effort in minimizing the effort it took to code, by configuring my editor and development environment for ergonomics. That was huge as well.

I think after a MacOS upgrade RSIGuard stopped working so I started using BreakTimer instead. It has fewer features than RSIGuard but it does the job reminding you to take breaks.

After years of trying stuff, things got better

With the myriad changes I made, I have been able to enjoyably write software for the last few years. I still have a bit of emacs pinkie in my left hand, and I’m sensitive to pain in my wrists. But fortunately with the career choices I’ve made and my development as a software engineer, I feel like I have gotten a handle on my wrist pain. Below are explanations for some of the ideas I’ve already mentioned, and other things that help me write code without being overwhelmed by pain.

Wherever you are in your coding ergonomics journey, I hope you find something useful. Know that you must prioritize your own health: nobody else can do that for you. For all the pain and trouble I’ve had using computers, I still recognize that many jobs out there are less forgiving to your health. You might not be able to bang out code as quickly or for as many hours the day as you’d like; computer use and being sedentary is generally not good for you. But there is a balance to be struck of adjusting your environment and behavior to do what you want to do in a sustainable way.

What I’ve tried

Limit work hours ^

Effort: medium. Impact: highest.

It’s no surprise to me that my wrist pain was worst when I was working most. And that it improved the most when I let my wrists rest.

Nowadays I don’t think about my wrist pain all that often, but when it was at its worst, I used RSIGuard to limit my work computer use to 4 hours per day, and minimized my personal computer use. It turned out that the time limit had an additional benefit of making me really focus; I was just as productive in those 4 hours + breaks as I was before I limited my work hours.

At a certain point of skill and at a certain level of company maturity, it’s less important to write thousands of lines of code, and more important to invest in your coworker relationships, read books and media to improve your skills, and go to the whiteboard or notebook to draft designs.

So don’t worry too much about limiting your keyboard hours. Focus to get done what you need to and then step away from the keyboard to give your body a break.

See a doctor ^

Effort: high. Impact: highest.

You should see a doctor if the pain is persisting or getting worse. They might not be able to solve your problems but they are a great resource. Make best use of your time by coming up with questions in advance. If it’s really bad, they might even recommend surgery, though generally as a last resort; hopefully they’d talk about risks, but it’s possible surgery could even make things worse.

Modify keybindings ^

Effort: high. Impact; highest.

I could write a whole series of posts about making the most of keyboard shortcuts (and I hope to). But the logic here is very simple: press fewer keys with stronger fingers (thumbs are strongest, pinkies are weakest) and you’ll give your hands a break.

I recommend making the command (alt on linux/windows) your primary keyboard modifier as you can press it with your thumb, and either thumb. Even on linux and windows, you can customize applications like Firefox to use alt as the default modifier key, or potentially remap alt to control at the system level.

Use both sides of your modifier keys so you’re not holding shift with your left hand and awkwardly stretching your hand to hit another key.

I also recommend looking into key-chord style keybindings; Spacemacs for example lets you press (and release) space, then h, then space again (SPC h SPC) to do what another editor might put under command+shift+h.

If you’re not using vim already, try adding vim keybingings to your editor. It takes a while to get fluent in vim, but moving by words, lines, and by search is much faster and takes fewer keypresses than arrow keys or emacs-style control key shortcuts like control-b to go backwards a character. Those control key shortcuts are useful in moderation, but vim’s normal mode is great for keyboard productivity.

Generally, pay attention to what keyboard actions you perform most or that have awkward bindings, and customize them. Use big keys like space liberally. Experiment with shortcuts like “press and release alt to send escape” so you don’t have to reach for the escape key with your pinkie.

Stay tuned for more concrete examples of ergonomic keybindings and example code.

Swimming ^

Effort: highest. Impact: highest.

I swam in high school, so I already knew a basic swim exercise routine; if you are new to swimming you might benefit from a class, or at least asking a friend to help you get set up.

Swimming is great exercise. It’s light on the joints, engages many different muscles including those that tend to get ignored, and you can do it year round at an indoor pool.

The single best thing I ever did for my wrists was swimming in the ocean. Besides getting me off my computer, the cold water, the vigorous exercise, the euphoric sauna afterwords at the Dolphin Club and the connection with nature were so good for my health (I have since moved out of San Francisco, so nowadays it’s more of a once-a-year type of activity).

Even if you’re not swimming in cold ocean water, swimming is an incredibly healthy activity for the the whole body. But it takes a lot of effort, so I’m rating this high-effort-high-impact.

Break reminder tool ^

Effort: low. Impact: high.

RSIGuard also came with a break reminder tool, which would give me a stretch to do every 45 minutes. The stretch would only take about 30 seconds but it would leave me feeling much better over the course of an 8-hour day.

Generally it’s wise to take some time away from the keyboard. Take a break and go for a walk, talk to a coworker, get a drink. Just don’t get off your computer and immediately get out your phone. Though the ergonomic profile is different, phones also have screens and keyboards - take a break from those too.

Yoga ^

Effort: high. Impact: medium.

While vinyasa yoga is great for your overall health, especially flexibility, there were times when it felt like poses were hurting my wrists, especially things like plank.

Over time I learned modifications like lowering onto my elbows in plank pose and doing dolphin pose over downward facing dog.

Yoga has been great for my overall physical and mental health, but when it comes to my wrists, some poses helped, some might have hurt, and some don’t really deal with the wrists.

Yin yoga, on the other hand, always made my joints feel better and more supple; I recommend looking into that specifically.

Rock climbing ^

Effort: high. Impact: medium.

As long as you don’t overdo it and injure your wrists climbing (which is very possible), rock climbing is a great opportunity to stretch and strengthen your hands and wrists.

It’s for other reasons as well but it’s no surprise to me that climbing is popular with programmers.

Low profile keyboard ^

Effort: lowest. Impact: high.

The keyboard I ended up using most was a simple rechargable (second generation) wireless Apple keyboard, which felt productive and satisfying, and I felt was also pretty darn ergonomic since it is such a low profile. Not having to curl my fingers up has been a big win.

With a nice low keyboard, I am able to type without having to hover my hands or curl my fingers up.

This might not be the most ergonomic by the textbook, but the overall feel and productivity are important to me enough that I ended up sticking with the Apple keyboard the longest.

The bottom line: a laptop keyboard is unlikely to be great ergonomically, and it’s an easy peripheral to change, so experiment around.

Split keyboard ^

Effort: low. Impact: high.

Split keyboards are nice because they allow you to relax your shoulders and keep your hands apart, and mine, the Kinesis Freestyle2, could tent which would change the position of your hands and take some of the twist out of your wrists. I gave my old one away but if my wrists were in worse shape, I’d consider buying such a keyboard again; for the time it was a game changer.

Learn your editor ^

Effort: high. Impact: high.

This is a whole subject unto itself, but some things to think about:

Completion

Chances are, you’re going to type a symbol that’s already in the code, like the name of a class or function. Set up tab completion, and learn how to use lightweight word control+n / control+p completion and even line completion if you’re using vim.

Snippets

Snippets are also a great way to save typing. If you find yourself typing a lot of boilerplate, put it in a snippet, and track your snippets with your editor config.

For vim you can use https://github.com/SirVer/ultisnips.

Macros

Save yourself typing on repetitive edits with macros.

I learned vim macros through Practical Vim.

Macros are often quicker than taking the time to write a function in your editor and binding that to a key, since you can define them on the fly.

Automation

While full-fledged automation like continuous integration can save a lot of work in the bigger picture, what I mean here is setting up simple developer tooling to do things like automatically refresh your web app when you save your files, or re-run the tests.

Taking time to make and maintain build tooling is generally a good way to avoid typing long, error-prone commands in to your commandline. Save yourself typing and thinking, but don’t spend too long on your tooling or you run the risk of yak shaving.

Ambidextrous mousing ^

Effort: medium. Impact: medium.

Rather than using a traditional mouse or my computer trackpad, I bought a wireless trackpad, and put it on the left side of my computer.

Since my right wrist was always more of a problem, using it with my left hand gave my right side a break. It took me some time to adjust to this but I don’t tend to use the mouse much anyways.

I also recommend making the trackpad high sensitivity so less hand movement will yield more cursor movement. Again, this takes some getting used to.

Avoiding the mouse ^

Effort: medium. Impact: medium.

Using the mouse isn’t inherently bad, especially if you switch off hands on the mouse (see ambidextrous mousing), but not having to move your hands between keyboard and mouse is a win for your hands and a win for productivity.

I rarely use my mouse nowadays due to using text-oriented editors like vim, command line interfaces like tmux as my IDE, and vim keyboard shortcuts in my web browser using Vimium.

The only time I really need my mouse is if I’m using a graphical program like inkscape or blender, or using something like developer tools.

Adjustable desk ^

Effort: medium. Impact: medium.

Having a desk that could convert to standing was nice, but the bigger win for me here was having the desk able to get low enough that my arms could relax by my side when I was typing.

I was at my best working full time in software when I would:

Generally moving your body around and distributing the effort is good.

Read a book ^

Effort: low. Impact: medium.

I read part of Joe Kutner’s The Healthy Programmer and appreciated some of its resources, though it is less about wrist ergonomics and more about whole body health, which thankfully hasn’t my issue. But health resources are out there. Reviewed and published media is likely to be higher quality than random articles on the internet (especially beware information that is used to sell a product). But thanks for reading my blog anyways! :)

Wrist stretches ^

Effort: low. Impact: low

Taking breaks is great (see above) and if you do wrist stretches at work you’ll be taking a break, but in my experience just doing wrist stretches randomly never seemed to help me with the pain I was feeling. I think there’s more benefit to be had here, but I’d probably have to talk to a doctor to understand when and how to stretch my wrists properly.

For the record I would mostly do the one where you pull your fingers up or point your fingers down, and to rotate your wrist. Again in my experience these motions would tend to be discomforting when my wrists were at their worst, so be careful and listen to your body (and the professionals) when it comes to stretching.

Aerobic activity ^

Effort: medium. Impact: low.

Staying healthy through aerobic activity is always a good thing, and I have a background in sports and physical activities so it’s something I’m used to. The impact isn’t all that high on your wrists specifically but getting away from your computer to jog or bike is a good break to take, and will improve your overall health and circulation.

Wrist ice packs ^

Effort: low. Impact: lowest

I mentioned these wrist ice packs in my RSI story above; to me they’re an iconic part of my exploration, though I ended up throwing these away.

I’ll just lazily quote what I wrote above:

It gave me some relief but the cold also made my wrists feel more sensitive, and while they were still cold my hands moved slower and felt less coordinated. If you give icing a try, it’s probably best to do at the end of the day, or at least to give your arms time to warm back up before you get back to typing.

Thumb-oriented ergonomic keyboard ^

Effort: high, impact: N/A (gave up before productivity)

I’m lumping the Kinesis Advantage and Keyboard.io Model 01 here: keyboards that move the keys around significantly and do more with the thumbs. I never owned an Advantage, but I tried using others’.

In theory this is great as the thumbs are strong, and moving keys to where other fingers don’t have to reach is a win as well, but after several hours of trying I couldn’t get in my code flow. Instead I redoubled my efforts on reducing the number of keystrokes necessary rather than radically changing the keyboard.

Alternative keyboard layouts ^

Effort: highest. Impact: N/A (gave up before productivity)

I tried to use dvorak and colemak, but I never got over the learning curve. Using my editor was a non-starter as the hjkl muscle memory of vim was lost; I was hunting those keys all over my keyboard.

Apparently there are keyboard layouts for programming that preserve things like hjkl, but instead of trying to type single characters faster, I put my effort into typing fewer keystrokes and using completion.

Voice coding ^

Effort: highest. Impact: N/A (gave up before productivity)

Another experiment that didn’t make it over the learning curve. I watched Tavis Rudd’s great video; it really looked like the future. To be fair the value proposition is huge here, and some people make it work.

I tried using Dragon alone, using ill-fated voicecode.io, MacOS built in audio recognition, CMU Sphinx, and Kaldi, but none of them worked well enough for me. Since we’re dealing with technical writing (programming) here, don’t expect anything to work out of the box.

If you listen to Tavis, you can tell he’s put a lot of effort into this. Fortunately for me, even when my wrists have hurt, I haven’t had to give up on keyboards entirely. But voice coding is still something I’m interested in.

At that time when I was losing interest in voice coding, Talon had just come out. That’s my advice for where to start on voice coding.