Bjarne Stroustrup Reflects On 25 Years of C++
eldavojohn writes "Today roughly marks C++'s first release 25 years ago when about six years of Bjarne Stroustrop's life came to fruition in the now pervasive replacement language for C. It achieved ISO standardization in 1998 and its creator regularly receives accolades. Wired's short interview contains some nice anecdotes including 'If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it' and 'I'll just note that I consider the idea of one language, one programming tool, as the one and only best tool for everyone and for every problem infantile. If someone claims to have the perfect language he is either a fool or a salesman or both.' There's some surprising revelations in here, too, as his portable computer runs Windows."
My first language and I wish my only. I don't know if it is because it was my first, but it's the only one that I feel like can accomplish everything I need in a very logical and clean fashion. Java comes close because it feels close, but the extra layer of syntax pisses me off. Anyways, I remember the project in high school that I was working on when it clicked in my mind as a language I can read rather than a bunch of mumbojumbo that I had to try to interpret. Thank you, recursive merge sort project.
I don't know why you were modded as a troll. FTA itself:
Stroustrup: I'll just note that I consider the idea of one language, one programming tool, as the one and only best tool for everyone and for every problem infantile. If someone claims to have the perfect language he is either a fool or a salesman or both.
Trolling is a art,
Doom was written in C, not C++.
+0 Meh
Ultimately, the only good try/catch 22 joke is the one about not making one.
So was Doom II, Quake, Quake II, and Quake 3 Arena. All straight C.
Dunno about Doom 3/Quake IV, they haven't released source code for those yet.
Nothing prevents from having that exact same syntax in C++, along with many different possible others (whatever is a valid C++ expression).
C++0x also allows the nicer Cosine(3.14159_Radians) through user-defined literals.
You are making the grand parents point for him. As he said, You are forcing the polymorphism via typedefs. Your Radians and Degrees are no longer simply floats. What you really meant to do is use a label not a type-- but since there is no syntax for that in C++ you have to use a crescent wrench as a hammer. As the parent pointed out you can do that but it's not simple and does not enforce self documenting code.
Except C++ is not slower than C... It's actually equally fast, and can give a lot of performance optimizations with a fraction of the code needed to do the same on C.
You're just a troll who doesn't actually know C nor C++.
- These characters were randomly selected.
You get all these Java-like advantages but run a C-like speed. Right. Because, by the divine power of Saint Jobs, Objective-C is magically able to do late binding and introspection for free. Back in the real world, the speed difference between Objective-C and Java is pretty negligible.
The reason people say this is because you can use straight C when the extra speed is paramount. Can you run inline C code in java without needing the interpreter? Using straight C code inline in Obj-C is a bit like using Assembly inline in C. It's there when you need it.
Once you start despising the jerks, you become one.
Except C++ is not slower than C... It's actually equally fast, and can give a lot of performance optimizations with a fraction of the code needed to do the same on C.
It's even better than that. There's extra type checking and tighter rules on aliasing in C++ (unless you turn them off), so it can actually generate faster code. If you trivially convert a C program to the slightly less relaxed rules of C++, you should expect at least the same performance (if not, file a bug with your compiler provider), and often better.
I agree with the sentiment that anyone who thinks C++ is slower then C understands neither. It perfectly demonstrates their lack of understanding.
Note that he was shutting down an annoying newbie who suggested something like reworking the git codebase to use "nice abstractions" to solve no real problem. C++ advocacy on the net seems to be dominated by such newbies, or then they are the gurus who know obscure C++ quirks inside out and have written a book on that.
My exception safety is -fno-exceptions.
Reputed Academics have been less shy:
"C++ is an insult to the human brain" (Niklaus Wirth)
"I invented the term Object-Oriented, and I can tell you I did not have C++ in mind" (Alan Kay)
"There are only two things wrong with C++: The initial concept and the implementation" (Bertrand Meyer)
"C++: an octopus made by nailing extra legs onto a dog" (Eric S. Raymond)
"Whenever the C++ language designers had two competing ideas as to how they should solve some problem, they said, 'OK, we'll do them both'. So the language is too baroque for my taste" (Donald E Knuth)
PROOF?
Compare the BOOST C++ library to htt://gwan.ch/ ANSI C scripts (footprint, reliability, performances, ease of use...)
In fact, Linus has tried to move the kernel to C++ in 1992. At that time, g++ was a piece of crap. ...
The lessons learned from this experience (outside the fact that g++ was unstable) is that C++ has some strong limitations when used in a kernel and that he would never use again C++.
Good C++ compilers have appeared only recently (before 2000, Comeau C++ was the single almost standard compliant compiler). Comprehension on what is good coding style in C++ is more recent. We keep many garbage from the previous era: bad libraries, bad coding style guides,
For people that have discovered C++ recently, Linus opinion may look exaggerated, but do not accuse him of not understanding C++. You will look very misinformed.
That was a simple example for economy of words. Let's take a more complex example. Suppose I have an area function that takes inputs like height (H=5) and width (W=6) and length (L=7). In objectC you might write the following where W,L, and H are just floats to get the area of the side of the object:
[object area width:W height:H]
simple and you could do that in C++ by typedef W is type width, and H is try Length.
but now you want the area of the top and bottom:
[object area width:L height:W ]
But you can't do that in C++ without casting because L and W are not floats but rather are type defs that don't match their positions.
But that's not an example of polymophism just using labels instead of type defs which is what you really wanted in the first place, since the values were logically floats and you don't need to proliferate the type defs and make it a typically C++ mess. On the other hand if you really did require type safety then you could give them types.
THe other thing is that there are a proliferation of ways you might write the call in c++. IN most of these you would just have a list of arguments separated by commas:
object.area(L,W)
or
object.area(W,L)
Notice there is no enforcement of self documentation here. Can you recall which order the arguments are supposed to be in? L then W or W then L? In objectiveC the labels are enforced automatically.
People who write in C++ try to make up for the lack of labels by name mangling the method name like this:
object_area_L_then_W(L,W)
but there's no consistency in how that is done, and it does not enforce that the arguments are actually in the order required.
None of this has been about polymoprhism. I was just backing up to show you that trying to use typdefs to do the job of labels is why C++ code is so damn hard to write, debug and read, and has no consistency from person to person. Notice that ObjectiveC is doing this without any bloat: THere is only way way to write the method not a proliferation. We did not have to create some library to hand in maps to fake labels as we would in C++. it's all very natural. The fact that you then get polymorphism directly emphasizes how natural it was: methods with different labels are different methods. No typecasting required. The signatures could be identical.