Skip to content

Eliminate Stupid Mental Effort (ESME)

Kakoma edited this page Jun 9, 2017 · 5 revisions

Eliminate Stupid Mental Effort (ESME)

According to Larry Wall, one of the attributes that makes a programmer great is laziness.

The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don’t have to answer so many questions about it. Hence, the first great virtue of a programmer.

Unfortunately, this kind of laziness is not culturally reinforced in Africa. We're not talking about an adversity to working hard, we're talking about willingness to do more work than should be necessary in an ideal world. Why? Because many aspects of day to day life in Africa (commuting, etc.) involve more work than should be necessary, and therefore everyone gets used to being inconvenienced on a constant basis. Fixing those annoyances are impossible, so you stop thinking about how to solve them. However, if you bring this mentality of being okay with inconvenience (aka 'stupid mental effort') to your job as a software developer, you will never achieve greatness.

Because the effort to achieve this kind of great laziness is so important and yet so difficult in Africa, this page will document circumstances during day-to-day development that violate this kind of laziness so that others can be aware of them and learn from their examples.

Use SSH to access Github

If by chance or circumstance you clone a git repository using HTTPS instead of SSH, you will be prompted to enter your username and password when you do a remote git operation. Over and over again. Every day. Cultivate a mindset where this kind of wasted effort is repugnant, especially when a very simple solution is available. Clone the repo using SSH instead. The URL will look like this [email protected]:andela/bestpractices.git

In order to be able to clone using SSH, you will need to setup an SSH key on your local development machine, and add the public key to Github. Knowing how to do this is a fundamental part of using Git and Github. Once you clone using SSH, you never have to enter your login credentials again.

Note: The SSH key that you use to access Github should not be protected with a passphrase. Otherwise, every time you try to use it you will have to enter that passphrase. If you want a safe passphrase-protected SSH key for personal use, then create a second SSH key for that purpose.

Never work without syntax highlighting

As you move between projects, you will inevitably encounter file types that you have not worked with before. For example, Jade as a templating language. Your editor may not be configured to automatically display proper syntax coloring for the file type. Finding the right editor plugin to enable syntax highlighting will take approximately 2-5 minutes. Deciding to just put up with plain-text editing will cost you small bits of extra mental effort many times a day, every day, which adds up to more than 2-5 minutes. The first time you open a file and its type is not recognized by your editor, you should cringe with horror! Hastily search for the plugin so that you don't have to stare at the atrocity that is plain-text code again.

Clear your terminal with shortcuts

As the use of terminal becomes an everyday affair for you, you will encounter situations where your terminal gets full and tracking errors/logs becomes a little hard for the lazier ones. one shortcut that comes in handy is the 'command+k' which clears your screen.'control+c' stops the current running process and also the directional up button on your keyboard lets you see the last entered command. 'control+r' allows you to text search a previously entered command. To exit the search mode, press 'esc'.

Learn your IDE Shortcuts

Whatever IDE you may be using, you can always do things faster. Familiarize yourself with the shortcuts your IDE of choice may have provided.

For example, here are some shortcuts for Sublime Text.