I have decades of C++ experience. I have never met any C++ developer who hasn’t shot himself in the foot regularly with this damn language.
But it’s the funniest language IMO, you can do frigging anything with it.
Which is why it causes problems of course.
I need to find the nut meme about programming languages again
Edit: Well this meme at least gets the gist of it

Ooh been there done that, but with opengl, lol memories…
Ooh been there done that, but with assembly language and direct register and video memory access, lol ancient memories…
Aah!
Remember direct mode/protected mode? Mode 13? That 64k color buffer, aah memories :-)
Yup. All of that. And the modes got even weirder too.
Yeah there were loafs of them!
You get a matrix, and you get a matrix. Everything gets a matrix. That’s my main memory from OpenGL.
Worldmatrix, objectmatrix, movematrix, … !
It’s been a while. Is worldmatrix the same as viewmatrix? Or is that a whole other matrix?
View matrix has the perspective 1/v thing in it IIRC, the world euh, yeah it was a long time ago…
Most C++ devs blame themselves and not the language though. So it still gets used a lot.
The problem with C++ is that it has so many odd quirks that are difficult to learn. Sometimes these quirks are addressed - at the expense of adding new stupid quirks you need to learn.
If the c++ doesn’t address it, just use the c part!! /j
/srs, you mean?
My first ever big boy language was C++ (after Basic, and Logo, does anyone remember that lol). I was in middle school, tried to self-learn from learncpp.com, only to realize that I had mostly learned C, with cin-cout instead of printf-scanf. So I just decided to migrate to C. Nowadays, I mostly code in Rust, Go, and Python. But my experience with C has been extremely helpful. Can’t say the same about C++ though.
Was Logo that turtle language?
Yes. IIRC, the flavor that I used was MSWLogo.
Try the c++23 standard. There’s been a lot of cross pollination. Contrived example follows:
#include <format> #include <numbers> #include <print> #include <string> int main(int argc, char *argv[]) { double pi = std::numbers::pi; std::string fstr = std::format("{}, {:>.2}, {:>.5}, {:>.10}", pi, pi, pi, pi); std::string h = "Hello"; std::string w = "World"; std::println("{}, {}!", h, w); std::print("This won't have a {},", "newline"); std::println(" but this will add it."); // Add a newline. // Can't put a non-constant string as the first argument to // print or println so they can be checked at compile time. std::println("{}", fstr); return EXIT_SUCCESS; }
C++ is my favorite language I’ve ever programmed in and is not even close, but I spent way too much of my time on code reviews because I couldn’t trust almost anyone I worked with not to create dangling refs, memory leaks, etc
To be clear, the language itself is usually not the big part. You also have to learn the eco-system, libraries, packaging, debugging, etc.
(C++ is still a very “comprehensive” language though)
C99 over all! C99! C99!
There is a difference between learning a language and be productive with it, and with mastering a language. Being a good software developer is another thing.
C and C++ ask the programmer to deal with things themselves that other more modern languages do for you in the language runtime Memory management would be the big one. It’s more to wrap your head around, but if you can do it, there’s potential for more performance. In my mind, it comes down to a trade off between development time versus CPU time, and CPU time is a lot cheaper these days.
Signed, a Java dev
I have decades of C++ experience. I have never met any C++ developer who hasn’t shot himself in the foot regularly with this damn language.
Developers are the problem. They get language feature envy and so the language they use gets pushed to include the new feature. It’s why a lot of devs hate languages like Go because Go is highly resistant to change. So languages like C++ and C# end up with so many features you can’t possibly know or master all of them.
For some fucking reason devs don’t want to use multiple languages.
I spent few years using it professionally and mentoring others, but never felt comfortable with it. Small eternities spent fighting the language constructs and solving typing puzzles. My take away is that I could just barely fit the C++ in my head and then there’s no room for anything else. I’m done with it for good.
My first ever big boy language was C++ (after Basic, and Logo). I was in middle school, tried to self-learn from learncpp.com, only to realize that I had mostly learned C, with cin-cout instead of printf/scanf. So I just decided to migrate to C. Nowadays, I mostly code in Rust, Go, and Python. But my experience with C has been extremely helpful. Can’t say the same about C++ though.
I think there is something to be said for keeping a language simple, though. The basic semantics of a language should be comprehensible to everyone, let the standard library have all the wacky stuff someone wanted decades ago. (macros - the lisp kind, not the C kind - make this easier)
nobody should have to use c++ anymore now that rust and zig exists
header files are an invention of the devil
Header?? I barely know her!
Header files are a thing of beauty! Languages that can’t abstract away definitions suck (or are like script languages, which is fine for scripting).
definitions shouldn’t be split into multiple places and i will die on this hill
What do you mean? For me, a definition is declared once, in its entirety, and that’s it.
Declaring it in several places makes no sense of course (for me at least) just include the header and voilà!
What do you mean by “abstract away”, and what about it is exclusive to headers?
Eg most languages have something like a trait or interface wherein you can put a list of definitions (optionally with a default aka “inline” implementation) which are then actually implemented elsewhere. This is considered useful by everyone because it allows multiple implementations to be associated with 1 name. They are generally not desired in cases where only 1 implementation will ever be written.
AFAIK the only use case where headers accomplish the same is if they’re treated as documentation for an API that could be implemented by any library.
Admittedly certain programming styles benefit immensely from headers, despite the drawbacks to “design as you go” programming.
I like c/c++ headers because you can put the “code” in one file, and use the header file in your others where you need access to that code. And you can do that on a compile level. No need to for example compile a c# library that you’ll then use.
In c# (for example) you’ll include all the code in another file, when you just need one function. In c++ you include only all the definitions, if that makes sense.
In c# it quickly becomes a garbled mess IMO.
Sure, you can make libraries, but make libraries for every file? That’s not optimal either.
So I guess I like it as it lets you split up code on a lower level, very convenient IMO.
I have decades of C++ experience. I have never met any C++ developer who hasn’t shot himself in the foot regularly with this damn language.
Did you code your own Lemmy client with C++?
🤣
What’s the deal of posting same comment many times?
I have decades of C++ experience. I have never met any C++ developer who hasn’t shot himself in the foot regularly with this damn language.
Oh really? I’ve never heard you mention that before /s
Oh f*CK. I’m so sorry. Bad connectivity here, my client kept telling me the posting failed. Obviously it didn’t.
deleted by creator






