7 ms·
In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. In 2010 it was completely
by jayvanguard 12y ago
In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. In 2010 it was completely indefensible. It is almost 2015, why are we even talking about it? C++ was a mistake. A bad detour on the highway of computing.
- deleted 12y ago[deleted]
- adamnemecek 12y agoSo what's an alternative?
- cheepin 12y ago"C++ sucks" has become a bit of a meme around here. The upsides outweigh the downsides for a surprising number of cases. Every alternative is either immature, doesn't solve the use case that needs C++ or doesn't have the required libraries/tools.
- adamnemecek 12y agoI know. I was hoping he would respond with some misguided suggestion further revealing his ignorance.
- nadams 12y agoI want to point out that Tiobe ranks C++ as the #4 most popular language - http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index.... I'll just say I'm not a fan of C++ and would rather write my own language similar to the source-to-source compiler idea of HaXe ( http://haxe.org/ http://haxe.org/ ).
- cageface 12y agoThere are people that sit back and bash C++ and then there are people that just roll up their sleeves and build really cool things with it. I'd certainly rather be in the second camp. I wouldn't mind having a simpler, more elegant language with the same design tradeoffs but that language doesn't yet exist.
- lomnakkus 12y agoFalse dichotomy. Plenty of people who "build really cool things with it" also bash C++, and rightfully so.
- cageface 12y agoNobody I know. People I know that use C++ every day will admit it has issues but are also realistic enough to understand that any language with the same design constraints and long history as C++ will be complex. It's the catbirds in the gallery that don't actually have to write the kind of apps that require a language like C++ that "bash" it.
- jevgeni 12y agoCatbirds like Linus Torvalds, for example?
- rgbrenner 12y agoDoes Torvalds write anything in C++? The kernel and git are in C
- jevgeni 12y agoThis is my point exactly. I'd consider both git and the Linux kernel tough projects, so the choice of the programming language is interesting. More so, given his stance on C++.
- inDigiNeous 12y agoHow come it's interesting ? Linus has always been a C -programmer, and kernel space is something where you want to keep things simple and access tha raw bits of things, so C is a natural choice. And if you've been programming C for 20 years or more, writing git with C feels like a natural solution. It's not always about writing stuff with the most high definition solution, it's more about expressing ideas with the tools you know also.
- _RPM 12y agoAnother meme / idiom seems to be "Why use C/C++ when you can use Rust?"
- Retra 12y agoSounds better than labelling anything you've seen twice as a meme/idiom/myth/design pattern, etc.
- imanaccount247 12y agoC?
- pmelendez 12y agoDo you really think C is any easier to understand that C++? Let's do something simple, a function that returns a reference to an array of a known size. Some of C alternatives would be: int (*foo())[2] { } or maybe if you have the length somewhere else: int** foo () { } or you could try to implement or use an existing implementation of a dynamic array (nothing in the standard as far as I know) vs. std::vector<int>& foo() { }
- imanaccount247 12y ago>Do you really think C is any easier to understand that C++? Yes. C is very small and simple. You can learn all of C in a very short time. C++ is the most complex programming language in existence. It is unlikely that there is any person in the world who actually knows it all, including the creators. >or you could try to implement or use an existing implementation of a dynamic array Imagine that. You could use libraries that implement things you want. What a concept.
- pmelendez 12y ago> "Imagine that. You could use libraries that implement things you want. What a concept." I think I didn't explain myself, but something that basic in these days should be on the standard library in my opinion. >"Yes. C is very small and simple. You can learn all of C in a very short time." I don't think C is simple at all. Its syntax can be really cumbersome at times (see my first example). Also it is very annoying to debug, and C code is very prone to contain memory corruption bugs and leaks. C has great advantages but being simple is not one of them.
- imanaccount247 12y ago>I think I didn't explain myself, but something that basic in these days should be on the standard library in my opinion. Ok well you hop in your delorian and go back to 1970 and let them know. In the mean time, how does that in any way make C not capable for the same tasks as C++? >I don't think C is simple at all Then you don't know C. The entire point of C is that it is simple. >Its syntax can be really cumbersome at times That has nothing to do with simplicity, and C++ has far more complex syntax. >Also it is very annoying to debug C is very simple and straight forward to debug. C++ is much more difficult to debug. Have you ever used either language? >and C code is very prone to contain memory corruption bugs and leaks. Because it is so simple. >C has great advantages but being simple is not one of them. Well your opinion is in the vast minority, and does not seem to have any basis in reality. The C spec is a tiny fraction of the size of the C++ spec.
- GFK_of_xmaspast 12y agoBecause C++11.
- pmelendez 12y ago>"In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. " Was it? Most console games are written in C++ in that period of time. A very popular desktop office suite is built on C++. The most popular design and photograph edition tool for Windows is written using C++. So you are suggesting that all those guys who picked C++ for those popular piece of software are a sort of lucky morons? It is a strong and risky assertion don't you think?
- imanaccount247 12y agoIn 1995 most games were in C or asm, not C++. Even will into 2000+ as asm faded out, C was still big and the C++ usage was largely as C with classes.
- kragen 12y agoI wasn't writing games in 1995 but I suspect you are mistaken. Fortunately https://en.wikipedia.org/wiki/1995_in_video_gaming https://en.wikipedia.org/wiki/1995_in_video_gaming tells us about the major games that year; unfortunately there are 33 of them. Descent and Mortal Kombat 3 are the ones I remember. https://github.com/drguildo/Descent/blob/master/MAIN/AUTOMAP.C https://github.com/drguildo/Descent/blob/master/MAIN/AUTOMAP... Descent is written in C++ (note the "//" comments) but it's a very C-styled C++, not even with classes. MK3 I don't have any idea, but it was eventually released for a lot of platforms with different CPUs, so I doubt it was written in assembly.
- imanaccount247 12y ago>Descent is written in C++ (note the "//" comments) but it's a very C-styled C++, not even with classes That is C. Lots of C compilers supported // comments, like watcom which they used. Notice the file extension says it is C. Notice it uses absolutely no C++ features at all. http://en.wikipedia.org/wiki/RollerCoaster_Tycoon http://en.wikipedia.org/wiki/RollerCoaster_Tycoon Still using ASM in 1999. Go look at quake 3 which was when id started into C++. Notice how it is barely C++. It seems odd to "suspect I am mistaken" rather than look at the evidence which lines up exactly with what I said.
- sbmassey 12y agoBecause the alternatives to C++ are even worse. There are still a lot of problem areas where GC is unacceptable, or you need precise control over memory, or access to things like Cuda, along with the high order programming constructs you get in C++. Maybe Rust will take over some day ...
- btmorex 12y agoYou're wrong, but I think you just don't have the right kind of experience to understand why.
- geofft 12y agoC++11 is a very different language, in much the same way Java 8 isn't Java 1, or Visual Basic .NET isn't BASICA. (It's entirely possible that all six of these languages are terrible, but that would be six separate claims.)
- Symmetry 12y agoC++ is currently really the only choice if you're making an application that is both large and performance critical. If you're building a AAA video game or a web browser or a robot's navigation system then it probably is the best choice even if it's a painful one.