Featured

On Typing

I break the silence to speak about an important issue, that so many of us disregard: Repetitive Strain Injure (RSI).

I confess that never believed one could ever get hurt from something so trivial as typing, nor that there could be right and wrong ways to do so. But today, as I type with excruciating pain these words, I found myself wondering how something so potentially harmful can happen without us realizing so.

I developed recently the symptoms, after a very intense and prolongued coding marathon. I was so excited with the results, and progress, that I kept pushing day, even nights on coding, always one more hour, eating on the run, you know the drill.

Suddenly, I started to feel a stiffness on the fingers. I ignored it at first, that soon turned into pain to do everyday things, open a bottle, open a door. I had heard about RSI, but not fully undertood how serious that was. That was about the time I switched hands to the right, and hunt-and-pecked with the less injured hand.

Soon I had to take breaks, and even longer breaks, simply to use the computer without pain. Even my right hand now seemed to hurt. Eventually, I said enough was enough and took some days unplugged, mostly reading books.

You see, for me, that used the computer every day for the past 20 years, to be without it is simply unnaceptable. I’ve come to rely on it for too much, both professionally and as a past-time.

Looking for alternatives, I came across using virtual keyboards and dictating with Google Docs. I must say, if you have no other choice, it can free your hands to do some conceptual work and discussions there. But it cannot exactly allow you to code. I also came across Kinesis Advantage2 keyboard, and I hope to some day purchase it if avaiable in my country. I ended up buying a better keyboard and a trackball on local market. I always went cheap on these things, as I said, I though they were unimportant.

A cautionary tale: I’m not a doctor, nor do I claim to be one. What I present here is what was found from sources that I’ve considered reputable, as much a layman can tell. If you do have a serious condition, don’t hesitate to seek professional help.

I did take a step further, and actively searched for things that could improve the ergonomics of my humble office. Harvard RSI, a college website has great information on the subject.

Start with the basics, set you chair so that your elbow for a right angle,  your knees also at right angles, distance eye-monitor (65-75cm), center screen and keyboard in front of you, center any feet support if present (I find that mine drifts to the right as I work).

Then go to the mouse, you see, I always used mouse completely wrong. Your are not supposed to hold the mouse with your palm wrist on the table. That compresses a very sensitive nerve. Instead move your hand a bit forward. Place your hand entirely over the house, with fingertips even a bit forward. Rest your hand on the mouse, that way your shoulder will do the work, not your wrists. And click moving the entire finger up and down, not bending it. Use stronger joints.

The keyboard was also a surprise. First thing, never rest your palm on those keyboard rests, always keep then float and the wrist straight with the forearm line, not bent up or down. Set your chair accordingly. You should never do acrobatics, moviments that open wide the fingers and rotate too much the wrist.

I call special attention to shotcuts (CTRL+C, CTRL+V, …). Ever heard the cautionary tale that there are no shorcuts in life? Well, the thing is now that I’m extra sensible to any movement I make, I noticed that some of those shortcuts involve very wide movements, or twisting, and that hurts like crazy. I’m tellling so it won’t hurt for you too someday.

Be careful with those combos:

BAD

GOOD

FUNCTION

LEFT HAND

RIGHT HAND LEFT HAND

RIGH HAND

LSHIFT

Any key

Any Key RSHIFT

Caps for left-half of keyboard

RSHIFT

Any key

Any Key RSHIFT

Caps for right-half of keyboard

LCTRL

C

C LCTRL

Copy

LCTRL

V

V LCTRL

Paste

LCTRL

V

Z LCTRL

Redo

LCTRL

V

A LCTRL

Select all text

LCTRL

V

X LCTRL

Cut

ALT

TAB

TAB ALT

Alternate task

ATOM CODING IDE

LCTRL

S

S RCTRL

Save

LCTRL

F

F RCTRL

Find

The first line of this table reads as follows: Using LEFT SHIFT and any key, with left hand, is bad. This is used for capitals. It is better to use RIGHT SHIFT, with right hand, and key with left hand. The idea here is that modifiers (ALT, SHIFT, CTRL) are always best on right hand (if you are right-handed). Unfornately my knowledge of how left-handed people type is limited.

In fact I found that the best way to implement this was to actually remove the LSHIFT and LCRTL keys physically from the keyboard. You do lose some combinations that don’t hurt your fingers, but I considered a good trade overall. I’m living perfectly fine without them.

Using or not the keypad is debated. Although some sources recommend not using it, for people like me that crunch numbers it is very handy. I could not let go yet.

For the fellow coders, I’d say it is a good idea to use the RIGHT SHIFT for special characters like #, @, $, %. Using camelCase has the advantage of reducing some motion that potentially stretch your fingers, consider that for a moment.

It’s only a matter of time if you use a conscious effort to follow these steps so they become healthier habits, and we all could use those, isn’t right?

Thanks for the patience.

EDIT: It helps a lot to take regular breaks, the more the better. I do them know on the clock 40min work, 20 min break, and try hard not to cheat myself, lol. Go make yourself coffee, take a sip of water, bio-break, do a short stretching session if your home, practice Tai Chi. As suggested by Ben Wheeler on a specific post, a hot bath, or even holding an ice pack for 15min then passing hands on running hot water for few minutes reliefs a lot of pain.

Work Flow

Lately I’ve been experimenting with electron.

It is GitHub’s framework for developing cross-platform desktop applications, used for example in Atom code editor. The neat part about electron is that it allows desktop development using Web technologies (HTML CSS, JavaScript,…) something that I believe was traditionally done using very specific and hard to learn libraries.

It has some downsides, such as the fact that even simple programs are bulky. I also heard about some security issues as well.

I worked these past days on my first electron app: workflow.

Recently, I’m recovering from typing strain on hands, and it is ever more important to force myself to take breaks. It is not unusual for me to get carried away in work and forget to take a few minutes of break every hour or so.

So my first app is a desktop program that has a countdown timer to remind me to take breaks. When you click start, it starts the clock and when finished it plays a warning sound (Star Trek themed!).

 

workflow_gui

It is also possible to pause the countdown as many times as needed, for afk times. It works reasonably well, I had some trouble with pausing setInterval and working accurately with dates. It is not as easy as I thought; In fact that part of the code always creeped up another bug so I ended up calling it the hydra for the mythological creature.

I’m also not as rigorous as I should be about sleepless nights. I just love to turn a night coding with plenty of coffee, I find quite satisfying. So I devised a scheme that as you work (and rest) you earn tokens for these sleepless nights, guilt-free.

The program keeps tabs on many tokens you have, and blocks use if you don’t have them. By experience I know I won’t run into the danger of saving them and using all at once. This is to get a more consistent and spacing the turning nights.

It keeps a log of the tasks done, the number of pauses, the use of turnover tokens, all in a simple .txt daily file. It also has a space for you to make a line note about pain and discomfort at work, so you can review later and check if any action is necessary.

Enforcing good breaks, making sure I don’t overwork, managing sleepless nights, and teaching me electron just in ~800 lines. I had great fun doing this, it’s cool to use and I noticed it actually pushes me to be more efficient.

 

I’ll share the WINDOWS x64 distribution, powered by electron-forge, for anyone interested. The license is MIT, so feel free to tweak it as much as you want as long as you don’t blame me later :P.

An important point, the logs the program generate don’t go online, nor does the program should be talking to the internet at any times. I wanted to add a keystroke counter so I could keep tabs on that too, but it is generally discouraged for the similarity to a keylogger. I didn’t do it. It’s not simple for me to get global keystrokes, when program is minimized, even with libraries.

The software can be found in my personal GDRIVE:

GDrive (.zip) (~63MB)

You need let the program know your routine: for example first I warm-up fingers for 5 minutes, then Work 1 for 50 minutes, then rest for 20 minutes, …. . You do this by editing the JSON file in folder ./src/flow.json . Then the program will cycle thoough your routine and repeat it every day.  There is more information on this on the README.md of the distribution.

That is it, I hope you have a good time, and drop me a line if you run into any problems.

 

 

 

 

Design a site like this with WordPress.com
Get started