6 ms·
Is there a petition for making C++ less ugly? There should be. It’s a Frankenstein’s monster made of parts from other Frankenstein’s monsters. If Lovecraft wer
by Razengan 7y ago
Is there a petition for making C++ less ugly? There should be.
It’s a Frankenstein’s monster made of parts from other Frankenstein’s monsters. If Lovecraft were alive today this would be his prime eldritch deity. An abomination of impossible geometries you could not make sense of even if your eyes could see in 4D.
- banachtarski 7y agoPattern matching is listed there, but I think the onus is on you to describe what you're talking about. I guarantee that any language (even the HN-beloved Rust and Go) can produce hideous code.
- Razengan 7y ago> the onus is on you to describe what you're talking about. I'll start with a simple example. I haven't worked with C++ in ages and I hope never to, but in the last C++ file I came across: Right at the beginning there were 3 different kinds of include/import statements. One with "" and another with <> and I don't remember what the third was but it had yet another format. Now, I know what they mean, or I can look it up, and there may be a valid need for the distinction, but it is ugly. Here's another confusion I was recently reading about: https://stackoverflow.com/questions/516237/when-should-i-use-typedef-in-c https://stackoverflow.com/questions/516237/when-should-i-use... I find Assembly and "pure" C a lot more elegant than this nightmarish atrocity.
- krisrm 7y agoIf there's a valid need for the distinction, and it's straightforward (<>s search system libs first vs quotes search CWD first IIRC), what would be less ugly? Keeping in mind the vast number of C++ files out there that have already baked this convention in :)
- Razengan 7y agoHow about using the CLI path resolving convention, where you implicitly look in the CWD first and then the environment path? Specify specific paths by something like "$SYSTEM\foo.h" or "$CWD\foo.h" Either would be more readable and less magic than <> or ""
- alexhutcheson 7y agoBackwards compatibility is one of the highest priorities for C++, which is a significant constraint in removing "ugly" constructs and syntax. It can also force the use of verbose or unusual syntax for new features, even if the new features are a net positive for readability.
- Aardwolf 7y agoAt least trigraphs have been removed from C++17, so they do what they can to remove ugly constructs within reason for backwards compatibility.
- SloopJon 7y agoThe "compile-time programming" category of this survey is dominated by constexpr proposals, where constexpr can replace some pretty ugly template metaprogramming.
- ridiculous_fish 7y agoA lot of C++ changes are aimed at this. For example C++11 auto removed a lot of the ugliness, and is removing even more with auto template parameters and deduced return types.
- ilovecaching 7y agoThere's already a solution for that: Rust. C++ lives and dies by it's commitment to keep all of its ugly. If you want all of the nice stuff and lessons learned without the cruft, choose Rust.
- poiuyt098 7y agoi find gothic steampunk kinda sexy.