I earn my living writing C++ code these days. Everyday I learn something new and interesting about this language. Many languages have a simple core, if you understand a few basic principles you can understand how most of the language works. C++ has a lot of esoteric features and no guiding principles that to borrow a term from human computer interaction allow the programmer to develop expectations. I think the reasons for this are historical.
Reading Lippman’s Inside the C++ Object model and Stroustrup’s Design and Evolution of the C++ Programming language I am amazed by how much attention was paid to match C in performance
a.f() // resolved at compile time (not polymorphic)
p->f() // resolved at runtime
The static resolution is a feature. The C++ compiler writers were trying to avoid the single instruction cost of vptr dereferencing. For a programmer this means that just marking a function as virtual does not mean that the most overriden version will be invoked. To ensure that every invocation must also be polymorphic. Also there is a principle at work here. You do not have to pay for what you do not use.
You don’t want to be demoralizing, needlessly tearing at the fabric of your self-esteem, but at every turn, you do want to be saying: “Well, that’s not quite good enough – I can do better.” In fact, it seems to me that you want to attach self-esteem to the process of becoming better, instead of letting it become attached to any static result. That way, you can be critical of a performance and not become demoralized about what it says about you as a person. The self-criticism actually becomes a self-esteem booster because you feel good about doing the hard work to constantly improve.
In Steve Job’s keynote yesterday there was a mention of Jim Allchin’s desire to buy a Mac. Today the context in which Allchin made that statement has been revealed. In his email Allchin keeps reiterating “scenario, simple, fast’. Any software developer should take these words to heart. The order of these three words is also significant. The most important thing for any software is it’s usage scenario.Usage scenario help in making the right tradeoffs while designing software. But for the few lucky people who write device drivers and are constrained by the operating system interface on one end and the device interface on the other, all other software developer need to pay a lot of attention to the design of the interface that their software presents. As far as the user is concerned the interface is the software. She does not care how extensible, modular the software is. Nor is she bothered if it uses the latest technology or is Web 2.0 compliant ;-). All the users want is to achieve their goals with the minimum effort.