News for hackers. Stuff that matters.
Re:To learn a new language, read its standard library by steerablesafe on Monday October 25, 2021 @05:55AM (#28986049)
For C++ many standard library functions can't be implemented in standard C++. And it not only shows some very obvious compiler built-ins in the library, but the library can depend on behavior guaranteed by the compiler which is otherwise undefined by the standard. Therefore it's not always wise to learn techniques from the standard library, as it can depend on implementation defined behavior, and this dependence can be subtle too.

Not too long ago it was impossible to implement std::vector in standard C++, as constructing objects next to each other formally did not create an array. Therefore pointer arithmetic on the resulting pointers were undefined behavior, as pointer arithmetic is only defined within an array.

This was fixed by the array being implicitly created in certain circumstances.

Re:To learn a new language, read its standard library by hello4353 on Monday October 25, 2021 @08:32AM (#28987034)
C++ blurs the line b/w language and standard library in some cases. Example initializer list.
Re:To learn a new language, read its standard library by Jeff_Brown on Monday October 25, 2021 @10:25AM (#28988152)
The advice still stands in a generalized form: read the "nearest to standard" libraries for that language that were implemented in that language.