4 ms·
Warning Vulgar ahead When I left C++, I felt like, I finally decided to quit rubbing one off with diamond sand paper.
by JediPig 5y ago
Warning Vulgar ahead
When I left C++, I felt like, I finally decided to quit rubbing one off with diamond sand paper.
- chrsig 5y agoThis is the correct feeling. I write some c++, as well as some amount of code in other languages. I wouldn't consider myself part of the cpp community. c++ is hands down the most frustrating to deal with, and leaves me asking why I'm doing it to myself. The answer is, of course, that there are some things that're really only possible in c and c++...and however much I'd typically prefer to just do something in c, c++ has a way of luring you in with the promise that it'll be just a bit more ergonomic and safe....And it is, kinda. But sometimes it feels like the entire cpp community is one giant case of self induced Stockholm syndrome...They wont change the fundamental things that make it difficult. On the flip side, there seems to be some fetishization of incidental complexity. I have the impression that many in the community pride themselves on how smart they must be to work with such a difficult language, without considering that there could be a language that's significantly easier to use with the same benefits. Or using that difficulty as a gatekeeping mechanism to insulate the community from the less-smart. I'll posit this: c++ isn't hard, it's just frustrating because you need to parse incomprehensible error messages, or seemingly arbitrary limitations, or have some ridiculous number of overloads... And then the naming that they decide on in committee...I'm gonna pick on `std::unordered_map`. The name describes it based on what it is not. The reason it's named that is naively, just because `std::map` was already taken by a tree implementation. I don't know why they couldn't have chosen something like `std::hash_map`, or something. The template parameters declare a hash _functor_ is necessary...so the reasoning that you might have an unordered map implementation that doesn't use hashing is up in smoke... ...I'll stop there, because I could probably keep going for quite some time. My point is that c++ isn't hard, cpp is dumb. It's dumb because it makes some of the simplest things contorted into ordeals.
- af78 5y ago> I don't know why they couldn't have chosen something like `std::hash_map` According to Herb Sutter the name `hash_map` (or `hashmap`) had already been taken by some C++ standard library implementation that shipped a class with this name in the std namespace: http://www.gotw.ca/publications/mill20.htm http://www.gotw.ca/publications/mill20.htm
- chrsig 5y agoThis is sort of a great example of them shooting themselves in the foot...They can't name something right because implementations are already using the name... if only the language had a way of putting names in some different area where they wont conflict with each other... they could have done something like create a new namespace: std::maps, and then have std::maps::tree_map, std::maps::hash_map, or something to that effect, and use std::maps::tree_map as the implementation for std::map for backwards compatibility. instead they chose to name something by what it isn't.