hendrix
Bjarne Stroustrup: Why the Programming Language C Is Obsolete
https://www.youtube.com/watch?v=KlPC3O1DVcg
I'm confused right now:( so who is wrong ?
I am going to try to take a stab at this....
If you are confused on why he thinks C is obsolete:
I am thinking what Bjarne is referring to is that C itself is obsolete (i.e. invoking clang instead of clang++), not necessarily coding in a "C-style".
Since C itself is nearly a subset of C++, you can really do almost all of the things using a C++ compiler (i.e. clang++) that you can do using a C compiler (i.e. clang) and more. Don't forget, Handmade Hero is actually written in C++, even though it is in a style that is reminiscent of what a C coder would do as opposed to a "modern" C++ coder.
I don't necessarily have an opinion on whether he is right or not, but maybe this will relieve some confusion.
Please some one correct me if I am wrong about what Bjarne is thinking.
If you are confused on why he thinks Object Oriented programming is good:
Note: I feel that I am too inexperienced to give a definitive answer. But here are my thoughts and maybe this also can clear up some confusion.
If I understand correctly from that video, Bjarne was advocating for a language (C++) that people other than computer engineers can use without having to learn the innards of a computer. This is nice for people who don't want to learn the details of how computers work, but want to have a way of expressing their problem (which has nothing to do with a computer) in a way that the computer can understand. You don't have to waste your time learning about how the CPU cache works, because the language takes care of that for you.
The philosophy seems to be: "You can program the computer without having to know how it actually works" This is where the disagreement comes in between people like Casey, Jon Blow and other data-oriented proponents, and people like Bjarne and other OOP proponents.
OOP/GC (garbage collected) languages cannot be implemented without some sort of performance overhead, because it is just not how computers work.
Some (most?) OOP/GC proponents believe that computers are fast enough today where we don't have to care about this overhead, or that the the compilers/interpreters are so good that the program will be performant.
It is with this philosophy, that ...ates 25,000 strings per keystroke (look at the the second post).
Data-oriented proponents are frustrated with this philosophy because it teaches people not to care about performance and that these languages are good enough to make programs that will run just fine everywhere. It obscures the reality that there is no real way of making such a program run well without understanding how the hardware works.
It is also important to note that the Casey and Jon are game programmers and each frame in a game must be rendered in a certain amount time in order for it to be playable. Performance is mission critical for games.
It seems to me that the people who write programs like web browsers don't care as much about performance, hence the usage of OOP. (Please correct me if I am wrong).
So back to your question: "Who is wrong?" I'd like to take Jon and Casey's side and say that the OOP proponents are wrong. This is because you should probably care more about the end product than the code itself. The game developers have made a pretty good point that there is a lot of software that just runs slow because it is written in things like Java (think, Eclipse or Minecraft). Unfortunately, I feel I am too inexperienced to hold a strong opinion on this. Maybe there is a better reason why OOP is so prevalent other than thinking in OO way is easier than thinking in a data-oriented way. I'd like to see an experienced OOP/GC proponent try to refute Jon, Casey, etc's claims.
One way to really test to see who is wrong is do a project in OOP and a project using a data-oriented model and see which one runs better, but that might take a while...
I am curious to see what people's thoughts on this are.