Category Archives: Uncategorized


Real experience gained from the scene of crime :-)

Computer programmers spend much of their workday in front of a computer in an office setting. And whenever they move outdoors they don't leave there computers behind to avoid guys with itchy hands from messing with their ongoing projects. Again you never know when you are going to meet your next client, they may need some demonstration of your past projects.

However, they got advantage, everything important that one needs to know about living a successful life, you can get from programming. I know, it's quite a nerdy thing to say—but the truth is that there's a lot of wisdom in code. Don't believe me? Keep reading.
Below are some lessons that I have learned from programming:

Reuse program modules to save time:
Any good programmer eventually learns that certain blocks of code (functions) can be reused in multiple programs. The function may include a certain number of lines of code, but why would you re-create those lines of code for every program you write, when you can just save them once as a program "module," and then insert that module into any future programs that need it? Automation is the key to success, so if you can find ways to automate tasks in your job that you do repeatedly, you can make your day much more efficient and save time.

Document everything:
Sometimes, it can be pretty tempting for a programmer to write code without documenting a single thing because at the moment you know exactly what you want the program to do and how you want to do it. This meticulous documentation can help in every area of life, from keeping track of birthdays and anniversaries, to keeping a log of daily business transactions and why you made them. It's naive and inefficient to trust only your memory to remember why you attended certain meetings or why you made certain purchases. A daily journal or log can go a long way to freeing up your mind for more important things.

Always Leave an Escape Route:
One of the most common mistakes of an amateur programmer is the infinite loop. That's a situation where the condition required to break out of the loop never actually takes place, so the program stays in that loop and never ends, this consumes 100% of the PC CPU and pretty much locks up the computer for good until you kill the process.

Free Up Memory When You're Done:
Cleaning up after you are done is another lesson. In a program, you will need to open up a stream to an output file, create a large array filled with data points, and other things that consume computer memory and resources. A clean program is one that closes those output streams or empties those arrays once the program is done with them. The idea here is to avoid a common problem with poorly written applications known as a memory leak.
It sounds like something you've probably heard from your mother, say when you were younger, right? Clean your room. Put your clothes away. Leaving things hanging around just wastes space and wastes your time when you can't find what you need later on.

These are not the only life lessons that you can learn from the art of programming, there are many more. This is why every child should learn at least one programming language in school. African Maths Initiative has been promoting this during the Annual Maseno Maths Camp. Once you've caught on to the tricks of the trade, it becomes apparent pretty fast that you can use those same tricks throughout many other parts of your life.

The Growing Programmer:


“Memory is what makes us who we are,” says Kenyan writer Ngũgĩ wa Thiong’o – a frequent contender for the Nobel Prize in Literature.

Therefore my blog today is based on memories I have had from the working environment at African Maths Initiative (AMI).

"The most important thing is not to learn all programming languages, but to understand programming concepts.... you can learn all programming languages in the world and not be able to program. You may be good in copy-pasting codes from the internet but never understand what that code is doing... this is very bad. Alex, what you should be doing is mastering the concepts of programming...choose one programming language and build on it." Danny Parsons my colleague once told me.

Once you are proficient in one, then it's easy to switch from "your" language to others easily.

This is something I have proved. I chose Python, taught myself from scratch, attempted challenges successfully, and here I am today sharing my experience after long working hours from my bat cave the “Code Room”.

From my programming experience from classes, I was used to lectures that left me asking myself “so what next?” With the chunks of code that lecturers left us with in class. Not understanding what they were supposed to do, because most of them could give a fatal error. From the working environment in the AMI office, I have developed a new skill: Learning how to Learn.

Think about how you work with your compiler. When you sit down to write a large piece of software, do you spend days or weeks writing code, then when you think it’s all done and completely perfect, press the “compile” button for the very first time? Of course you don’t.

Can you imagine what sort of disaster would result, trying to compile 50,000 virgin lines of code? (Like I used to do?) I have developed a new skill though: As programmers we work best in tight feedback loops: write a new function, compile. Add a test, compile. Re-factor some code, compile. We get the typos and bugs fixed as soon as possible after generating code. We want the compiler at our side for every little step, playing wingman; some environments can even compile our code as we type.

This is how I am keeping code quality high and making sure my software is evolving correctly bit by bit.