Wednesday, January 05, 2005

Bricks and Programming Languages



Let us compare the choice of a programming language required to construct a software product, to that of bricks required to construct a building.

A high-level programming language is like a set of bricks that are of larger size than ordinary bricks. So, by using a high-level programming language you can construct a software faster, than you can with a low-level programming language. That's because, the amount of bricks you need to construct a building, is conceptually equivalent to the amount of lines of code you need to write, to build a software product.

But by using bricks that are of small size you have more control and can build quite intricate designs using them. Now, you can do the same thing using blocks that are of larger size, but you will need to have blocks that are specifically meant to get that kind of intricate looking design.

Similarly, a high-level programming language needs to provide language constructs that allow you to implement behavior that you would have to otherwise put sufficient effort into to implement using a low-level programming language (Pause and recall implementing a while loop in assembly).

I find the analogy between programming languages and bricks interesting because as computers become faster (in accordance with Moore's Law), new programming languages would continue to be invented which are more closer, than those that preceeded them, to how humans need to be communicated the solution, than how machines need to be.

Consider automatic garbage collection, which is a great productivity booster for example. All the recent programming languages, like C# and Java for instance, support automatic garbage collection, while none of the older programming languages did. Thus, these languages can be considered to be at a higher level than some of the older programming languages, like C/C++, which do not provide an automatic garbage collection facility.

The skill and effort saved by choosing a high-level programming language can be better utililized to build more beautiful software.