5 ms·
So what's an alternative?
by adamnemecek 12y ago
So 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.
- jevgeni 12y agoIn the case of git, C++ was actually evaluated (in a manner very natural to Linus) and not discarded due to some habit: http://harmful.cat-v.org/software/c++/linus http://harmful.cat-v.org/software/c++/linus
- fsloth 12y agoMy experience with legacy C++: Main problem with C++ is that it has lots of accidental complexity and a relatively weak standard feature set. The lava layer pattern is apparently very hard avoid in old applications. Due to the aforementioned weaknesses the lava layering now applies also to the modules that would be standard static modules in other languages. So it's a bit wastefull. But since lava layering is caused by cultural and architectural issues I cannot claim that the system would be in any better shape just if some other language had been used.
- _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.