4 ms·
Have you seen modern C++? It has had new syntax bolted on every couple years for the past few decades, the result is quite phenomenal.
by proto_lambda 4y ago
Have you seen modern C++? It has had new syntax bolted on every couple years for the past few decades, the result is quite phenomenal.
- MauranKilom 4y agoCan you name what new syntax you abhor? I mean, other than []<>(){}() being a valid C++ expression [0], C++ hasn't even made any notable sygil-related syntax changes recently. Sure, some keywords were added (auto, constexpr, co_yield...) but I don't see how that leads to "ugly" syntax. [0]: That's a lambda capturing no state, having no template parameters, taking no arguments, with an empty body, finally being called immediately with no arguments. But half of that is optional. A more usual lambda would look like [foo](int bar) { return foo+bar; }.
- mkl 4y agoTechnically auto was already a keyword (from C) and was just repurposed. Pedantic but interesting. https://en.cppreference.com/w/c/keyword https://en.cppreference.com/w/c/keyword
- woodruffw 4y agoI find the new user-defined literals syntax pretty ugly. Useful, but ugly. On the older side: the initialization list syntax has always been ugly (and bug-prone, due to the unintuitive evaluation order.)
- ImprobableTruth 4y ago'requires requires' makes me cry
- kingaillas 4y agoAnything with templates, type traits, especially when nested. (The kind of spew you get on an compilation error). Even template< typename T > struct foo<T, std::void_t<decltype(++std::declval<T&>() )>> : std::true_type { }; looks terrible and that's just basic.
- masklinn 4y agoI still wish Rust had a way to express decltype tho. `impl Trait` doesn't always work, and when it doesn't it's quite frustrating.
- estebank 4y agoWhat limitation do you encounter with `impl Trait`? They might be removed by `type Alias = impl Trait;` soon. https://rust-lang.github.io/rfcs/2515-type_alias_impl_trait.html https://rust-lang.github.io/rfcs/2515-type_alias_impl_trait....
- marcosdumay 4y agoYou will notice that this is almost valid Rust. (Rust is a very small bit better, not enough to matter.) In fact, a lot of what the Rust syntax ugly was taken from C++, and it took most of what makes C++ ugly. So the entire discussion is just amusing.
- pclmulqdq 4y agoModern C++ looks horrendously ugly if you are a library writer, but on business logic it looks a lot tamer than rust.