Fundamental attribution error of programming

codeSam Stephenson is the creator of the Prototype JavaScript framework and rbenv, the competitor to RVM. He recently wrote an interesting article why programmers are not their product named “you are not your code“. Are you?

This is in fact what programmers do quite often: their identify themselves with their code. After all, they have written and created every line and every character. They have invented the names, the functions, and the structures. Nobody else knows their code as good as they do. They own their “precious” code. Programmers are like little gods who like to rule their own universe.

The advantage is obvious: if the software is succesful and you identify with it, it is your success. The drawback: if the software is not succesful and you identify with it, it is your failure. This is similar to a sports team: if a sports team wins, then everybody wants to take part in the success. If the team continues to lose, then everybody starts to blame each other: the president the trainer, the trainer the players, the players each other, etc.

It often works to claim the ownership of something because people have a lot of cognitive biases. One of these biases is the fundamental attribution error in Psychology: we have a tendency to over-emphasize personality-based explanations and ignore the role of other influences (for instance situational ones). We also tend to attribute great events to great men, know as great man theory.

While it is debatable if this is a good thing or not, a developer of a modern web application can hardly claim he is the only author of it. In the early days of PCs, it was only the programmer and the CPU that mattered, at least if you did machine programming in assembly language directly. Then we had the first high-level programming language to program systems with disk-operating systems like CP/M or various forms of DOS. Together with graphical user interfaces object-oriented programming languages arrived, and for the web comfortable high-level languages like Java, Ruby or Python with garbage collection appeared. Today we have 4 or 5 layers between the programmer and the CPU: for example for Ruby programs the programs are written in Ruby, Ruby is written in C, C is written in Assembly, and Assembly boils down to machine code.

And this is only the language itself. A modern web application is like an iceberg, the stuff above the surface is written by you and your team, the stuff below by countless others. It is not only the language and the tools for editing and debugging, a web application is based on a lot of different servers and systems

  • the operating system like MacOS or Linux
  • the web server like Apache or Nginx
  • the web server modules like Phusion Passenger
  • the database server like MySQL or PostgreSQL
  • the caching server like Memcached or Redis
  • the mail server and mail transfer agents like Postfix or Sendmail
  • the message queue processing server like ActiveMQ, RabbitMQ or ZeroMQ

Then there are also the languages and version management systems, frameworks and libraries,
gems and plugins, written by countless other developers:

  • languages like C, Ruby, Python or Javascript
  • version management systems like SVM, Git, RVM or rbenv
  • frameworks like Rails or Django
  • libraries like Prototype or jQuery
  • gems and plugins for pagination, authentication, etc.

In order to build a modern application, you setup different servers and configure them, choose a language, a framework and suitable libraries, and finally you select different plugins and gems and stick them together in a unique way. If you have done all this you can hardly claim you have created the system. And yet we tend to do it..

Therefore if you are a Ruby developer and you have produced more than others, it is not because you are taller or smarter. It is probaby because you are standing on the shoulders of many others.

(The sourcecode photo is from Flickr user nyuhuhuu)

Ubuntu on Samsung Series 7 Chronos


After my 8-year old laptop refused to work this year, I looked for a while to buy a new one. The Lenovo ThinkPads looked good, they are quite popular among Linux fans. Sony and Apple make good machines as well. Finally I decided to buy a new Samsung Series 7 “chronos” laptop, and tried to create a dual boot system for Windows 8 and Ubuntu 12.10. This turned out to be more difficult than expected.

By default the machine has Windows 8 installed, uses UEFI and has “Secure Boot” switched on in the BIOS by default. After I switched “Secure Boot” off in the BIOS (and set it to “UEFI and CSM OS”) I was able to install Ubuntu, by booting from CD with Settings/Change PC Settings/General/Advanced Startup in Windows 8. The installation was cumbersome, because after the installation and the restart of the machine somehow ignored Ubuntu and booted only Windows 8. With the help of Boot Repair it finally worked.

So now I have got a new Samsung Series 7 laptop with dual boot setup for Windows 8 and Ubuntu 12.10. Or so I thought. Windows 8 starts fine, but if I wanted to start Ubuntu regularly the following Machine Check Exception error occured:

[Hardware Error] CPU 1: Machine Check Exception: 5 Bank 6
[Hardware Error] RIP !inexact! 33
[Hardware Error] TSC 95b623464c ADDR fe400 MISC 3880000086
.. [similar messages for CPU 2,3 and 0] ..
[Hardware Error] Machine Check: Processor context corrupt
Kernel panic - not syncing: Fatal Machine Check
Rebooting in 30 seconds

As you know kernel panic is the Linux equivalent of the Windows Blue Screen of Death. Something which you don’t want to see too often. It certainly does not sound good. The laptop started to reboot every time after the Kernel panic. The second boot trial often worked, but the Kernel Panic errors were of course annoying. I wondered if it is a Kernel or a driver problem. I deactivated Hyperthreading in the BIOS and also disabled the Execute Disable Bit (EDB) flag in the BIOS. EDB is an Intel hardware-based security feature that can help reduce system exposure to viruses and malicious code. Then the error did occur less frequently, but it still appeared occasionally.

Finally I found a Kernel bug report 47121 where someone reported that it maybe helps to set the “OS Mode Selection” in the BIOS to “UEFI OS”, instead to “UEFI and CSM OS”. The packages and libraries that are loaded seem to be different. I needed to switch to “UEFI and CSM OS” to install Ubuntu in the first place. Now I had to switch it off again. But after I switched it back to “UEFI OS” the Grub boot meanu now seems to have a higher resolution and – it booted without errors. It looks like UEFI was the root cause for all the major troubles.

Thus if you get a Kernel Panic error on a Samsung Series 7 and Series 9 laptop like the above one, then have look at the BIOS settings. Deactivate all advanced settings to increase performance like Hyperthreading and EDB Bit, and set “OS Mode Selection” to “UEFI OS”. Using the right BIOS settings the laptop from Samsung works really well, with both Windows 8 and Ubuntu 12.10. It is a nice machine, high quality, good equipment, comparable in every aspect to a Macbook Pro (just like the Samsung Galaxy S2/3 is like the iPhone 4/5, and the Samsung Galaxy Tab is like the iPad).

Local vs. Remote Port Forwarding

Have you ever wondered what port forwarding is or what the difference between local and remote port forwarding is? Port forwarding is a way to forward or “tunnel” TCP traffic through SSH from one machine to another. Using just one line of code, you can create an outgoing tunnel, forward your IP requests over that tunnel, and receive the response. In this way you can pull the data from a remote server to a local server (local port forwarding), and your local machine acts as a proxy server for the remote one. Or you can create an incoming tunnel to a remote server which receives IP requests, forwards them over that tunnel to the local server where it is processed and sent back again. Thus it is possible to push data from a local server to/through a remote server (remote port forwarding).

Local Port Forwarding (Outgoing Tunnel):

  • Principle: Local host forwards/displays content of remote host. Local host acts as proxy. Tunneling opens a listening socket on localhost and transfers content to remote server
  • Command: ssh -L local_port:remote_host:remote_port login@servername
  • Tunnel: local host -(SSH tunnel)→ remote host -(SSH tunnel)→ local host
  • Example: check remote host behind load-balancer or firewall on localhost

Remote Port Forwarding (Incoming Tunnel):

  • Principle: remote host forwards content of localhost. Remote host acts as proxy. Tunneling opens a listening socket on the remote server host and transfers the content to the local host
  • Command: ssh -R remote_port:local_host:local_port login@servername
  • Tunnel: remote host -(SSH tunnel)→ local host -(SSH tunnel)→ remote host
  • Example: make localhost visible in the internet or giving access to a service on your home machine to people at work

Sisyphus Projects

You know death march projects: in the software development and software engineering industries, a death march is a name for a project that is destined to fail. Some software projects are Sisyphus projects: you build it up only to break it down a bit later. An example are Facebook applications: you build them up in a cumbersome process, and if you are finally ready, you can break it down and start rolling up the boulder again, because Facebook has changed its API again. The old API is now deprecated, and the application is no longer compatible with the new one. Congratulations! One feels a bit like Sisyphus who rolls the boulder up the hill. Remember in Greek mythology Sisyphus was a king punished by being compelled to roll an immense boulder up a hill, only to watch it roll back down, and to repeat this action forever.

Optimizing web applications for different browsers can be cumbersome, too: if you finally have optimized you application for IE6-9, and you have fixed the 3 Pixel Jog Bug and other nice relatives, there is a new browser IE 10, followed rapidly by IE 11-19, which behave completely different and introduce bugs you never dreamed of. You can start all again rolling the boulder up the hill. Sometimes software development can be exciting and fascinating, but sometimes it is just frustrating and exhausting.

Some social networks are like black holes for data

In earlier posts I tried to compare start-ups and quasars, and social networks with expanding universes. Now I would like to take a look a “black holes” and their relation to social networks.

From the inside social networks are like expanding universes, they grow bigger each day by adding more members, more relationships, and more informations. From the outside they are quite the opposite: they are acting like big black holes who suck in information and make it inaccessible for everyone outside. Robert Scoble compared large closed corporate social networks like Facebook to black holes and coined the term “data black holes”. Data vanishes inside these black holes, and never comes out again. Can we save the common, open web or is it too late?

Currently, Facebook behaves indeed much like a data black hole who sucks in a larger part of the web and private information every day. Facebook is much more closed in this respect than Google+, which has like Twitter a public feed, better private/public sharing options through the “circle” feature, and it allows the export of data by “Data Liberation”. After the IPO, Facebook wants to grow and expand its own intergalactic advertising universe even further. Whether this will be successful or not will be seen. Will Facebook be able to beat Google AdWords with their own Advertising programm by sucking in the majority of information and traffic of the web? What do you think?

(The image of a quasar or growing black hole is from Wikipeda and can be found here)

Programming together

Programming together in a group is a bit like living together in the same house or sharing the same apartment. It can be fun if all work together. It can be frustrating and annoying, too. Others will get upset if you don’t clean up the kitchen (and do not leave clean code), mess things up or if you change their things. In an apartment- or flat-sharing community, it is often the shared rooms like kitchen and bathrooms that cause the most trouble.

To be more precise, software engineers or software architects who work together are a bit like architects who live together in the house they are building. It works best if everybody agrees on a central plan (if there is any) or if everyone works and “lives” in his own space, i.e. everyone has his own room(s), owned only by himself, where the others are not allowed to change things. If you are lucky, then the others may show you their rooms occasionally. Some shared regions like the main entrance, can be public, though. Basically, programming well with others is difficult, just like living together, because likes, tastes and preferences vary.

Since programmers are like little gods, almighty and all knowing entities in the world they have created, the clash begins already if two or more programmers with equal rights must work together. One wants a red room, the other a green. One wants wooden furniture, the other plastic. To find a compromise means to communicate and talk with each other. And this is an area were most programmers do not excel. I am not good at it, either. I think it is justified to say many have chosen to become a programmer in order to avoid too much idle talk and communication. This is were the difficulties begin..

(The picture is from Flickr user Annette Bouvain and shows a flat share)

A minimum number of chips and code

Good hardware engineers like the legendary Steve Wozniak make designs which have a minimum number of chips. They try to design a simple minimum-chip circuit, because in hardware design a minimal number of chips means to minimize the cost.

Good software engineers make code which have a minimum number of lines. They try to design a simple minimum-code program, because in software design a minimal number of lines means to minimize the complexity. Less code means less effort to understand it, less trouble while maintaining it, and less hassle in changing it.

Thus in general, less items in engineering means less cost and less complexity. A minimum number of items, whether chips or lines of code, is important to achieve simplicity and the KISS principle. The KISS principle states that most systems work best if they are kept simple rather than made complex, therefore simplicity should be a key goal in design and unnecessary complexity should be avoided.

(the image from Flickr User Fellowship of the Rich shows an Apple motherboard)