I use C++ regularly and never used the 3.
Saw std::valarray in some code once, but never used it myself.
I tend to avoid boost as much as I can.
I use C++ regularly and never used the 3.
Saw std::valarray in some code once, but never used it myself.
I tend to avoid boost as much as I can.
You mean MyCompany::Array, not using the word "vector" has gotta be their primary reason for changing all the names.
Hey, gotta love MyCompany::Vector!
It's been forever since I've written C++ at a place that didn't have their own version of STL where they used different names for everything.
...Why is a video needed for this?
The way I make it work is -fno-exceptions (or, alternatively, loading up a simile to ned14's error system).
One of the highlights of the article is that it does do explain how the C++ system allows you to throw anything, even with a meme for the occasion.
why the industry is still not ready to move away from it.
But why should the industry move away from it?
Am i the only person on earth who doesn't think C++ is a liability and actuallly works faster in it?
At work i have to develop a backend api in TypeScript and it severly lacks in features compared to C++, again maybe its just me but i don't find how one is expected to magically program faster in TypeScript then C++.
Not to mention the idiocy of compiling a static typed language to a dynamic typed language which is then interpreted.
Nice
Fair enough!
Of course. I've programmed in C++ for some twenty years at this point, and I'm still effectively writing C with classes (plus a few bits and bobs, as appropriate). I'm just at the point where I think this pig has so many layers of makeup applied that it's starting to cake off in massive chunks.
Very few... But it's honestly OK, you don't need to know everything to be a C++ dev. There's a few key features and practices you can't ignore, and the rest can be discovered by staying informed whenever you have time and by reading cppreference when you see things that are unfamiliar in the codebases you're working on.
C++ initialization
So you're an AI?
The code was already awful to begin with. I just made it a different kind of awful.
I almost spit out my coffee reading this. Bravo!
Seriously, are there anyone alive at this time who have a firm grasp on the totality of the latest C++ standards and the nuances thereof?
Now this thumbnail is pretty funny.
.(starts|ends)_with
Annoying because they are methods, which means you can't backport them. Free functions are jst universally better. Then again, didn't really miss these two in particular very much because PCRE exists, and if you are already doing any significant text or math processing in your program, one regex is not much of an issue (the composable nature of text processing is such that adding the regex for starts/ends with is likely exact zero extra cost; some part of your system might already have been doing it before).
Unordered Erase
Okay, color me surprised here but I though we had gotten this one in C++20 or C++23 as part of the previously Experimentals? At least I seem to remembered an unordered something, but I can't recall if it was erase or not.
Early Return
This is one of the big use cases why I still use goto. Lead on with the important parts of the functions first, leave the specifics of why you can't/couldn't do it for later (goto), after (exceptions) or before (expected, result types, etc).
After few years in programming I can attest that
"Write Self-Documenting Code" doesn't hold.
No matter how much coder thinks their code is self explanatory.
An addition of nice, concise, and blunt comment on critical points in function saves heads (and brains) of whoever comes next.
Writing comments is cheaper in long run, than any clever variable/function naming. (note: I'm not saying that names should be abstract, but by them self are not enough to make code user frendly).
The C family tree puts the Godfather to shame.
Just use Go if you want that
Clean code, and compile-time is irrelevant for most projects.
First: it's not new, it's been around since C++03.
Second... it's not even that great. It's more characters to type and you have to deal with stds and colons. (void) is a classic and works everywhere.
But hey, at least it's not static_cast<void>(...).
Yeah, [[nodiscard]] throws a warning (that's half the point of attributes, anyway).
Neat, I learned something. I keep smashing C and C++ together on my head.
The notes on that page do suggest the same method I did, however.