Sunday, November 8, 2009

Hello, I Want to Learn Santro, and Never Mind the Driving!

Just ask a sample of students who are enrolled in the engineering colleges who aspire to become software developers, "Have you done a course on Computer Programming? What did you do in that course?" The chances are that a large majority of them would respond "I've done C/C++" The latter part is to be pronounced as "SeeSeePlusPlus" in one single breath! And during a summer break, if you ask them what they are doing, the likely responses are "I am learning Java" or "I am learning Visual BASIC" or something similar. These answers trouble me a great deal. Why is the emphasis on the programming language rather than on problem solving?

Perhaps I am not gracious. These students must be learning programming, but are laying emphasis on the programming language for reasons best known to them. Maybe it is a lot glamorous if you add a long list of programming languages to your resume, rather than simply emphasizing that you are excellent at problem solving, and that you know how to solve them using a myriad of languages. I have been teaching students for close to three decades and have been interviewing aspiring programmers for my company. Are these students able to solve problems using programming techniques well? Barring the top 15%, the rest of them struggle solving problems of even less-than-moderate levels of difficulty. And yet, they have all learned computer programming. Sorry, they have learned "SeeSeePlusPlus"!

Well, what is important? Problem solving using the procedural method or the programming language C? Problem solving and the object oriented methodology or the programming language C++?

Suppose you want to learn how to drive a car. You go to the driving school. Do you say, "I want to learn how to learn a Santro" or do you say, "I want to learn driving"? For learning to drive a car, you need a car, and that is just a vehicle. Of course, your choice of a vehicle must be appropriate. It is perhaps alright to choose any stick shift compact car like a Santro or a sedan like Honda City. Would it be alright to choose a Formula I racer? While problem solving should be the focus, the choice of the vehicle or the programming language is also important.

While learning computer programming, you need a programming language. If you were to learn programming using the procedural paradigm, you have a few choices – C seems to be ubiquitous and not really a bad choice. But there are others too. If you were to learn programming using the object oriented method, again, you have a few choices – C++, Java, C# or Smalltalk.

If you are a teacher, it is important to emphasize that the first course on programming is about problem solving, like the act of driving. The programming language chosen is merely a vehicle, like Santro or whatever.

If you are a learner, it is important to focus on problem solving and not on just the syntax and semantics of the programming language.

For starters, why don't we drop saying "SeeSeePlusPlus" and instead say "C and C++", if we have to say the two together in the same breath! But why do people say "SeeSeePlusPlus" in the first place? Well, that is another story!

5 comments:

  1. Will it help if the driver knew how the clutch or the brake worked or the effect one has on the other and the car? I think it would. Understanding how the car(system) functions would go a long way in a) driving it better and b) build better/efficient systems. Programmers don't necessarily have to be just good drivers. They have to "graduate" and help build better systems.

    ReplyDelete
  2. Yes, indeed, in the long run drivers would be able to be more effective if they knew how the various subsystems of a car function. And so would programmers be more effective, in the long run, if they knew deeper and subtler things about a programming language. But I am talking here about beginners who learn prograamming for the first time. Far too many courses and training programs focus almost the entire part on the sytax and semantics of the programming language, and not on problem solving. Learners end up learning the various constructs of a programming language, but are unable to apply them to solve problems.

    The beginning lies in the capability to drive before one examines the vehicle in subtler details. The beginning lies in the capability to write programs to solve problems before one examines the subtler aspects of programming constructs to write possibly niftier and more efficient program to solve the same problem.

    ReplyDelete
  3. How long is "Long run"?. Is it 2, 5, 10 years or more? Unlike in the US I don't see many people writing code in India for more than a couple of years. In a strict hierarchical culture they all want to move away from coding into some sort of "lead" role as soon as possible. They don't stay as programmers to learn the subtleties of a language and write solid code. In my view programming is still seen as an entry level position to be graduated out of at the earliest.

    ReplyDelete
  4. I recently reviewed some C++ code written by engineers from a third party consulting company(a big firm in India). No OO principles were used and several methods were hundreds of lines long. This code had gone through all the necessary stages of a typical software development process before code was delivered. It became obvious to me that neither the developers nor the reviewers knew elementary C++ or OO methodologies. Teaching C++ by itself won't help if the students don't know object oriented design and techniques.

    ReplyDelete
  5. This view that programming is only an aid to gain entry into the software industry (that exists among students from different streams)is what most probably makes people learn programming languages(because the recruitment ads ask for people with good knowledge of c,c++,perl,ruby,java,python etc) with emphasis on the language constructs rather than pondering over what programming is all about,its place in the entire spectrum or the nature of the problem at hand and the constraints that have to be considered while solving the problem.
    The issue with this kind of learning is that you will have great understanding of the different tools that are provided by the programming language,but when given a problem you might not be able to efficiently use them to solve the problem.
    Also this sort of passionless learning is what drives people to seek some sort of administrative job rather than understanding that 'computer science' is indeed a science and that there is a great deal to it more than the exponentially increasing number of programming languages day by day.
    As a student from an entirely different engineering branch I have had this experience,because my only point of contact with the industry was what I would listen to from my peers(Man! Java is THE best language presently in the industry,you got to know this or you wont get through the interview!) or read in the newspapers (wanted engineers with good knowledge of C,Java,.Net,C#).I joined a reputed instituition(which claims to have heralded the IT industry in India) to learn Java and ended up burning a good deal of money.
    But my 'moment of enlightenment' was when I talked to some veteran professors(like Raja) and realised the 'science' of(or behind) programming.Under their guidance I am learning (or should I say learning to enjoy) programming again.There is great joy in coming up with great solutions for a problem rather than writing horrid inefficient code which might solve the problem but is most probably a no-brainer and rubbishy.
    So, though it is the student's responsibility to learn,I feel it is the responsibility of the teacher to make the subject seem enjoyable and encourage them to learn it in the right way(learn for learning sake rather than learning because it might help you get a job).

    ReplyDelete