5 ms·
I started off with C 15 years ago, but now I find myself migrated, by and large, to C++. Everything that's good about C exists in C++, and all of the missing co
by glitchc 8y ago
I started off with C 15 years ago, but now I find myself migrated, by and large, to C++. Everything that's good about C exists in C++, and all of the missing components (string support, smart pointers, tuples, maps, STL data structures) make life much easier. On top of that, it's the exact same compiler for both C and C++ on most platforms.
- Sir_Cmpwn 8y agoThankfully everything that's bad about C++ is absent in C. My least favorite term in CS is "C/C++" because they are two totally different languages, suitable for for totally different problems, and C++ is a smear on C's otherwise good name.
- jey 8y ago"C++ In the spirit of C" seems to be the sweet spot for me; think of a C++ programmer retreating to C but still keeping their fancy new C++ compiler.
- Sir_Cmpwn 8y agoYou're probably better off using Go then. If you like C++ but wish it were better you want Rust, and if you like C but wish it were better you want Go.
- jey 8y agoIn Go I can't `extern C` and calling C functions is expensive. I will probably be using Rust for some projects in the future, but right now I'm reliant on C++ for stuff like Eigen (numerical linear algebra) and OpenMP (shared memory loop parallelism).
- bestouff 8y agoThen you'll probably like Rust + nalgebra + rayon.
- pjmlp 8y agoStrange, I though that C++ has to thank C for implicit conversions, unsafe enums, memory corruption due to out-of-bounds in string and memory handling functions, UB, slow compilation times due to text inclusion, lack of code understanding due to macros über all, weak linking, ...
- flohofwoe 8y agoFor me it's exactly the other way around. Spent 20 years in C++ (before that 5 years of C), but slowly and steady got fed up by the language complexity, redundant features, standard library bloat and compiles times. Went back to C and it's like a breath of fresh air. The turning point for me was realizing that C++ mostly helps with managing the complexity of many small memory allocations, but it's better to avoid such a "many small memory allocations" scenario to begin with. And without that, C++ looses much of its appeal over C.
- AstralStorm 8y agoIf you're not using the type safety and error handling afforded by C++ you're probably not using C++11. (reminder: latest version is C++17 which brings much higher usability at compiler implementation complexity cost) Where C++ in modern form helps is generally getting rid of unsafe accesses and uses. I'll take exceptions over checking error codes all the time.
- Ace17 8y agoDon't you miss virtual functions? I found that no matter how you did it, implementing polymorphism in C (with function pointers) is tedious and verbose ; also, it discourages the creation of new interfaces (too much boilerplate).
- flohofwoe 8y agoNo, I don't use virtual methods (or inheritance, or runtime polymorphism) in C++ that much either.
- NeedMoreTea 8y agoStarted in C 35 years ago, migrated to C++ for about 10 or 15, and now try and avoid C++ but am perfectly amenable to a little C if the situation suits. The extreme ugliness and overhead of C++ was wearing, as was the occasional zealotry of those who knew C++ but never went through a just C phase. These days I've seen enough different languages to mostly not care that much.