Liste des Groupes | Revenir à cl c |
Am 28.08.2024 um 13:47 schrieb Thiago Adams:In C you learn how to write less code.
C++ generates a lot of code, including constructors, destructors, and virtual functions.In C that's five to ten times the code.
While abstractions can also be achieved in C, they have to be implemented manually.
But this is nothing we can't live with, with the befit of disallowing other unwanted C++ features.What's uneeded with the gerated code ? >
How we call it does not change the fact is the someone else wrote the code. Then we write less code if we use other people code.If you mean code written by other people, then this is about a big "framework".A matrix class isn't a framework. Frameworks are libraries with
callbacks.
And the code you'd write in C instead does the same, but everything
done manually.
They don't follow the type system rules.Many times, C++ abstraction are incomplete.What's incomplete ?For instance, "smart pointers" should be called fake pointers.Why ?
>
string_view was a "fix" and then we will have a fix for a fix etc..C++ std::string does not represent "literals".You can build a string_view from a literal. The length is determined
at compile-time. You can do most things with it you do with a std::
strng, except writing on it.
Them we have .c_str() and we also my have extra unnecessary conversions and allocations.If you need a dynamic string you need a std::sting.
These fixed-size char-arrays in C are an error-prone disease.
Les messages affichés proviennent d'usenet.