We define abstraction as selective ignorance.


My Talk with Dr.Stroustrup

Question_2: C++ has a very steep learning curve. How do you see it?


Takashi Toyota asked:
Many people here start learning C++. Unfortunately, however, more than 50% of them give up their work in a week or so. This happens partly because their textbooks are not good teachers. All those books have a tendency to instruct the readers to learn technical details very precisely in the initial stage. You are always saying, "Learn concepts, styles and so on first". I agree with you. I know that C++ was shaped by your "world view". C++ students should pay their attention to concepts C++ supports. Is this correct? Would you add some more advice?

References:
1. When a system is primarily the work of an individual, the system reflects the fundamental outlook of that individual. In retrospect, I think the overall structure of C++ was shaped as much by my general "world view" as it was shaped by the detailed computer science concepts used to form its individual parts.(D&E, p23)
2. The larger the system, the more levels of abstraction are typically needed for the description of the system and the more difficult it becomes to define and maintain the levels. Note that such levels of abstraction have direct counterparts in nature and in other types of human constructions. (TC++PL, p.733)

Dr.Stroustrup answered:
Your description of how people try to learn C++ and fail is horrifying. I recognize that picture and deplore that approach. I have seen books that spend a whole chapter explaining how to write an if-statement. That's absurd; an if-statement is just an odd syntax for expressing what every student learned in kindergarten or earlier. For example,"if the light is green, cross; otherwise, wait." becomes "if (light.color()==green) cross(); else wait();" That's hardly rocket science. Much of what we do when we learn to program is simply to learn a new syntax for everyday ideas we already know very well.

Like with a natural language, the important aspect of learning a programming language is to get to the point of using the language, to experiment, and make the necessary beginners' mistakes. Fortunately, when learning C++, you have the compiler to help you with the basic language rules. You need libraries to make tasks easy. Using just the bare language, almost everything is tedious and complicated; given the right library, just about everything can be pleasant and simple. When someone find C++ tedious, it is often for the lack of an appropriate library (though if often is available somewhere) and when someone ends up with messy code, it is often because they failed to buy, borrow, or build an appropriate library to help.

When I became a professor, I got to think more about initial learning than I had had opportunity to before. My books were written for people who already had a pretty good idea about how to program. In the university, I have had the opportunity to teach novices; the result has been a new approach to teaching programming and a book supporting that. It will become available this summer. Compared to traditional books, it moves very fast in the early stages and uses libraries from day 1. For example, graphics start in week 6. I call my approach "depth first", "concrete first", and "concept based" because it rushes through the techniques and principles to reach a depth of knowledge where the student can do something reasonably interesting and then proceeds to solidify the student's understanding with examples, language features and library facilities. The"concrete first" label refers to my use of concrete examples to introduce concepts. I go from the concrete to the abstract much in the way children acquire new skills.

Often, people expect programming to be easy. It is not. Programming is a skilled activity requiring appreciation of fundamental principles and practical techniques. Often students are in too much of a hurry. Becoming a good programmer - in any language - takes years. It is not all that different from learning any other complex skill. Yes, you can write programs after a couple of days, but the results are typically similar to what a new student of the violin can produce after a couple of days - not really something that others would listen to with pleasure. A programming language is only the means of expressing ideas. Unless you have ideas to express the language is irrelevant - and it takes time (years) to learn enough about programming and of an application area to be able to make a positive contribution.


Previous | Next



Our approach is possible only because C++, and our understanding of it, has had time to mature.


Copyright©Takashi Toyota 2004- 2008
Today is 2008-07-07.