3 ms·
Honestly, I don't see any intrinsic problems with Rust's syntax that makes it unusually ugly. Rather, I think the problem is that the syntax is 100% fine in is
by pdpi 7y ago
Honestly, I don't see any intrinsic problems with Rust's syntax that makes it unusually ugly.
Rather, I think the problem is that the syntax is 100% fine in isolation, but has some issues when taken together with experience in other languages — when you skim the code, some parts of it beg to be looked at like C++, while other parts push you to read it like a functional language. Unsurprisingly, neither fully works, which makes the experience jarring. Once you accept that Rust is its own language with its own rules and stop trying to borrow (hah!) from your experience with other languages, it feels much better.
- guiriduro 7y agoOh yeah, I totally get that with Nim's * (export symbol), just can't get past my 20 years ago c++ pointer syntax brain wiring, even though I've barely touched it since. Always needs a double-take, which spoils reading flow.
- sagichmal 7y ago> Honestly, I don't see any intrinsic problems with Rust's syntax that makes it unusually ugly. You literally just got a user experience report claiming that it is.
- munmaek 7y agoIt's coming from someone who isn't comfortable with C or Java either. There's no winning over everyone. Of course Rust's syntax will be completely jarring if you're coming from Crystal or Ruby. In my personal experience it's a little jarring at first and then it completely goes away.
- spease 7y agoI’m comfortable with C/++ and Java, to a greater extent than a lot of people I’ve worked with. There are still things in Rust that are papercuts: * The need to put :: before <> in expressions for generic parameters, but not in type signatures. * Using :: instead of just . even though most of the time the naming convention will delineate the difference anyway * Error handling with futures * Self-referential structs * Passing a shared pointer through multiple move closures IMHO the frustration involved in these things is not typically worth being more explicit. The :: thing may seem a bit pedantic, but it is simply more physical effort (Shift-colon-colon vs dot) and creates more visual noise. If/when all of the things above are addressed, I think Rust could give Python a run for its money.
- Spartan-S63 7y agoI had many many false starts back in 2014 when I tried learning Rust. It took me to stop comparing it or thinking about it like C++ (syntactically and semantically) in order for me to get it. Now, I’d consider myself reasonably fluent in Rust. I don’t mind the syntax because I find it explicit enough, but terse enough in certain cases. It’s similar but different and so it rhymes with my past in C++, but it’s not the same.
- sixbrx 7y agoAgree and also I think the main issue is that parts of the syntax are pointing to ideas that are not present in common languages, but which are essential in Rust. They aren't merely syntactical choices and can't be papered over or omitted. If you don't want to consider these concerns (like lifetimes) then it's probably not the language for you and changes in syntax won't help (much) there.