News for hackers. Stuff that matters.
Re:Read your Standard Libraries by pmr_ on Friday January 03, 2014 @04:52PM (#7008477)
I mostly live in C++ land and the story is different there. The standard library implementations are a place of magick, mystery, and obscure defect reports. They provide plenty of insight what can go wrong if you are writing a generic library and how difficult correctly programming with templates actually is, but all the technicalities of the language make it hard to see the algorithms. They are definitely worth reading, but only if you have mastered a large amount of C++.

Not to mention the horrible naming conventions (leading double underscores everywhere).

I often think about a C++ standard library written for educational purposes with proper naming, focus on readability instead of optimization, and maybe multiple possible implementations of certain specs.

Re:Read your Standard Libraries by maaku on Friday January 03, 2014 @06:09PM (#7008906)
No one would use it. It's a design flaw of C++ that performant, generic libraries require arcane magic and hideously obfuscated code.
Re:Read your Standard Libraries by pmr_ on Friday January 03, 2014 @06:24PM (#7008969)
Please read carefully: "for educational purposes". I'm fully aware that such a library wouldn't be fit for production but it maybe would be useful for people learning generic C++ programming. Currently you have to look at Boost or any of the standard libraries and all you see are #ifdef and all the arcana and have a hard time seeing all the useful techniques.
Re:Read your Standard Libraries by maaku on Saturday January 04, 2014 @12:39AM (#7010120)
What I meant was: no one would use it, so it'll never be created.
Re:Read your Standard Libraries by saurik on Saturday January 04, 2014 @01:59AM (#7010310)
When the AP curriculum was in C++ there was, in fact, such a pedogigical version of the library used in classes. (I took AP CS the first year it was in C++.)

http://apcentral.collegeboard.com/apc/members/courses/teache...

Re:Read your Standard Libraries by davvid on Saturday January 04, 2014 @05:58AM (#7010694)
Leading double underscore is reserved for the implementation (of the standard library).

http://www.gnu.org/software/libc/manual/html_node/Reserved-N...

Re:Read your Standard Libraries by pmr_ on Saturday January 04, 2014 @10:06AM (#7011233)
I'm perfectly aware of that. I was just saying that it doesn't aid readability of the code (rather the opposite). There even have been proposals to solve this problem (scoped macros being just one of them) so this is acknowledged to be a rather real problem instead of just some cosmetic issue.
Re:Read your Standard Libraries by eonil on Saturday January 04, 2014 @02:04AM (#7010319)
It would make sense to write an easier wrapper around current C++ standard library. Because C++ provides very strong inlining, just simple wrapping with better method names will not make any performance hit.

But IMO, naming is one of the hardest work.

Re:Read your Standard Libraries by alextingle on Saturday January 04, 2014 @08:15AM (#7010956)
I always found the C++ standard library relatively readable. It's inspiring just how short many of the functions are.