Ruminations on Programming

September 23, 2008 at 3:52 pm | Posted in Hacking, Programming | Leave a comment
Tags: , , , , , ,

This post does not contain anything except my own ruminations on programming. Its just my own experience of 3 years, 2.5 years to be exact, with programming. In my 6 months at new job, I have learned C and Socket Programming while I already knew some C++ and Common Lisp.

I think C teaches you a lot about memory management. Although many programmers claim that C++ is a better C, in some context I don’t agree with them completely. When you work in C you work with arrays and pointers all the time, while in C++ the standard way of learning is to start using Strings, Vectors and Algorithms from Standard Library, while iterators come on their way towards you. I have spent much time on them. In the very beginning stage of learning, I have to admit that C++ does not instill a thought of understanding memory management whereas C does, C does it all the way. This does not mean that one is superior over the other. Its just that their way of thinking about solving a problem are entirely different. If one very well wants to understand about how the hardware is managed, at a very early learning stage, I think one should start with C. I think C teaches you how to manage hardware, a general programming concept that everyone must learn and it will take lots of time before you get the hang of it. Now lets go to the other opposite side of the hardware management, Problem Solving, if one is not interested in extreme performance or efficiency, and wants his program to run faster than Java, then I think one can go with some language better than Java, some examples are Mercury, Haskell, Ruby and Common Lisp.

There are some people who believe that using C++ over a longer period of your life, like 10 years, is a good way kill your precious youth. I don’t have any opinions on that except one. C tries to manage that hardware memory management while it tried being a portable language many many years ago. Its good at that, it does so explicitly. Common Lisp, created long before C, tries to focus on solving very difficult problems and it is quite good at that. Now both, being good at hardware and being good at Problem Solving are diagonally opposite skills and very valuable if you want to spend a lifetime of yours into writing Software. C++ tries to be good at many many things, it tries to manage hardware properly, shifting that task of memory management from programmer to compiler. C++ is backward compatible (not same) with C, it has all the problem on today’s AMD Athlon Dual-Core processor which C had on PDP-11 in 1970s. 2nd, it also tries to good at problem solving, while managing the memory properly, I think in doing so it has acquired lots of obtuse problems on its own, along with all the C problems. I think Stroustrup could have made it a Solution to C problems rather than C Problems + Problems of its own. One thing it did excellently is putting Object-Orientation into the industry, which no other language did. Then again, choosing to learn a programming concept and putting Object-Orientation into industry are two very-very different things. I also have a feeling that C++ does not teach you the concepts and ideas that are ideally transferable to general purpose programming. Ideally because, whatever you will learn in Haskell, Lisp or C will be completely transferable to other languages as well but I don’t think this is the case with C++. Go to comp.object and everyone will tell you, not to start learning Object-Orientation with C++, choose something ideal like Smalltalk, Lisp, or other language. I think C++ has its own ways of solving problems which, though transferable, and not ideal concepts like “Functional Programming In Haskell”, hence not transferable from my standard. You can manage memory in C++, just like C, without any problem, you can write Object Oriented programs in C++, like you write in any other language, you can even write C++ programs using generic programming paradigm. Question is not what a language can or can not do. From my viewpoint, question is also not what a language forces you to do (Many people claim that Smalltalk forces an OO paradigm on programmer but thats just stupidity in ignorance. Programming is not that simple). Question is what a language instills into you, over a longer period of time, the time period of 10 years. I have yet to meet a person that says after 10 years in C, I am wasted, after 10 years in Lisp , I made a fool of myself but I have seen some people who say after 10 years in C++, they thought Why they had bothered with C++ at all. If you think after 10 years that language was not worthwhile, I think one should stop now. I will not be learning that kind of language. Your experience and your company of good programmer will instill a common-sense in you about programming and that common-sense will tell you, will make you able to distinguish between a good tool and a bad tool.

Now still, while I am going to end this post, I believe that C++ is far and far and far and far better than VB and .NET, which are wrongly known as programming languages. I think, if Bill Gates does not want to do that, at least, as a courtesy or better as a responsibility towards our fellow programming community, we should label them as Kid-Beats and Fool’s Glory respectively. They don’t even qualify for being called as programming languages. How you will create a binary-search-tree in VB ? .. Can You do that without creating a mess ?

Copyright © 2008, Arnuld Uttre, #331/type-2/sector-1, Naya Nangal, Distt. – Ropar, Punjab (INDIA) – 140126

Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.


Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at
Entries and comments feeds.

%d bloggers like this: