7 ms·
oh god, please don't add more stuff to the language.
by jimjimjim 9y ago
oh god, please don't add more stuff to the language.
- goalieca 9y agoSince c++11 I can't think of an enhancement that hasn't been beneficial.
- EGreg 9y agoLambdas. Concepts. Ten types of casts. Templates of templates. Everything and the kitchen sink is in there. You need a language lawyer to figure out anything but the most basic interactions. For example, 1. What's the practical difference between an abstract class and an interface? 2. When do you have a copy constructor run instead of a cast on initialization if both are defined? 3. When would you use a non-virtual destructor? What happens when you hire people? Isn't it better to have a small language that everyone understands in its entirety, and has to go out of their way to surprise you?
- wfunction 9y ago> 1. What's the practical difference between an abstract class and an interface? Interface? You are talking about the C++ language, right?
- kobeya 9y agoThe funny thing is I just good faith assumed that this was some new feature being added in C++17 that I'd now have to figure out how to use.
- santaclaus 9y ago> Interface? You are talking about the C++ language, right? If Sutter's metaclasses get into C++20 C++ could indeed have an equivalent to interface enforced by the compiler.
- Ace17 9y ago> What's the practical difference between an abstract class and an interface? C++ doesn't have "interfaces". No wonder you think there's too much stuff.
- jsolson 9y agoIronically, Java, which does have both, has a clear and unambiguous distinction between the two.
- s_ngularity 9y agoI think that now having auto, decltype, and decltype(auto) all in the language is confusing at best. constexpr also has slightly unintuitive semantics. The problem with all of the additions to C++ isn't whether they're useful individually, it's how as a whole the language is basically a gigantic ball of special cases. C++ is extremely powerful, but also nearly impossible to understand fully.
- tonmoy 9y agoI used to write for(map<int, vector<vector<int> > >::iterator it=m.being(); it != m.end(); it++) for(vector<vector<int> >::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++) Now I have to write for (auto paths : m) { for (auto path : paths) { Sure clang annoys me with not being able to compile with -g, but still auto is a lifesaver!
- Negitivefrags 9y agoThis is neither here nor there, but in your revised version you are copying all the vectors many times. Use auto&.
- jjawssd 9y agoWhile perfectly fine, this comment unironically reinforces the GP's assertion of "how [C++] as a whole the language is basically a gigantic ball of special cases"
- kobeya 9y agoWhat specifically annoys me about C++ and is demonstrated by this example is that the simplest possible expression of an algorithm is almost certainly not the most efficient or desirable way to do what you are trying to accomplish. In a language designed for humans, the simplest expression of a loop (e.g. `for (auto paths : m) {}`) would use references not value copying. You'd have to go out of your way to do the it the dumb way, which you would only do when you have a specific reason to do so. C++, on the other hand, is only really an effective language in the hands of people who have either fully internalized the 1,000 page specification, or wasted a depressing number of synaptic connections on memorizing minute trivia about what constructs to use under what circumstances. I say this as someone who works with C++ on a daily basis :(
- Jimmy 9y agoI can't wait to see modules, namespaces, and preprocessor include guards all working together in the same application.