Coding in music

March 12th, 2008

Do you usually listen to music at work?
Do you often look like a raving monk, sitting still in front of your screen(s), fingers dancing on your keyboard, a huge pair of stereo headphones crowning your head and totally cut off from the rest of the world?

Yes. Interesting. Do you happen to be sitting in an open landscape?

I do. And I listen to music while coding at work. But the interesting fact is that I am not actually listening to the music, only using it as a way to screen myself off from the surrounding noise. If you too happen to use headphones at work, ask yourself why and odds are that you will reach the same reason.

But listening to music is a rather unsatisfying way to fix the ambient noise issue. A few hours of coding with music on and my brain turns to jelly and I produce crap. Music affects my creativity. I can't get those magnificent flashes of total insight that only occur when I am in relative silence and deep concentration. The higher the surrounding noise level, the higher I turn up the volume and the faster my braincells get burned out. On my way home after a day of writing code and raving, I usually feel like a brain washed living dead, my sight is blurred and my thoughts have dissolved into slimy blobs.

Stopping the music doesn't help since it only makes me more aware of what's happening around me. And in the kind of open landscape office I am sitting in, there is always something going on in a cubicle nearby. Something usually not related to my particular area of interest of the moment.

I have tried hear plugs. But the efficient ones are also somewhat painful to wear for longer periods of time. I end up with aching ears. So I choose to listen to music instead, knowing that it will limit my productivity.

I also tried sound proof headsets, the kind construction workers use. But they are damn heavy. And I end up with a neck ache.

So what can I do?
Remember, music is not the real problem here. The real problem is having a working environment that shows no respect to the fact that brain workers need quiet working conditions.

The problem in the short term is your office structure. In the long term, it is your corporate culture.

Office structure can be changed. You can always start lobbying for a project room and dig your way out of cubicle land. There are good arguments in favor of project rooms that even an employer sold to open landscapes can appreciate.

But your success in the long term depends on your employer's corporate culture. Unfortunately, getting a room is likely to be much easier than trying to change your local corporate culture.

E-factor

March 7th, 2008

Today, Peopleware taught me about the E-Factor.

The environmental factor is a simple measure: count the number of uninterupted hours you have at work during an average work week, and divide it by the number of hours of office presence. The idea behind this ratio is to give a measure of how much of your office time is spent actually producing. For a software developer, producing means writing code or thinking about it. Both activities require from the developer to be in a state that psychologists call flow, an almost meditative state of deep and active concentration.

I love flow. That's the reason I became a software developer.

And I have felt growingly frustrated about it during the past year. Let me tell you my story...

A number of things happened at work over the past 2 years: we switched place, and I got to sit just beside a heavily trafficked passage in the office. I sat with my back toward visitors so I never new whether someone standing behind me was just passing or trying to get my attention. I should mention that I and the other developers are sitting in a large open-space and are surrounded by groups of testers, managers and other development teams. I have at any time some 30 persons within hearing reach around me. In the middle of the floor lies the printer room (right in my back) and the dinning room (on the right side of my back) that people enter and leave in an almost uninterrupted stream. I have been working there for a few years now and I am sitting on quite much system knowledge, so people tend to visit me quite often to ask for insights and help. My software team is quite small and has a rather high turnover so I also have to be available to the new developers and support them when needed.

At the same time, I became the main developer on a truly complex project consisting in designing and implementing various rates to measure the growth and return of portfolios of funds. That was a tricky task, involving financial maths and an expert understanding of a complex piece of software for fond trading. In fact it was more of a research project, since no one knew how to actually implement those rates.

This project required flow. High quality flow.

Now, if you have read Peopleware or if you just have a bit of experience in software development, you probably already see where I am heading.

The project's deadline had been fixed ahead of time, before we even understood the true complexity of the task. Some of the rates were put in production upon the deadline and fundamental flaws in their very definition were quickly identified when customers started calling our support center after seeing crazy numbers on their account. From then on the project became a race to quickly re-think and re-implement those rates. That put a lot of pressure on me. I got chronicly stressed, slept badly, became distant from my colleagues. I was showing symptoms of getting worn out.

Meanwhile, my working environment hadn't changed. I have measured my E-factor this week and got 0.2. It's bad. It's not nearly close to the level required by the situation.

Peopleware mentions 0.4 as an acceptable level. A lead developer of an agile team reports an amazing 0.8 here.

With those hard numbers in hands, I have clear arguments to try once more to tell my management that our office structure is not adapted to software development.

Dvorak status

January 30th, 2008

One month has gone by since I switched to the dvorak layout, or to be exact to the swedish variant called svorak a1.

Time to take some distance and look at how the ride has been going!

Well, I am still using svorak. The first 2 weeks were tuff and I seriously pondered giving up. Now the worst is over. I type at a reasonable speed of about 22 words/minutes. Still sluggish but 1) I am truly touch typing 2) my performance are improving daily with a rate of about half a word per minute and per day.

I had to overcome a number of obstacles and am still struggling with a few of them...

I am quite disappointed at the typematrix keyboard that I am using. Since I am mostly programming and using emacs heavily I find myself hitting altgr all the time. On the typematrix, altgr is placed at an impossible angle for the right pinky. I reconfigured the keyboard mapping using the program KeyTweak provided by Typematrix and moved altgr to be just on the right of the space bar, where pgup was, so as to reach it with my right thumb. It feels better but it's still uncomfortable.

I used Microsoft's Keyboard Layout Creator to define an own variant of svorak with the symbol keys at more comfortable positions. That was a clear improvement and my fingers now seldom leave the 3 central keyboard rows.

I also wrote a couple of layouts for x-win...

So I have been learning a lot, both in how to improve the keyboard layout to reduce finger movement and in keyboard design. And since it's a lot of fun, I will keep on with it!

Now I am limited in my experimenting by the position of the typematrix's keys. And I am irritated at the little use I have for my thumbs. Ultimately, I would like a keyboard with keys placed like that http://www.kinesis-ergo.com/classic.htm or that http://www.newstandardkeyboards.com/Products_S.html

But in a perfect world I would also like the keyboard layout to be programmed in the keyboard encoder, at the hardware level, in order to avoid all the messy business of software layout remapping. So that's what I am looking at now: building my own ergonomic keyboard!

Svorak on windows xp

January 9th, 2008

Getting the svorak layout to work smoothly on windows wasn't as simple as I first (naively) thought... My setup is somewhat unusual too: windows xp, typematrix 2030 keyboard and x-win32 as local X server. I am using the svorak layout known as Likets version (Svorak A1).

The first step was to configure windows to use the svorak layout.

A portable way to do that is to run this AutoHotkey binary, but this won't cooperate well with x-win32.

A better but more violent solution is to copy this keyboard dll into C:\WINDOWS\system32\, then edit an existing keybord in the registry to use this dll instead of the original one. You could for example replace the american dvorak layout with our svorak variant. To do just that, start regedit, open the path "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409\" and edit the key "Layout File" to contain "SVORAKA1.DLL". Then reconfigure windows to use the 'American (dvorak)' layout as default for your keyboard and restart windows. Next time you logon you will be typing in svorak :) Of course, you won't be able to use the real dvorak layout anymore after this change...

Now remains to configure x-win32: copy this file into x-win32's lib directory, normally under "C:\Program\StarNet\X-Win32\Lib". Then find the 'input/keyboard' configuration menu and set the default keyboard to 'Svorak (svorak-XWin32.kbd)'.

Voila!

Dvorak or not...

January 7th, 2008

Dvorak layouts...

This seems to be one of those geekish topics that systematically ends up in a neverending holy war between believers and sceptical pragmatics. Both groups have convincing arguments on their side. As for myself, I am inclined toward the pragmatics' side: why going through the mind blowing frustration of learning from scratch a new layout when my fingers are already fluently typing on an other completely different and much more standard layout?

Not to mention the hassle of having to switch layout on every computer I will ever work on afterwards? And having to learn to touch-type for real? Because if I keep glancing at the keyboard, I am going to get all confused. Plus the fact that the default dvorak layout doesn't support my two other main languages, French and Swedish? And that I would need to get this new layout working under both windows, mac osx and the various linux flavors that I am using daily? And worst of all, learning over all my emacs shortcuts!

It feels like a bit too many obstacles in exchange for a hypothetical gain in typing confort...

But then, how can I really know it isn't worth the pain if I don't even give it a try?

So I did it: I just switched to dvorak.

I found a layout that fits my needs: svorak a1, described here. I got it running under both osx and windows (though a bit painfuly for the later: I had to compile an AutoHotKey binary for svorak a1).

And to get things right from the start, I bought an ergonomic keyboard, a typematrix ezreach 2030. To avoid the temptation of glancing at the keyboard, I covered all its letters with small white paper stickers :)

Now the sheer geekiness of my desktop setup frightens me: dual screen, weird looking keyboard with half the keys hidden behind greasy small paper bits...

I am giving dvorak 1 month to convince me.

Two screens are better than one

March 2nd, 2007

Last week I finally managed to obtain a dual monitor setup for my computer at work. Here is the beast:



I have been trying for a year or so to convince various persons at work that 2 screens are better than 1 and that I should get to try. Most stared at me in disbelief, more sensitive to the increased hardware cost than to the arguable efficiency boost. My problem was that my employer has a policy that all employees, whatever their profession, should have exactly the same standard computer setup, namely a compact desktop appliance built by Compaq (yes, it is that old). Those computers are not modifiable in any way that doesn't involve violence. And getting a different computer supporting dual monitors was not an option my employer could consider.

So I tried to solve the problem by myself. I purchased a number of video cards from ebay, with one or two VGA outputs, PCI/AGP... Only to conclude that my company's hardware (compaq evo) does not support any form of alteration of its default setup. All attempts ended up in either BIOS errors or undetected hardware.

Last week I lost patience, grabbed an abandoned workstation and installed Maxivista. It enables the second computer to act as a dual monitor to the first one by installing a virtual video card on the first one that streams screen data to the second. Now we are talking waste of hardware! Two complete computer setups and heavy bandwidth instead of just an additional screen... But that did the trick. And by the way, remember to connect the 2 computers on a close network segment, since the Maxivista protocol is clear text and you don't want peers sniffing your monitor...

The first day, having dual monitor felt strange. I had to move my head a lot more, and it took time to adjust the light, contrast and brightness to get a smooth sight feeling. The second day I had stopped thinking of the fact that I was facing 2 screens. And on the day after, I had to face it: I had become addicted.

Now I can't imagine having my emacs in any other way than in one large window spread across 2 screens and split into various sub windows showing files and shells...

My hope now is that I will make the other developers jealous enough to create sufficient momentum to trigger a company-wide hardware upgrade with real dual monitors as standard...

UPDATE: I wrote this entry in mars 2007. As of september 2008, at least 2 other developers had gone over to dual screen setups and my boss was setting aside budget to buy larger screens just for us developers. Obstinacy does pay back :)