On 10.03.2020 02:24, Daniel wrote:
> On Monday, March 9, 2020 at 6:45:37 PM UTC-4, Maciej Sobczak wrote:
>>> I would like to point out the logic behind this reasoning:
>>>
>>> 1: Everyone agrees that it is impossible for a normal individual to
>>> understand all C++
>>
>> I have not seen any agreement on this (it's just your perspective). I would > rather say that it is not *necessary* for a normal individual to understand > all of C++. And nobody expects that.
>
> It's not so much that C++ has so many things, but rather, that it lacks all coherence, any vision, that it's one ad hoc thing after another. For what reason do we have
>
> std::string s = "foo";
>
> const char* p = s.c_str(); // explicit, good
> but
> std::string_view sv = s; // implicit, bad for all the reasons we have c_str()
For convenience when `std::string_view` is a formal argument type.
This lets you define /one/ function, no overloads, that handles just
about any non-zero-terminated string.
> and
>
> s = p; // Seems safe enough
> but
> s = std::string(sv); // Why?
Yah. That one's ugly as heck.
> And collision between uniform initialization and initializer list. Why?
Agree about that also. It's botched. Bjarne's vision was nice, and I
believe it was the committee that messed it totally up.
> The committee had to have known that, when they voted for it.
Politics I gather, combined with weak leadership.
I think it's the same that happens in a lot of municipalities in Norway.
The political leadership avoids taking on difficult issues. The
bureaucrats then think that they just /have/ to make the decisions on
behalf of the politicians, and they get away with it. However, a
bureaucrat generally sees only his or her little very narrow and short
slice of reality, and additionally, is often constrained by rules
interpreted by the letter. Written rules don't have intelligence. The
result is ungood.
> And why introduce <system_error> requiring using _global objects_ for
> identifying error categories? Uniqueness of address doesn't work with DLL's,
> probably not shared libraries either, and the committee would have known that.
>
> The list is endless.
The lack of support for dynamic libraries is an open large wound in the
language, so to speak. IMO.
But which model to go for: Windows DLLs (very encapsulated), Linux
shared libraries (like static libraries essentially, just dynamic), or
maybe some third model defined by the committee, since there is strong
precedence for not standardizing existing practice, but rather invent?
Happily with C++20 there will be a `std::pi` (of course not the existing
practice M_PI, from the Posix standard, but a pi value, hurray).
And type safe text formatting based on format strings. They managed to
dirty it by adding locale support. But I was wrong in thinking it was
correct, as people had asserted, that they'd really sabotaged that
library: by default locales aren't used, the use has to be requested,
because the formatting is defined in terms of C++17 `std::to_chars`.
So all's not lost. But the half-baked C++20 co-routines, which aren't
really co-routines anyway but more like continuations, that's bad. And
the fragile and inefficient ranges library, with its
yet-another-domain-specific-sub-language-to-learn and `i(di)ota` func. Argh.
- Alf