Classification of Programs
harish — Fri, 05/19/2006 - 21:13
The other day my friend and I were having a discussion, or rather let me put it as an argument on who is a better programmer. This was not the classical argument where one claimed to be better than the other. It was an argument where the two of us were trying to prove that the other was better at programming. In order to give you guys a clue as to where I am heading let me include a small excerpt from it.
Him: i dont program well anytime
Me: rofl thats the best joke ive heard so far
Him: well... XYZ will vouch for that
Me: only XYZ will vouch for it, for them programming means error checking
Him: whatever
Him: programming = programming
Me: but programming <> programming at XYZ
Him: how can that be possible?
Him: either one can be true
Me: going by majority, programming@XYZ!= programming elsewhere
Him: programming == programming
Him: is tautology
Him: you cannot deny it
Me: programming is just 1 variable, there are other variables too like XYZ
Him: it does not matter where you program
Him: it only matters how you program
Him: it is not variable
Him: it is a compile-universe time constant
Him: it cannot change
Me: what matters is who judges the programs, which is runtime, and nor compile time
Him: yes but good programming == good programming
Him: in any runtime you take
Him: it is like speed of light
Him: it does not matter what frame of reference you take
Him: speed always travels at c
Me: no its not universally agreed, whats good for 1 is not so good for the others
Him: but some things are universal
Him: and programming is one of them
Me: remember my program is art theory, for some groups modern art is beautiful, for others modern art is ugly
Me: and surely program is not universal, there's no definition or fact for a Good program
As you can see this conversation was quite hilarious (at least I found it so). Then there was something that struck me. Each person has their own view of what a good program is. Is there a way I can classify it into groups where each group defines its rules for a program to be a good program. So let me have a try in classifying programs. What I present here may be right or wrong, but it is just a perspective of an amateur programmer.
The obvious classification of programs is using the Programming Paradigms directly to classify them. But these do not classify what are good to what are bad. So let me try a different route.
There is one class which considers a program to be a good one if the algorithm implemented is good. They consider a good algorithm as is an optimal algorithm which will perform efficiently under the given input range. For them performing efficiently implies it works without any hitch in the given memory and time.
Then there is this predominant class of people who only look at the error checking in the program. They are not bothered about the algorithm used. For them the time and space complexity does not matter. Their only condition is that all errors must be avoided. (By errors I mean input errors. For the extremists this includes all the unwanted, useless, god forsaken cases to be handled).
There also exists a minority group for whom all they require is that the program to function in normal conditions. They are neither bothered about the algorithm nor about the error checking.
A few groups look at the way the program is written, i.e. the readability aspect of the program. Some of them look at the formatting, some at the variable and function names, some at the modularization etc.
The four classes I mentioned are not the only ones present, nor are they mutually exclusive. They are the common ones I have seen. If I can call them primary sets, then many secondary sets can be formed out of them using various permutations and combinations which constitute the real world.