On programming

Posted at 08:35:49 am by hari under Software and Technology (337 views)

If you are a programmer in C++ and you think you're fairly advanced, you should take a course of this book which my brother bought recently: Modern C++ Design: Generic Programming and Design Patterns Applied (full review here). I read a few chapters and came away with my head swirling in the clouds. This book is essentially about generic programming using C++ templates and illustrates and implements concepts that would truly challenge even the most advanced programmers because it talks about some of the most difficult theoritical concepts you would ever have come across - namely meta meta-programming (even understanding this term might require considerable effort). If you thought basic template programming in C++ was hard enough to grasp, then this pushes even templates to the limit. In short it is revolutionary in thought simply because it requires one to completely rethink the whole idea of traditional OOP.

Nevertheless, it really made me understand how much programming has advanced of late - particularly conceptual programming. In today's context, the term "programming" itself might become irrelevant simply because it's too broad a term to encapsulate all the different methods and paradigms of software design and engineering. In fact, I would classify software design itself on the following broad levels.

  • Solving a particular problem using a specific method. This is the most basic level of software development that I can think of. This can probably be thought of as algorithmic programming in its purest form. Both the problem and the solution are well defined and the challenge is to translate the solution in a computer-readable form.
  • Solving a particular problem by choosing from different methods. This is the next level of programming where you have a well-defined problem and different methods of solving them. Your main worry here is to choose the best method under a variety of constraints.
  • Devising new methods to solve a well-defined problem. This could be thought of as creative programming - where a problem is well-defined, but the solution may not be as straightforward.
  • Using an existing paradigm to generate methods of solving undefined problems. This is meta-programming at one level. Where problems are not yet well-defined, but you devise solutions based on an existing concept (like Object-Oriented Programming) which would cover expansion of scope. This could probably be best thought of as "anticipatory programming" - where you attempt to make code re-usable and extendable. This is the stage of advanced programming which requires more planning than coding.
  • Creating a new paradigm which will generate methods of solving undefined problems. Now this is what we're talking about in the book I mentioned. It creates new paradigms of programming which will generate ways of solving future problems without writing new code. In short, it is generic programming at its height. Even grasping the basic idea is hard enough. I call it "meta meta-programming" because both the problem and the solution are undefined and requires the highest degree of skill and imagination to visualize.

We've come a long way from the traditional idea of programming - that much is sure.

Apart from this, I would also classify complexity in programming into two distinct categories.

  • Theoritical complexity - as illustrated above, you can see how a theoritical complexity increases when you start thinking about concepts and programming paradigms. Theoritical complexity is the difficulty you encounter when you think about the software design and how best to match a design with a particular problem.
  • Practical complexity - this is when the actual problem to be solved is inherently difficult. It can be anything from writing a full-fledged 3d game requiring intricate knowledge of vector physics and 3d geometry to writing an entire Operating System. Practical complexity often forces programmers to avoid theoritical complexity and choose solutions which are not necessarily suitable.

Often new programming paradigms are introduced so that practical complexity can be reduced as much as possible. But in introducing new paradigms, theoritical complexity is increased a hundred-fold which requires a complete re-learning of skills and techniques. It's like changing the whole grammar of a well-known language like English. But the time invested in learning a new paradigm might actually be worth it as it can help solve future problems of the same kind much more productively. That's why there are two kinds of programmers in this world - those who love exploring new theories to solve problems and those who just want to get the job done as quickly as possible. I can see merit in both sides.

Truly, when you go in-depth into these issues, you realize how little you actually know. If nothing else, exploring these ideas made me realize how little I know and understand in the vast field of software application development.

2 comments, 1 pingback

GravatarComment from: tuxdev [Visitor]
Have you read "No Silver Bullet" by Brooks? What you are saying kind of reminds my of that article.
Tuesday May 22, 2007 @ 02:46
GravatarComment from: hari [Member] · http://literaryforums.org
No, I haven't, tuxdev. This article originated in my own head. I'll probably take a look at it sometime, since this is the first time I've heard of it. Thanks :)
Tuesday May 22, 2007 @ 07:06
[...] at Hari’s Corner wrote his thoughts about programming and how it has evolved. Frankly, most of what he wrote about [...]
Tuesday May 22, 2007 @ 15:39

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
:!: :?: :idea: :) :D :p B) ;) :> :roll: :oops: :| :-/ :( :'( |-| :>> :yes: ;D :P :)) 88| :. :no: XX( :lalala: :crazy: >:XX
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)