The mind of a programmer

aHere is a short essay on the minds of the programmer and programming in general. Programming has been variously described as a science, an art, as black magic, as the work of craftsman etc. It is true, programming can be any or all of that described above. Programming in my opinion is going to become increasingly important in the years ahead. I would certainly advocate some knowledge and grasp of programming. There are many books that claim to teach programming anywhere between 3 to 21 days etc. This is not true. Learning to program is just the beginning of a never ending process. Here is a great piece by Peter Norvig – Teach yourself programming in 10 years.

Programming can be considered to be a language to express your thoughts on the solution to a problem. The ability to express in a programming language can vary between being simply pedestrian to being absolutely poetic! There are those who can wax eloquent in a programming language. In any case, programming is a means to an end, the end being the solution to a problem. Typically the solution to the problem, is expressed as an algorithm, which is then is coded through a programming language,. Programming can be a highly analytical and creative activity.

Programming is different from most other professions that I can think of.  To get started all you need is a computer and an Integrated Development Environments (IDE) for e.g. Eclipse, which can be downloaded for free. The IDE can be used for writing code. There are no other associated costs.

Programming is also different from other professions in the sense, that you get your response immediately.  For e.g. a painter can paint anything and imagine that he/she is the next Rembrandt or Picasso.  A guitarist can create the most hideous sound and think he is Jimi Hendrix’s re-incarnation.  Other professions like architects, civil engineers, scientists have to wait for several months to know whether they are in the right direction or not. It is not so with programming. You write code. When you compile it or execute it, the verdict is instantaneous. It is simply a “no go”, if you are wrong. There is no middle path. You are either right or you are wrong.

Having said that, I would like to look at the typical experiences of a programmer?

Tears, sweat and frustration: In the beginning programming is usually very intimidating and frustrating. In the initial stages when you grapple with the quirky syntax of the language, and try to formulate your thoughts around the problem, you will hit many speed bumps. It can be exhausting, tiring and nerve racking.  There are no shortcuts in learning how to program. You have to go through the grind, memorize certain phrases and hope that your program works.  Once you have you arms around the syntax, you are on your way to actually writing code that achieves something. Here again you will run into all sorts of problems, like loops that never end, inexplicable program crashes and mysterious run time errors etc. The early stages can be difficult and quite unforgiving. This phase requires patience to get through.

Feelings of megalomania: Someone with 5 to 7 years of programming experience knows most of the typical constructs by heart and will be able to quickly churn out programs, rather fast. This is a dangerous phase. Since you have been doing the same thing for a couple of years you are typically aware of the problems and can possibly tweak code to make it solve a slightly different problem. This is usually the stage when programmers start to experience a sense of megalomania. There are delusions of grandeur. You may remember the programmer shown in Golden Eye who keeps saying “I am invincible!” whenever he is able to solve a knotty problem. These programmers have the feeling that “Nothing is impossible”

Programming is a great leveler.  Programming can be a great boost to your ego. When you are able to visualize a problem, strategize the solution and actually get it to work, it does wonders to your ego. Programming can really boost your self-esteem. But you should not just stick to your comfort zone and write code in exactly the same language in exactly the same domain.  It really helps to move to a different language, preferably a different paradigm – for example a move from procedural (C) to Object Oriented (Java, C++) or from object oriented to functional (Lisp, Haskell). Similarly moving from Web programming to protocol design or from data communication to app design will do wonders. The shift to a new programming paradigm and new technical domain will put you on even keel. All your knowledge and expertise will evaporate when you move to a new domain. Moving around in technology will keep you more grounded. You will realize that there is still so much more to learn. There is yet another universe.

In other words, programming keeps you honest!

My journey of 25+ years as a programming has helped me to learn technology in all its flavors. More importantly I was able to learn about myself. I have seen it all. Sweat, tears, frustration, fear, anger, pride and ecstasy.


A few years back, once you learned the basics, if your work did not involve coding, there was not much to do. But these days you can really do some fun things. You can imagine any app you want and actually start to realize it. Who knows, your app may be the next block buster! I am certain all of us have ideas which we want to implement. Programming allows you to just that!

Programming really makes you exercise your grey cells. Who knows we will soon hear that research has proved that programming helps prevent Alzheimer’s and Parkinson’s disease.:-)

In any case, learning to program is one good thing.

Also see
1. Programming languages in layman’s language
2. The common alphabet of programming languages
3. How to program – Some essential tips
4. Programming Zen and now – Some essential tips -2 

You may also like
1. A crime map of India in R: Crimes against women
2.  What’s up Watson? Using IBM Watson’s QAAPI with Bluemix, NodeExpress – Part 1
3.  Bend it like Bluemix, MongoDB with autoscaling – Part 2
4. Informed choices through Machine Learning : Analyzing Kohli, Tendulkar and Dravid
5. Thinking Web Scale (TWS-3): Map-Reduce – Bring compute to data
6. Deblurring with OpenCV:Weiner filter reloaded

Find me on Google+

Programming languages in layman’s language

There is such a wide variety of programming languages that there is always confusion as to why there is such a profusion of languages. Different programming languages solve different classes of problems. Programming languages can be classified broadly into the following 4 classes.

Procedural Languages: In these languages one thinks in terms of the sequence of steps to solve the problem. It could be thought of solving the problem in 1st person and then substituting the “I” with “the program”. So for example in procedural language we could think

I will wake up.
I will brush my teeth
I will open fridge
I will take milk
I will warm milk

So in procedural languages actions are performed sequentially to achieve the desired end result.

Examples: FORTRAN, BASIC, Pascal, C

Object Oriented (OO) Languages: When a problem is solved using Object Oriented techniques we look at the world objectively. So we need to first identify the participants and functions performed by each of these participants. So the above situation would be viewed as

I, Fridge, Microwave – Participants

then we need look at what functions the above 3 will perform
I – wake up, brush
Fridge – Open door, close door
Microwave – Warm

Hence in OO languages the problem is solved as the interaction of functions between participating objects.Examples: C++, Java, Smalltalk, C#

Both procedural and OO languages are compiled languages and are also known as “Imperative Languages”. A useful analogy is to view compiled programs as mashed, pre-cooked food that can be easily assimilated by the digestive system or the raw hardware.

Dynamic Languages: Here these languages are either interpreted or converted to byte code. Interpreted languages are similar to raw & uncooked food which must be crunched, munched and digested on the fly. However these languages include in themselves many, many features that are commonly used. While the first two would just specify the method, dynamic languages include several specific features as functionalities. To use an analogy while in the above 2 programming language types one would set the time and the power level for each item to heat in a microwave, dynamic languages come with readymade buttons for those frequently used.

I – wake up, sleep, eat, drink, wash etc
Fridge – Cool, refrigerate, thaw, and freeze
Microwave – Heat popcorn, frozen food, meat etc

Since you get a lot of stuff for free and the program is interpreted on the fly Dynamic Languages take a lot more time

Examples: Perl, Python, Ruby

Functional languages: Here we think in terms of functions that are performed on items. They can be performed on any object.

For example the above problem would be viewed as the following main functions
E.g. Wake, sleep, warm, thaw, heat, cool, freeze.
We then take and apply the function ‘warm’ on the ‘milk’
Heat on ‘vegetables’  etc

In Functional Programming functions invoke other functions to accomplish a task. The problem is solved from the inside-out. In Functional languages like Lisp one starts with some core functions and build layers over it. For e.g. in a functional language we would express calorific energy as

metabolize (assimilate (digest (chew (food))))

Examples: Lisp, Clojure, Haskell, Erlang

Each language is best suited for only certain applications. So just like it is inappropriate to use pliers where an Allen wrench would suffice we need to know which language is most suitable. If we know what the class the problem is and the performance we want we can choose the appropriate language

Find me on Google+