What if anything have we learned from C++? [video]
1–10 of 56 posts
Re: What if anything have we learned from C++? [video]
#2Re: What if anything have we learned from C++? [video]
#3After twenty years of using it? That I was wrong, that plain-old C really is better.
foo (a, b, c)
char *a;
int b, c;
{
/* do something cool here */
}
And there were no "function declarations" (who needs argument type and cardinality checking anyway), no "slash slash" single line comments, no need to declare a return type as int was implied, say goodbye to const and volatile qualifiers, any char array is mutable (including those defined in double quotes), plus be sure to use function pointers thusly: (*some_pointer) (insert, args, here);
Instead of: some_pointer (looks, like, a, function);
Oh yeah, and say adios to struct initialization using the C89 syntax. And it's a no-no to try and initialize a local array along the lines of: char *strings = {
"this", "is", "convenient", "isn't", "it?"
};
So if you wish to assert (pun intended) "that plain-old C really is better", then be sure to acknowledge where a non-trivial amount of what is known as "plain-old C" stems from.Re: What if anything have we learned from C++? [video]
#4After twenty years of using it? That I was wrong, that plain-old C really is better.
The C that you call "really is better" is not the C which existed before C++. It is "K&R C", which looked like this: foo (a, b, c) char *a; int b, c; { /* do something cool here */ } And there were no "function declarations" (who needs argument type and cardinality checking anyway), no "slash slash" single line comments, no need to declare a return type as int was implied, say goodbye to const and volatile qualifiers…
Re: What if anything have we learned from C++? [video]
#5Earlier quoted context omitted.
The C that you call "really is better" is not the C which existed before C++. It is "K&R C", which looked like this: foo (a, b, c) char *a; int b, c; { /* do something cool here */ } And there were no "function declarations" (who needs argument type and cardinality checking anyway), no "slash slash" single line comments, no need to declare a return type as int was implied, say goodbye to const and volatile qualifiers…
by plain old, i think infradig was implying that C was plain and old compared to C++, and not about an older standard of C.
Re: What if anything have we learned from C++? [video]
#6After twenty years of using it? That I was wrong, that plain-old C really is better.
Re: What if anything have we learned from C++? [video]
#7A paper from the man himself on getting a type switch in C++ almost as fast as what you get in OCaml. http://www.stroustrup.com/OOPSLA-typeswitch-draft.pdf
Lot's of other places where he's omitting things because he wants to plug C++.
Also, he also seems to be confused between "an efficient language" and "a language that allows you to create something that runs efficiently".
Re: What if anything have we learned from C++? [video]
#8After twenty years of using it? That I was wrong, that plain-old C really is better.
Re: What if anything have we learned from C++? [video]
#9But I am happy I stuck with it as it opened up opportunities to work in a lot of different and interesting domains like games, mobile apps, interactive art installations, trading systems and video and film processing apps. Also, most of my code is platform independent and very efficient.
There are a few interesting alternatives at the moment, namely Rust and Swift, but for now C++ does everything I want and since C++11 it really feels like a much more modern language.
Re: What if anything have we learned from C++? [video]
#10There did seem to be too much apologizing for how other people messed up the original idea of C++. Same for patronizing much of the industry. I can't claim it was unwarranted, but a lot of patronizing.