Representing Data: Bits and Bytes

If you use a computer regularly, you know that every document you write, every music file you listen to and every photo you see is stored as a file. You may also know that a file consists of bytes and that bytes consist of smaller building blocks called bits. But, what are bits and bytes really? How do they work, why do they work that way, and how does storing them create text, sound and images? To find out we have to start with something very basic: counting.

Decimal Counting

Consider what happens if you count using ten fingers. Once you reach ten you have no more fingers left and thus, when you reach eleven, you remember one times ten and keep up one finger. This same thing happens over and over again as you keep counting upwards. This is also reflected in the way that we count when we write down numbers. Though in that case we use ten symbols instead of ten fingers: 0 up to including 9. Once we reach nine and want to express ten, we no longer have any symbols. So, we remember 1, which for writing means: we shift the number 1 to the left, and start over again with a 0, giving us 10. The difference with finger counting is that for zero we use no fingers at all, whereas when writing numbers we use the symbol 0 to denote zero.

Counting Conventions

The way we write down numbers is just a convention. The number system that we use most often is the decimal numeral system, because it has, as discussed, ten symbols that we enumerate. Consider that there is nothing stopping us from defining a counting system with only five symbols: 0 up to including 4. In this case we will run out of symbols when we want to express five, and we will have to do the same thing we did before: shift 1 to the left and then start over again. This gives us (again) 10. But since we now count with five symbols, this means that the two symbols 10 actually represent the value five. If you find this confusing, try counting from zero to five using your fingers on only one hand and use the first finger for the zero. Notice that reaching five forces you to remember one and continue counting by resetting your hand to one finger again for zero.

Binary Counting

The ten-symbol decimal counting system is just one of an infinite number of possible counting systems. However, there are only several such systems in common usage. Namely, the octal system that uses eight symbols, the hexadecimal system which uses sixteen symbols (letters A through F are used to denote 10 up to 16) and also the binary system, which uses only two symbols: 0 and 1. Having only two symbols is similar to counting with only two fingers. So, how would we count from zero to three using only two symbols? Zero would just be 0, one would just be 1. For two it becomes more complicated. Since we have now run out of symbols we need to shift 1 left and start over with zero, giving us 10. Finally, for three: since we still have a next symbol for the rightmost position, we only have to replace the 0 with a 1 to express three in binary, giving us 11. If we now want to go up to four, we can not increase the existing symbols anymore. Hence, we have to set them to 0, and add a new position with a 1, giving us 100. In the table below we show the values for counting up to including five. If this is not immediately clear: do not worry, a more intuitive explanation follows.

DecimalBinary
00
11
210
311
4100
5101

Bits

The binary system brings us to our first definition: the binary digit, commonly shortened to ‘bit’. One bit is thus simply a single-digit binary number. Glancing at the table above we see that higher decimal numbers need more bits to be expressed in binary notation. Specifically, to store the number two or three we need two bits, and to store the number four or five we need three bits. The key insight is that by concatenating bits, that themselves can only take two values, we can represent any whole number, no matter how small or large, by using a sufficient amount of bits.

there are only 10 kinds of people in the world: those who understand binary, and those who do notnumeral base joke

An intuitive way to think of bits is as switches that turn on or off values. Take a look at the table below. The first row contains numbers, the second row contains a 0 if the number is ‘off’ and a 1 if the number is ‘on’. Try to work out the decimal value by summing the values of the first row for all the ‘on’ switches.

Solution (click to expand)
128 * 0 + 64 * 1 + 32 * 0 + 16 * 0 + 8 * 1 + 4 * 0 + 2 * 1 + 1 * 0 = 64 + 8 + 2 = 74
1286432168421
01001010

 

The second row represents a number (01001010) written in binary notation. The first row consists of powers of two if you consider them from right to left. In fact we can simply rewrite the first row of the table as follows:

2^72^62^52^42^32^22^12^0
01001010

Why powers of two? Well, since we have two symbols: 0 and 1. Starting at the right, each step towards the left increases the value by one power of two. If we would have three symbols, each position step would represent a power of three. Consider what happens when we have not two, but ten symbols, as in the discussed decimal system: each step towards the left is then an increase of a power of ten. An example:

10^3 = 100010^2 = 10010^1 = 1010^0 = 1
1100

 

If we try to express this as a decimal number we get 1000 + 100 = 1100, which in fact is exactly the same as the on/off switches concatenated (1100), as each switch represents a power of ten.

Bitwise Operations

Back to bits: it may seem as though storing numbers in binary is inefficient, as we need more bits to store higher numbers. However, the number of bits required does not increase linearly, instead it decreases exponentially. To see this, let us write the decimal number ten in binary: 1010. This requires four bits, now a thousand: 11 1110 1000, requires only ten positions despite being a magnitude hundred larger than ten. This in another key insight: we can represent very large numbers with relatively few bits.

You can think of a bit as the smallest possible piece of information. Many things map nicely on the two states that a single bit can have. For example: a logic statement can be either true or false. However, by adding additional bits we can express more states than just two and perform actual arithmetic with them. If we want to add the numbers 1 and 2 in binary we can simply do this by turning on all the switches that are ‘on’ in the representation of both 1 and 2 of the result. If we look at 1 and 2 in the table below, we see that to form 3, the sum of these numbers, we can look at the two rows above 3 and set the bit to 1 if either the bit in the row of 1 OR the row of 2 is one. This is why this is called an OR operation.

2^32^22^12^0
1 =0001
2 =0010
3 =0011

 

There are in fact four of these logical operations we can do on bits:

  • OR : turns on the switch in the result if either of the two input switches are on.
  • AND : turns on the switch in the result if both of the two input switches are on.
  • XOR : turns on the switch in the result if either of the two input switches are on, but not both. This is called an eXclusive-OR.
  • NOT : takes one input row and inverts all the switches, turning all zeros to 1 and all ones to 0.

With these four operations we can implement common mathematical operations on whole numbers. A hardware implementation of one of these operations is called a logic gate and your computer has many of them: billions.

Bytes & Text

Now we have some feeling for bits, let us turn to bytes. Computers only work with these binary numbers expressed as groups of bits. So, how do we get from groups of bits to stuff such as text, audio and images? The answer: mappings. You are probably familiar with many systems in the real world where a number ‘maps’ to something else. For example: a telephone number maps to a person or a company, a postal code maps to some area within a city, and in some restaurants a number maps to a specific dish. The same mechanism of mapping a number to something with a specific semantic interpretation is used in computers.

Characters

For storing text on a computer we need to map the numbers to the alphabet. There a twenty-six letters in the alphabet. However, if we need to express both upper and lowercase letters, we would need to double that amount: fifty-two. How many bits would that take? The closest power of two is 64 which is 2^6, thus we need at least 6 bits. However, we also need to express many other symbols. Take a look at your keyboard and you will find that it contains at least a 100 or so keys, and some combinations of keys can produce yet other symbols. Though, historically six bits were indeed used to store text, over time many more symbols were added. This eventually led to an 7-bit standard known as ASCII, commonly extended with 1 extra bit for additional language-specific symbols. The modern day successor of this is Unicode which can use up to 32 bits per character, allowing for many more symbols. Yet, the first 7-bits of Unicode still map to the same symbols as ASCII.

Processing Units

Early microprocessors were designed to operate on eight bits at a time. Early personal computers used eight bits as well. Since these groups of eight bits form a natural unit we refer to them as a byte. A byte can take 2^8 = 256 distinct numeric values, which in practice means 0 up to including 255. Half a byte, four bits, is sometimes referred to as a nibble, which is a tong-in-the-cheek reference to the larger ‘bite’.

A byte is thus just a group of eight bits. Any meaning that a byte has really depends on what we are expressing. In a text file the bytes are characters, in a music file they are audio samples and in a digital photo they represent the colours of a specific part of the image.

Images

Image files are quite intuitive to understand. If you take a photo and put a grid over it, you can give each small square in the grid a specific colour. Zoom very far into a digital photo, and you will see this grid, the small squares are often referred to as pixels: a portmanteau of ‘picture element’. If a digital photo has more pixels, it contains more information and we say it has a higher resolution.

Colour

The colours of pixels can be encoded in bits. Indeed, colours are often expressed in the Red Green Blue (RGB) format. In a commonly used variant of this format each colour is one byte and can take a value from 0 to 255 that maps to the intensity of the colour. So, for each square in the grid we use three bytes: twenty-four bits. For example the colour (R=0, G=0, B=0) would represent pure white and (R=255, G=255, B=255) is pure black as in these cases all colours are mixed evenly. However, (R=255, B=0, G=0) would be bright red, and so on.

Hexadecimal

If you have ever edited a web page and had to change a colour, you probably noticed that colours can be expressed as a hashtags followed by some combination of characters and numbers, for example: \#\textrm{FF0000}. This takes us back to the discussion of counting systems. The hexadecimal system is another way to represent numbers. For this system we count 0 through 9 and then A through F, giving us 16 possibilities in total. Perhaps you already see what those symbols behind the hashtag mean.

Let us look at \#\textrm{FF0000}. This actually consists of three groups of two symbols. The first group is FF, we know that F maps to 15 in decimal, so the hexadecimal value of FF is 15 * 16^1 + 15 * 16^0 = 255. The other two groups are 0. These three groups in this notation are the three colours! The first group is red, with value 255 (\#\boxed{\mathbf{FF}}0000), the second is green with a value of 0, and the last is blue, also with value 0 (\#\textrm{FF}00\boxed{\mathbf{00}}). Hence, again we have bright red (R=255, G=0, B=0), but now expressed in hexadecimal as \#\textrm{FF0000}.

Practical Considerations

Modern images take up a lot of storage space when we would just store them in RGB format. A modern camera easily snaps photos at 16 million pixels, for each of these pixels we need to store three bytes. So that’s over 48 million bytes (megabytes) for one photo. Storing video is similarly challenging, as that is essentially a collection of still images in sequence, typically at least twenty-four per second. Fortunately, digital compression techniques exists that can make images and video files much smaller. These techniques take advantage of repetition and patterns within and across images and remove small differences that can not easily be seen by the human eye.

Sound & Samples

How sound is represented digitally is a bit more complex than text and images. To get a better impression of this, imagine you are sitting on a swing. You are swinging right to left from my perspective. Let’s say that I want to take pictures, so I can later play them back as a filmstrip. A choice I have to make is how many pictures I take relative to the time you are swinging.

If it takes you ten seconds to swing back and forth, and I only take a picture once every ten seconds, all pictures would have you frozen in the exact same place, since I am missing the the 9.99 seconds where you are actually swinging. If I take a picture every second, I’d see you swing, but it would look a bit choppy. Taking pictures in more rapid succession would fix this and yield smooth motion. However, the minimum amount of pictures I’d need to snap to be able to see you move is actually longer than one second: half the time it takes for a swing, which would be every 5 seconds. I’d catch you at times 0, 5 and 10, respectively for ‘up to the left’, ‘centered’, and ‘up to the right’, and so forth. Differently worded: I’d need to snap pictures twice as fast as the rate at which you are swinging.

Sampling

The process of determining how many pictures to take in an audio context is called sampling, and instead of pictures we record the amplitude of the audio signal at specific points in time. The signal consists of a mix of sound frequencies that relate to the pitch of what you are hearing. The speed of the swing is comparable with the highest possible frequency of the audio signal. Frequencies are expressed in Hertz, 1 Hertz = 1 swing per second.

If you imagine many people sitting on swings next to you, going back and forth at different speeds, we’d need to snap pictures so we can catch the fastest one: snapping twice as fast as that speed. This corresponds to the highest frequency for audio: we need to record a certain minimum amount of samples in order to reconstruct the original recording. If our sampling rate is too low, we will not be able to record sounds with a higher frequency. Like with the swings: we need to sample at least twice the rate of the highest frequency we want to be able to record. This is one of the main reasons that telephone audio sounds rather poor: the sampling rate is low: 8000 samples are taken each second, limiting the range of the actual audio to 4000 Hertz. Human hearing can distinguish sounds from 1 up to 20 000 Hertz. This is the reason Compact Disc audio sounds so good: it takes 44 100 samples per second, enabling an actual range up to 22 050 Hertz.

Resolution

This does not get us the actual bytes yet that we need for audio, which takes us to the other part of representing audio digitally: how precise a value we are going to record for each sample. The more bits we use for a sample, the more accurately we can model the original signal. If we would only use one bit we can only record either no sound, or the loudest possible sound: it’s on or off. With two bits we can record four levels, etc. Compact Disc quality audio records samples with 16 bit resolution, giving 2^{16} = 65536 possible levels.

Practical Considerations

Like with video files, sound files also quickly grow large. In Compact Disc quality we need to store two bytes for every sample of which there are many thousands every second. Fortunately, as with video there are compression techniques to reduce the sizes of such files, the most famous of which is undoubtedly mp3 which takes advantage of differences that the human ear can not easily distinguish.

Conclusion

In this post you have learned about counting in the familiar decimal system, but also in the likely less familiar binary counting system. You have also seen how a number raised to a certain exponent relates to the counting system: the decimal system uses ten as the base number and the binary system uses two. These two possibilities act like an on/off switch, and each of these switches is referred to as a bit. You have an understanding of bitwise operations that can be performed to implement basic arithmetic. Finally, we have seen how groups of bits form bytes, and how bytes are often mapped to various things such as characters in text, colours in images and samples in sound. I hope this gives you a better feeling of how the basic primitives of modern computing, bits and bytes, relate to the things you see and read on screens and hear through speakers and headphones.

Renewed Keyboard Joy: Dvorak

Typing: you do it every day nearly unconsciously. You think of what you want to appear on the screen. This is followed by some rattling sound and the next instant it is there. The blinking cursor stares at you as to encourage you to keep going. Handwriting feels mostly like a thing of the past since typing is so much faster for you, likely up to two or three times. So, what would it be like if you were stripped from this ‘magical’ ability to type?

If you are like me, you probably learned how to type all by yourself. I never took a touch typing class, since it seemed like a waste of time. After all: I could already type, so why take a course to learn something I could already do?

Many self-learned typist adopt a hunt and peck style, meaning they need to look at the keyboard to find the keys. Usually this is done with only two fingers, since using more fingers obscures the view on the keyboard making it harder to ‘hunt’. I did not adopt this style, but rather used the three-finger approach: both hands hover over the keyboard and type using the three strongest fingers: the thumb, index finger and middle finger. Occasionally I used the ring finger as well, though not consistently. Observing my typing style, I noticed that my hands positioned themselves in anticipation of the next key to strike. This all went seamlessly, achieving speeds of about eighty-five to a hundred words per minute, which is not bad at all.

Though my self-learned typing style worked for me, I did try to switch to touch typing several times. Particularly because my hands would feel strained after intense typing sessions. However, switching never worked out. I would intensely concentrate for one day, keeping my fingers on the QWERTY home row of ‘ASDF-JKL;’, touch typing as one should. Nevertheless, the next day the years of acquired muscle memory would take over: I would be thrown back to my ‘own’ style. My hands seemed to have no incentive to touch type, even though I really wanted to consciously. Had I only taken that typing class when I had the chance, then I would be better off today, or … perhaps not?

The famous QWERTY layout, referring to the six top left keys on most standard keyboards, is not the only way to arrange the keys. Firstly, there are many small variations such as AZERTY, common in Belgium, and QWERTZ, common in Germany. Secondly, there are alternative keyboard layouts such as Colemak, Workman and Dvorak. Of these alternatives, Dvorak has been around the longest, since the 1930’s, and is also an official ANSI standard. The story behind both QWERTY and Dvorak, both developed for typewriters, is interesting in its own right and explained very well in the Dvorak zine.

The standardized simplified Dvorak layout is much less random than the QWERTY layout, it notably places the vowels on the left side of the keyboard and often used consonants on the right:

2015-07-Simplified_Dvorak

The simplified Dvorak layout

Several years ago I tried switching to Dvorak cold turkey. I relabeled all my keys and forced myself to type using the Dvorak layout. It was a disaster. I would constantly hit the wrong keys, my typing slowed to near a grinding halt. I would spent fifteen minutes typing an e-mail that previously I could write in under a minute. Frustrated, I stopped after three days.

Fast forward to several months ago. I caught a bit of a summer flu and although I was recovering I could not really think straight. Since learning a new keyboard layout is rather mechanical and repetitious in nature, I figured the timing would be right to have another stab at this. My main motivation was to increase typing comfort and reduce hand fatigue. Secondary motivations included load balancing better suited for my hands, reducing the amount of typing errors and being able to reach a higher sustained typing speed. Finally, I also picked this up as a challenge: it is good to force your brain to rewire things every once in a while. I wanted to switch layouts for these reasons for quite a while and this time I decided I would go about it the ‘right’ way.

Firstly, I had to choose a layout. Hence, I determined the following criteria:

  1. Since my left hand is a bit weaker I should opt for a right hand dominant layout, meaning one that utilizes the right hand to control more keys than the left in terms of both count and striking frequency.
  2. The layout should differ sufficiently from QWERTY, as to prevent me from relapsing into my ‘own’ typing style.
  3. As I do a fair bit of software development, the layout should be programming friendly.

Based on these criteria I chose the Programmer Dvorak layout. This layout is similar to simplified Dvorak, but has a different number row. It looks like this:

2015-07-Programmers_Dvorak

Programmer Dvorak

The main difference between this Dvorak layout and the simplified layout shown previously is that the number row is entirely different. Instead of numbers, the keys on the number row contain many characters that are often used in source code, such as parentheses and curly braces. To enter numbers the shift key needs to be pressed. This sounds cumbersome, but it makes sense if you count how many times you actually enter numbers using the number row. The numeric pad on the keyboard is much better suited to batch entry of numbers.

Awkwardly the numbers are not laid out in a linear progression. Rather the odd numbers appear on the left side and the even number on the right. This can be quite confusing at first, but interestingly it was also how the numbers were arranged on the original, non simplified, version of Dvorak. So there is some statistical basis for doing so.

If you are considering alternative keyboard layouts you should know that Dvorak and Colemak are the two most popular ones. Dvorak is said to ‘alternate’ as the left and right hand mostly alternate when pressing keys, whereas Colemak is said to ‘roll’ because adjacent fingers mostly strike keys in succession. One of the main reasons that Colemak is preferred by some is that it does not radically change the location of most keys with respect to QWERTY and, as a result, keeps several common keyboard shortcuts, particularly those for copy, cut and paste, in the same positions. This means that those shortcuts can be operated with one hand. As I am an Emacs user, used to typing three or four key chords to do comparatively trivial things – more on that later – this was not really an argument for me. I also read that the way in which you more easily roll your fingers can help with making the choice between Dvorak and Colemak. I think this was conjecture and I have no good rational explanation for it, but perhaps it helps you: tap your fingers in sequence on a flat surface. First from outwards in, striking the surface with your pinky first and then rolling off to ending with your thumb. After this do it from inwards out, striking with your thumb first and rolling back to your pinky. If the inwards roll feels more natural then Dvorak is likely a better choice for you, whereas if the outward roll feels better, Colemak may be the better choice. Again this is conjecture, interpret it as you wish.

Whichever alternative layout you choose: anything other than QWERTY, or a close variant thereof, will generally be an improvement in terms of typing effort. Dvorak cuts effort by about a third with respect to QWERTY. This means that entering hundred characters using QWERTY feels the same as entering about sixty-six characters in Dvorak in terms of the strain on your hands. If your job requires typing all day, that difference is huge. Even more so if you factor in that the number of typing errors is usually halved when you use an alternative layouts, due the more sensible and less error prone arrangement of the keys. Most alternative layouts are as good as Dvorak or better, depending on the characteristics of the text that you type. Different layouts can be easily compared here.

Now that I had chosen a layout, it was time to practice, so I set some simple rules:

  1. Practice the new layout daily for at least half an hour using on-line training tools.
  2. Do not switch layouts completely, rather keep using QWERTY as primary layout until you are confident you can switch effectively.
  3. Train on all three different keyboards that you regularly use. Do not buy any new physical keyboard, do not relabel keys, but simply switch between layouts in software.
  4. Focus on accuracy and not on speed.

Before starting I measured my raw QWERTY typing speed, which hovered around ninety words per minute sustained and about a hundred words per minute as top speed. Unfortunately, raw typing speed is a bit of a deceptive measure, as it does not factor in errors. Hitting backspace and then retyping what you intended to type contributes to your overall speed, yet it does not contribute at all to your effectiveness. So it is the effective typing speed which is of interest: how fast you type what you actually intended to type. Effective typing speed is a reasonable proxy for typing proficiency. My effective QWERTY typing speed was a bit lower than the raw speed, by about five to ten percent. This gives a sustained speed of eighty to eighty-five words per minute and a top speed of around ninety-five words per minute.

As I started with my daily Dvorak training sessions, I also started seeing a decrease in my effective QWERTY typing speed. My fingers started tripping up over simple words and key combinations, even though I still used my ‘own’ typing style for QWERTY, and touch typed only in Dvorak. The effect was subtle, but noticeable, lowering my effective QWERTY speed with about ten to fifteen percent. I deemed this acceptable, so I persevered, but it does show that using two keyboard layouts definitely messes up muscle memory. I think this effect can be mitigated to some extent by using specific layouts on specific keyboards, but I did not test this, as I would be breaking my own rules.

The first sessions in Dvorak were slow, with effective speeds of about five to ten words per minute. In fact the first days were highly demotivating, it felt like learning to walk or ride a bike from scratch again. I started out with my fingers on the home row and consciously moved my fingers into position. That process took a lot of concentration, you can think of it as talking by spelling out each word. Furthermore, every time I hit a wrong key, my muscle memory would stare me in the face full of tears and proclaim it had triggered the right motion. It did … just not for this new layout I was learning.

So, what did I use to train? I started out using a site called 10fastfingers, but I found it a bit cumbersome and it did not have a lot of variance. In the end, I can really recommend only two sites, namely learn.dvorak.nl and keybr.com. The latter has the nice property that it adapts the lessons to your proficiency level and is quite effective for improving weak keys. /r/dvorak is also good for inspiration and tips.

Some basic other tips: start typing e-mails and chats with your new layout before making a complete switch, as it will give you some training in thinking and typing, rather than just copying text. Furthermore, switching the keyboard layout of your smartphone may help as well, not for efficiency, as Dvorak is really a two-handed layout, but for memorization. Dvorak is not really designed for phones, other layouts may be better, I have not looked deeply into this, as I generally dislike using phones for entering text, it does not seem worth the trouble of optimization. I do not recommend switching the keys on your computer keyboard, or relabeling them, as doing so will tempt you to look at the keyboard as you type, which will slow you down. It is better to type ‘blind’.

It took some discipline to keep at it the first few days, but after about a week or two I was able to type at an average speed of about twenty-five words per minute. Still not even a third of my original QWERTY speed, but there was definitely improvement. After this there was a bit of a plateau. I spent more time on the combinations and key sequences that were problematic, which helped. Six weeks in I was able to type with an average speed of around forty words per minute. Since this was half of my QWERTY speed, I deemed it was time to switch to Programmer Dvorak completely.

In contrast with my previous attempt several years ago, this time the switch was not a frustrating experience. The rate of learning increased as my muscle memory no longer had to deal with two layouts. Typing became increasingly unconscious. The only things that remained difficult were special characters and numbers, for the sole reason that these do not appear often and thus learning them is slower.

Currently I am about ten weeks in. I did not use the same training tools during that entire time, but I do have data from the last eight weeks. Let us first take a look at the average typing speed:

2015-07-Typing_Speed_Smooth

Average smoothed typing speed

The graph shows two lines spanning a time of eight weeks, a green one which shows the raw speed and a purple one that shows the effective speed. You can see that both speeds go up over time and the lines are converging, which implies the error rate is going down. My average speed is currently around seventy words per minute, which is close to my original QWERTY speed.

We can also look at the non-smoothed data, which gives a feeling for the top speed. In the second graph, shown below, we see that the top speed is about hundred words per minute which is actually about the same as my QWERTY top speed.

2015-07-Typing_Speed_Raw

Raw typing speed

There is still quite a bit of variation, as is to be expected: not every character sequence can be entered at a high speed and some keys have a higher error rate than others. Most errors are mechanical in nature, which means: simply hitting the wrong key. This is particularly prevalent when the same fingers needs to move to press a subsequent key, for example for the word ‘pike’ one finger needs to move thrice to hit the first three letters. More generally, my slowest keys are the Q, J and Z and the keys with the highest error rate are the K, X and Z. Luckily these are not high frequency keys, and they are also underrepresented during training, so over time the errors will likely decrease and the speed will increase for these keys.

With respect to my original goals: firstly, I can say that typing in Dvorak is more comfortable than QWERTY, particularly at higher speeds my fingers feel much less jumbled up. The hand alternation is very pleasant, though it took some time for my hands to get synchronized. Secondly, in terms of speed: after about ten weeks I am very close to my QWERTY speed, which is great. It shows that switching layouts is possible, even though it takes effort and discipline to do so. It was frustrating at first, but I feel that it was a good opportunity to purge many bad typing habits that had accumulated over the years.

There are also some downsides, the main one is that typing QWERTY is slow for me now, and that will likely continue to deteriorate. I do not see this as a major issue, as I do about ninety-nine percent of typing on my own machines. For the other one percent, it is possible to switch layouts on each and every computer out there. Some people may dislike the moving of keyboard shortcuts, and that can really be an issue, but for the most part it is just a matter of getting used to it. As an Emacs user, I took the opportunity to switch to the ergomacs layout, which I can recommend. It significantly reduces the number and length of chords: keys that need to be pressed in succession, and is also more compatible with more broadly adapted shortcuts.

Do I recommend that you switch to Dvorak, or an other alternative layout? That really depends on how frequently you type. If you type rarely, switching may not be worth the effort. However, if you have to type a lot every day then I think it is worth it purely for the increase in typing comfort. The only argument against this is if you often need to switch computers and you can not easily change the keyboard layout on those machines.

Dvorak definitely feels a lot more natural than QWERTY, and so will most other more optimal layouts. I am relieved I never took a touch typing course. It would have taken much more effort to unlearn touch typing QWERTY if I had. Thanks to not doing that I have been able to learn and become proficient using a layout suited for my hands in just ten weeks. So, if you type frequently, are willing to make the jump and have enough discipline to get through the initially steep learning curve, then I can definitely recommend it. Even just for the challenge.

What is Linux?

Apple and Microsoft are the two household operating system creators known by the majority of consumers. However, they are not the only ones. While Microsoft’s Windows and Apple’s Mac OS are commonly viewed as the two dominant desktop titans, there is a third often overlooked player: Linux.

Linux is not an operating system by itself though, it is only the kernel of an operating system. The kernel of all modern versions of Windows is “Windows NT”, while the one of Mac OS X is “XNU”. I won’t go into too much technical detail, but roughly the kernel is a middleman between the programs that run on your computer and the underlying physical hardware. So, if you open a text document residing on a disk, the text editor would ask the kernel to do this, and in turn the kernel would ask the disk. The details of accessing the disk are hidden from the text editor, which is nice since it doesn’t need to know the myriad of different media that your text document could be stored on: a harddrive, USB stick, CD, DVD, Blu-Ray Disc or network drive.

When the Linux kernel is combined with a set of applications it actually becomes possible to operate the machine it is installed on using those applications, hence it really becomes an operating system. In the Linux world such a combination of the kernel and applications is referred to as a distribution. A distribution commonly includes a set of core applications created by the GNU Project. There are many different distributions, some target a broad audience that want an easy-to-use desktop, like Fedora Core, Ubuntu and SuSE. These usually offer an intuitive graphical user interface like GNOME or KDE. Besides this there are distributions that are specialized to make it easy to, for example, run a media center or a web server.

If you’re still with me, you may be convinced you’ve never ever used Linux, and perhaps you’d even like to try it. However, if you have used an Android telephone or browsed the web than you have most definitely used Linux. Google’s Android actually uses the Linux kernel. That’s right: many smartphones, and tablets, are running Linux nowadays! Additionally, most of Google’s application actually run on Linux even if you access them via your browser. Besides this the majority of web sites use the Apache web server which is also often run on Linux systems.

Since Linux is prolific nowadays, you may wonder: is there some big company behind it? Windows has Microsoft, MacOS is backed by Apple. However, Linux is non-profit and open source. You can find out how that works and what it means here. The foundations of what we know as Linux today were created by Linus Torvalds twenty years ago. However, many people have contributed to it over the years, both volunteers and paid developers. Indeed, large companies, like Intel, IBM and even Microsoft, have contributed code to the Linux kernel. Besides this there are several companies that have become famous for their continuous involvement in Linux: Red Hat, Canonical and Novell. These make money primarily through support and services, targeted primarily at the enterprise.

Is Linux usable as a desktop operating system for your day-to-day activities? This was the big goal a decade ago: to get the Linux desktop, notably GNOME and KDE, to the same level as graphical user interfaces of other operating systems. Whether the developers have succeeded in this depends largely on how you use your desktop in your day-to-day life. The best way to find out is to actually try it. If you are a newcomer to Linux I usually recommend Ubuntu, which you can download here, as its one of the easiest user-friendly distributions around. However, feel free to take a look around to see if there is an other distribution that appeals to you.

What is Free Software and Open Source?

2011-07-08-Free-Software-Button

There are many people that are unaware of what free software is and what open source software is, and why it matters. In this post I’ll try to shed some light on this.

When people hear `free software’ they usually think of software that does not cost anything in terms of money, which is not the right definition. The word `free’ in free software is free as in speech, not free as in beer. So, what does this actually mean in terms of computer software? To understand this we first need a basic understanding of what a computer program actually is. A computer processor can be operated via an instruction set which allows performing many low-level operations such as adding two numbers together. These instructions are numeric codes, which are very hard to understand for a human: imagine that you would have to type a text and instead of using a – z you had to use the numbers 1 – 26 for each letter. That would be terribly difficult to read and write! So, most computer programs are written in readable text which contains statements such as “x = 3 + 5” instead of something like “1001 1100 1010”. This written text is called the source code, which is like a blueprint of the program, and can not be interpreted by a machine directly. Source code first has to be translated into a binary machine representation: the numeric codes I spoke of before. This translation process is called either compiling or interpreting1. After this step we can actually run the program and interact with it. So, we have a distinction between the source code and the binary.

Many companies that make computer software only distribute the binary to their customers and keep the source code locked away. These companies see the source code as their intellectual property which they must protect. Let’s go back to free software again and consider what makes a particular piece of software free as in speech: four main points. Firstly, the freedom to run the software for any purpose. This means that, for example, you can not distribute a video editor with the restriction that you can not use it to produce a commercial. Secondly, the freedom to study how the program works and to change it to suit your own needs. For this having the source code is a necessity. Thirdly, the freedom to distribute copies of the original program so you can share it with your friends. And finally: the freedom to distribute the modifications you make to the program to others. So, now you understand that besides the binary you also need the source code in order for something to be free software.

Undoubtedly these definitions will give you a lot to think about. Most people assume that you can not make money when you make free software. However, this is untrue as there are many successful companies out there that create and share free software. These companies realize that the real value of computer software is not in the source code, but in the people with the expertise about how the software works. Just like it takes time and practice for a musician to learn to play a musical instrument, it also takes time for a programmer to familiarize himself with a piece of software. Contrary to popular belief making computer programs is primarily a creative endeavor with a significant social component as well. Everyone who has ever written a report or paper knows the value of other people reviewing your work. The same is true for computer software: if more people read it, give feedback and fix errors, the quality of the software improves. And when the source code is available: it is much easier for people to participate in this process.

Now, this still leaves us with the question: what is open source? Is it exactly the same? Well, most open source software is also free software, which may be somewhat confusing. The main difference between the two is philosophical. The free software movement considers non-free software to be undesirable, and is social in nature: its emphasis is on changing people’s behaviour so that they create, use and share free software instead of alternatives. In contrast, the open source movement originated in the nineties as a pragmatic, liberal view on free software. Therefore it is slightly more permissive: some things that are not free software are open source. The difference is also emphasized in the concepts themselves: free software with “free as in speech” as the main issue, and open source software with an emphasis on the pragmatic advantages of having the source code openly available. Since there is a relatively large overlap between the programs these two concepts cover, people commonly use the term Free and Open Source Software (FOSS) to refer to both.

So, have you used free and open source software? It is quite likely that you have! Are you running Mozilla Firefox or Google Chrome as your Internet browser? Both are free software. Many websites you visits are powered by the Apache web server, which is open source. Are you perhaps using an Android telephone? The operating system kernel these phones use is Linux, which is free software. You are probably using many more pieces of free and open source software than you realise. Notice that many of these software products have been created by successful companies and not by individuals programming in their basements2. Here is a 2008 video with Stephen Fry giving a quick explanation and his view on free software:

Whether or not free and open source software matters to you personally is entirely up to you. But at least the next time anyone asks you what free or open source software is: now you know the answer.

Find out more:

 

Notes:
1) For this text the distinction does not matter, but if you clicked this footnote you probably want to know a bit more. A compiler takes as input a file with source code and then writes an output file which can be executed directly. An interpreter also takes a source file as input, but translates it to machine instructions on the fly, so no intermediate executable is produced. Generally interpreters are slower, since they can’t read the entire source code file, but instead process it line-by-line. This makes it more difficult to optimise the generated instructions for execution speed. When distributing a program you also need to distribute the interpreter itself with it which is not the case for a compiled program. Nevertheless, they do have advantages as well, such as that they can more easily be tested.
2) Although, there is nothing fundamentally wrong with that 🙂