6 ms·
> For many of these projects, "moving to C++" often means to change the file extension. Or not even that, sometimes it's just changing the build setting to "Com
by tom_mellior 6y ago
> For many of these projects, "moving to C++" often means to change the file extension. Or not even that, sometimes it's just changing the build setting to "Compile as C++".
It's a bit more than that in the case of GCC. Not a lot more, but GCC does use templated containers. I'm not sure it uses any other C++ features, a kind of "C with templates" might have been sufficient for its purposes.
But then again, what would you expect? GCC is huge. What would a huge refactoring buy the developers?
- jstimpfle 6y agoAll I've been saying is that they don't REALLY seem to have "moved to C++". FWIW
- pjmlp 6y agoMoving to C++ doesn't imply having classes everywhere, anything described in ISO C++, requiring compilation with a C++ compiler counts as moving into C++.
- jstimpfle 6y agoBut if projects are basically C compiled as C++ that's absolutely meaningless and if you take that as an indication for anything then you're just fighting a pointless religious war.
- pjmlp 6y agoOn the contrary, that has been the argument from the C side since the comp.lang.c days trying to prove a point that C is still relevant without understanding that was C++'s Trojan horse. Also just because it looks like C the semantics aren't the same, e.g. implicit conversions from void* aren't allowed in C++ compilers, ?: has a different precedence and a couple of other differences, this still in C89, let alone with everything that came afterwards.
- jstimpfle 6y agoThese are pretty minor things that don't matter semantically or with regards to safety. For example I never knew that there was a difference in the precedence of the ?: ternary operator (which I don't use anyway), but I'd wager that it's more the byproduct of different language formalization methods, and not an intended change. There surely can't be a significant difference because it would hinder the Trojan effect. void* not implicitly casting to their assigned value in C++ is an annoyance to me at best. I don't see any advantage at all there. Things that matter are for example that C++ has vectors or other container types with the possibility to enable bounds checking with a compile flag. Well, you'd think they matter, because it is a security improvement at first sight, and I certainly thought so. I do now think that it makes programs significantly harder to maintain, to the point where superficial advantages cancel out or turn negative. If that effect wasn't real at least to some extent, I wonder why do I see SO MANY function signatures in C++ projects where functions are passed in classic pointer + length style. Furthermore tools like valgrind can be helpful in a way that gives some of the benefits of language-level methods for bounds-checking.
- pjmlp 6y agoWhy you see them? Because developers should know better, but there is a community that keeps writing C style code in C++, unfortunately, as their teachers are stuck in the 90's. "CppCon 2015: Kate Gregory “Stop Teaching C" https://www.youtube.com/watch?v=YnWhqhNdYyk https://www.youtube.com/watch?v=YnWhqhNdYyk But what to expect when schools keep using Turbo C++ as teaching tool, https://galdin.dev/blog/why-you-shouldnt-be-using-turbo-c/ https://galdin.dev/blog/why-you-shouldnt-be-using-turbo-c/
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- jstimpfle 6y agoOh my, another day, another random unrelated link fest. I do happen to have watched that talk, and I'm not sure what point you want to make by linking to it. That talk is someone else's opinion how to get students to write some C++ that compiles - students with no prior understanding of C++ or of programming. Students that do not aspire to be great programmers or even to understand a little bit of what's happening here. That will not be able to help themselves when there's a 200-line error spewn from templated containers for example. That don't even want to understand (or have trouble understanding) the concept pointers. It's NOT a talk suggesting that C is bad or that the use of it is bad (despite the title). It's a talk that suggests that C++ needn't be hard. If we were about actually understanding the language and making significant use of its features, Bjarne Stroustroup himself begs to disagree with the idea that C++ is a language that an individual can fully understand. It's a talk suggesting how to approach teaching when the goal is to get quick (and surely limited) results instead of understanding. But that's totally uninteresting to me. If it's interesting to you, we should end doing more comments, and I should try not to be annoyed when I read your evangelism and your ton of comments where you often hop around and quickly change topic when someone disagrees, and where you instead throw more links to pages that may have a title that suits your agenda, but that are often low on content or dead-in-the-water stuff, or that are completely unrelated to the discussion. I'm tired of playing wack-a-mole with you.