Software Engineering discussion
date
newest »

message 1:
by
[deleted user]
(last edited Apr 27, 2010 08:33AM)
(new)
Apr 27, 2010 08:32AM
I just started reading Chapter 1, which contains an interview with Bjarne Stroustrup on C++.
reply
|
flag
I think proper etiquette says that at a dinner party it is impolite to discuss politics, religion, money, and programming languages. Let the language wars begin!
Ah, C++. My first OO language. I have a love/hate relationship with C++. I admire its continuous focus on providing OO abstraction while generating code with close to the metal efficiency. I like the challenge of trying to get it right. But I hate the complexity when I have something to get done quickly, and I hate that I all too often get it wrong. I hate trying to teach OO with it (which I don't these days... I use Java).
Reading this chapter gives me the feeling that C++ has fallen too far behind its competitors for most applications (writing an OS is one obvious exception). These days, characteristics like quick-to-write, security safe, concurrency capable, standard multi-domain libraries, and network awareness are essential. While Bjarne tries to make a case that C++ is getting there, it is over a decade late. And today, extremely efficient execution and memory efficiency isn't a top priority for most applications.
C++ was complex in the beginning, and it seems to be getting REALLY complex. He mentions this list of things that I have never heard of before: static_assert, constexpr, concept, futures, move semantics, and smart pointers. I have been away from it too long.
Bjarne struggles to persuade us that secure C++ coding is not a big problem, and today's C++ programmers shouldn't really need pointers. Maybe, there are just too many stupid programmers out there?
I liked his discussion of generics (templates in C++) as a separate programming paradigm, along with OO, functional, imperative, etc. I never thought of it this way, but I think I agree. I also really agree that every language needs a set of higher level design principles and guidance, like his book "The Design and Evolution of C++". I wish I found something like this for Haskell. And, there needs to be a standard place to go to find libraries... Perl is great in this respect. I do agree with Bjarne that Java had much deeper pockets behind it than C++, and this makes a difference, but I believe that this was a very secondary reason for Java's success vs. C++.
For most OO tasks for me these days (but certainly not all), it is: Goodbye C++, we had some good times together, I learned a lot from you, but I've moved on to the next generation of OO languages... over a decade ago.
Agree? Disagree? Your turn!
P.S. I really, really hate explicit memory management.
Ah, C++. My first OO language. I have a love/hate relationship with C++. I admire its continuous focus on providing OO abstraction while generating code with close to the metal efficiency. I like the challenge of trying to get it right. But I hate the complexity when I have something to get done quickly, and I hate that I all too often get it wrong. I hate trying to teach OO with it (which I don't these days... I use Java).
Reading this chapter gives me the feeling that C++ has fallen too far behind its competitors for most applications (writing an OS is one obvious exception). These days, characteristics like quick-to-write, security safe, concurrency capable, standard multi-domain libraries, and network awareness are essential. While Bjarne tries to make a case that C++ is getting there, it is over a decade late. And today, extremely efficient execution and memory efficiency isn't a top priority for most applications.
C++ was complex in the beginning, and it seems to be getting REALLY complex. He mentions this list of things that I have never heard of before: static_assert, constexpr, concept, futures, move semantics, and smart pointers. I have been away from it too long.
Bjarne struggles to persuade us that secure C++ coding is not a big problem, and today's C++ programmers shouldn't really need pointers. Maybe, there are just too many stupid programmers out there?
I liked his discussion of generics (templates in C++) as a separate programming paradigm, along with OO, functional, imperative, etc. I never thought of it this way, but I think I agree. I also really agree that every language needs a set of higher level design principles and guidance, like his book "The Design and Evolution of C++". I wish I found something like this for Haskell. And, there needs to be a standard place to go to find libraries... Perl is great in this respect. I do agree with Bjarne that Java had much deeper pockets behind it than C++, and this makes a difference, but I believe that this was a very secondary reason for Java's success vs. C++.
For most OO tasks for me these days (but certainly not all), it is: Goodbye C++, we had some good times together, I learned a lot from you, but I've moved on to the next generation of OO languages... over a decade ago.
Agree? Disagree? Your turn!
P.S. I really, really hate explicit memory management.

The interview format is easy to read versus text book styles. I like how the interview questions address current themes even on old languages.
I write alot of C/C++, so I'm probably biased that I really like C++. I've written C++ for alot of platforms: ARM processors, TI DSP, Windows, and unix.
The idea of "You don't pay for what you don't use" may be my favorite part. Alot of my C++ looks a lot like C code, but I can use C++ where appropriate. I'm sure that I don't use the most complex components of C++.
I do I agree that there are probably better languages for teaching OO concepts. Most C++ OO classes would spend too much time on a C++ specific learning curve.

Especially interesting to me is his take on Java vs C++. I never considered that Java's success was due to Sun's promotion of the language, but that makes sense in hindsight.
It is interesting that in the three "successful corporate" languages he references - Ada, C++, and Java - two of the three originating authorities essentially went bankrupt (Bell Labs, Sun) and the third (DOD) is running a big deficit.
Perhaps creating a "successful" widespread programming language lacks any real economic value in the marketplace for the company that creates it? If you try to sell your language, then programmers will turn away in favor of another more open language. But if you "give away" your language, you might not make enough $ to survive.
Apple's strategy re Objective-C seems to be avoiding this. Their recent restrictions on developers using other languages and APIs for Apple widget apps may seem to be driving developers away from Objective-C - but since Apple makes its $ off the hardware, this may not matter.
It's been more than a decade since I wrote any substantial C++, and I know that the language and libraries have changed - but I was always amazed at the complexity of the language. Bjarne puts down Java for its inefficiency, yet maybe its greater simplicity is worth it vis a vis C++, especially for teaching programming.
Related is this quote of Bjarne's - when he's asked whether it's worth it to design a new language:
That doesn't mean that I think that C++ is the perfect language of its kind. It is not; I'm convinced that you could design a language about a tenth of the size of C++ (whichever way you measure size) providing roughly what C++ does. However, there has to be more to a new language that just doing what an existing language can, but slightly better and slightly more elegantly.
Is "one-tenth" just slightly better? Seems it would be a "whole lot" better, especially for making it widely-used.