The Legos experiment and why it feels so bad to write useless Software

Let's talk today about a constant subject in our daily life: motivation. Motivation is the force that makes accomplish our goals and understanding where it comes from can help us keep our daily tasks fulfilling. There are many interesting experiments conducted to explore what makes us motivated to work. One of them is the "Legos experiment" conducted by Dan Ariely and his team.

The experiment consists in giving a Bionicles Lego to the subjects assemble in two different situations:

  • Meaningful condition: After the subject assembled the Lego, he would place it on the desk.

  • Sisyphus* condition: After the subject completed the first Bionicle and began working on the second, the experimenter would disassemble the first Bionicle and place the pieces back into the box.

Other than this, the conditions on both situations were the same. The subjects were paid $2.00 for the first Bionicle, $1.89 (11¢ less) for the second one, and so on linearly. Despite the fact that the pay was the same on both conditions, the subjects on the meaningful condition built significantly more Bionicles than the subjects on the Sisyphus condition. Which seems to give us a hint that money isn't our only motivation.

Talking about software development, many of us have been in the situation of writing seemling useless code:

  • Working on fixes in a project that has a due date to be discontinued;
  • Working on a never ending project that doesn't seem that will ever run on production;
  • Writing code on personal projects to study
  • Programming in a language that is not broadly used

It is really frustrating to write code that seems like it will go directly to the trash bin. But it is unrealistic to expect to always work on the best and coolest projects and we may find ourselves quite often in these types of projects. How can we keep ourselves motivated in such situations? In my career, it always helped to try to reach something beyond what I was doing.

For example, working on fixes on a system that is about to be discontinued must seem like a waste of time, but we have to think of the users that still depend on it to do their daily work. One time I was working on a very old project that was about controlling user access to other applications. There was a particular process that was taking a few hours and the user was required to certify it was done before leaving the office. I was assigned to fix it. After the fix, the few hours were resumed to a few milliseconds. The project was a nightmare to maintain, but it was quite rewarding to know that I saved many people's Friday night.

When working on a never ending project, you may find the opportunity to test new ideas, new tools and technologies so you can enrich your knowledge and your resume. I've seen this being done many times actually. Developers that completely changed their careers by applying technologies they wanted to work with on never ending projects and adding it to their resumes.

When writing code on personal projects to study, you may do it in a way to build a portfolio so you may have better chances of being hired in the future.

I guess we can always add more meaning and purpose to what we are doing and improve our productivity and mental health!

*Sisyphus (or Sisyphos) is a figure from Greek mythology who, as king of Corinth, became infamous for his general trickery and twice cheating death. He ultimately got his comeuppance when Zeus dealt him the eternal punishment of forever rolling a boulder up a hill in the depths of Hades.