19 June 2015

How I Started Programming

I could have started computer programming much earlier than I actually did. In my final year in high school, one of my teachers asked if I was interested in computer science. To my regret, I answered "No" without thinking.

Haber Process

In our high school physics and chemistry handbook, I had read about the reaction between nitrogen and hydrogen to form ammonia and heat. What was amazing was that the reaction also took place in the opposite direction at the same time, which meant that when heat was applied to ammonia, nitrogen and hydrogen were obtained! The question arose: which reaction would win? Would all of the nitrogen and hydrogen be consumed, leaving only ammonia and heat, or would the opposite happen? The logical answer seemed to be that the faster reaction would win.

The rate of reaction is directly proportional to the concentration of the chemicals. If we start with nitrogen and hydrogen, the forward reaction will initially be faster than the reverse reaction, because we start without ammonia. As the forward reaction progresses, the rate of the reaction lowers because the concentrations of nitrogen and hydrogen lower as they are consumed. As ammonia and heat are formed, their concentrations increase thereby increasing the rate of the reverse reaction. After some time, the rates of the two reactions will be the same, and the amounts of all the chemicals will not change from that point on.

When manufacturing ammonia commercially Haber Process, the intention is to transform as much as possible of the nitrogen and hydrogen into ammonia. Through experimentation it was found that reaction mixtures maintained at different temperatures contain different proportions of nitrogen, hydrogen and ammonia. The lower the temperature, the higher the proportion of ammonia. Unfortunately, the rate of reaction is inversely proportional to temperature. To keep the process economical, a compromise temperature has to be selected.

This type of work I found fascinating, so I decided to study chemical engineering at university.


In the second semester of the first year at university, we had half a course on computer programming in Fortran. The other half of the course dealt with chemical engineering mass balances. The course did not have a prescribed handbook, only some notes prepared by the lecturer himself, which I did not understand at all. The lectures were not illuminating either. I failed the course.

The next year, I found a textbook on Fortran in the library, which helped me to pass the easily. After the course, I did not program again for almost ten years.

Prime Numbers

One of my friends gave me an article about some mathematicians who have calculated the next biggest prime number. This caused me to try and calculate the prime numbers myself. The only tool I knew was Microsoft Excel and its spreadsheet formulas, which turned out not to be effective. Yet I had a feeling that it must be be possible to do it in Excel. Many searches in the help files brought me to the blank white canvas of the built-in text editor for Visual Basic for Applications, but unfortunately I had no I idea what it was.

I resorted again to my employer’s library in search of books on Excel and found a book on Visual Basic for Applications. I spent a weekend learning the language, and writing the first version of a program for generating the prime numbers!

I wrote a VBA script to help my friend who originally gave me the prime article to automate linear regressions on laboratory data, and a spreadsheet formula for automatically calculating the mass numbers of molecules based on their formulas.


When one of my colleagues noticed my interest in programming, he gave me a set of CDs which contained a complete course in learning Visual Basic 6. This course was very well made and I enjoyed it thoroughly. I built first a unit converter, which I never quite finished; then a stopwatch/countdown-timer/alarm-clock program for Windows which I called Timepiece. It is still hosted on SourceForge and has received more thant 3700 downloads. It is also listed on CNET. On another site, someone actually made a video on how to install and use it!


Although I was employed as a chemical engineering technician, I did not have an opportunity to operate the chemical plant or do any of the work I dreamt of when first starting out in chemical engineering. My job consisted mostly of writing documents which I found boring.

When I was about to register for the final module for a Bachelor’s of Technology degree in chemical engineering, I decided to instead register for a correspondence in computer science. So far I have completed the first two academic years, except for two modules.

A year later, I decided to resign from my job and start a startup. The startup is a web application for advertising cars for sale!

Tags: essay computer programming learning chemistry