5 ms·
I cannot like Rust syntax, sorry. For me the ideal syntax is C/Go, just to be clear what I like. But I agree that the tooling that cargo introduced is a breat
by mk89 11mo ago
I cannot like Rust syntax, sorry.
For me the ideal syntax is C/Go, just to be clear what I like.
But I agree that the tooling that cargo introduced is a breath of fresh air in a world dominated by huge makefiles, libraries copied in the repository (I know, there is Conan, vcpkg etc)...
- dontlaugh 11mo agoAll three have very similar syntax when compared even to something like Python or Ruby, let alone ML or Haskell. Seems like a spurious complaint.
- gf000 11mo agoI mean, Rust is quite a different category than C or Go, if this is the 3 languages you reference. Rust has plenty of syntax coming straight from ML (okay, not straight, probably through OCaML) Pattern matching, destructuring, expressions everywhere, etc are stuff that C/Go never even heard about.
- baq 11mo agoNo need to like it. It isn’t brainfck and does the job.
- MBCook 11mo agoI don’t disagree, that’s part of why I like Swift so much. Rust looks very C++ to me. But if I was working in C++ and had a choice of C++ or Rust, I’d go Rust based on this.
- mk89 11mo agoAgree! Swift I forgot to mention. What a nice and elegant language.
- claudiug 11mo agoin the beginning I also hate it, but now is fine.
- guywithahat 11mo agoGo is such a great language. If your code base doesn't mind garbage collection and doesn't depend on some external library, everyone should really look at go. Great multithreading, memory safe, great error handling, and a familiar syntax for people coming from C++/Java/etc.
- gf000 11mo ago> If your code base doesn't mind garbage collection and doesn't depend on some external library, everyone should really look at go I mean, at that point pretty much every language would be a decent choice.
- ViewTrick1002 11mo ago> Great multithreading Until you stumble upon the countless footguns. At least they generally don’t lead to memory unsafety, just garbage data. Data Race Patterns in Go https://www.uber.com/blog/data-race-patterns-in-go/ https://www.uber.com/blog/data-race-patterns-in-go/
- mkehrt 11mo ago> great error handling Go get this completely wrong! It use a tuple rather than an enum for potential errors. This means you can forget to check errors and just use the invalid (nil?) return value from the function. On the other hand, rust uses the Either enum to force you to handle the error. Alternatively you can use the ? operator to pass it to the calling function, which is reflected in the enclosing function's type.
- ikety 11mo agoYep Rust approach won. Pretty much every new language is adopting Result style errors and it's been adapted to plenty of existing languages. It's a product of functional programming, and for me I can't see how you would ever want to handle errors outside of the functional programming railway-oriented style. For me it's just superior.
- tczMUFlmoNk 11mo ago
- josephg 11mo ago> I cannot like Rust syntax, sorry. For me the ideal syntax is C/Go, just to be clear what I like. I’m sorry if this comes across as dismissive, but I find it hard to take people seriously with complaints about syntax like this. Learning new syntax is really easy. Like, if you’re familiar with C & Go, you could probably learn all the syntax of rust in under an hour. The only surprising part of rust’s syntax is all the weird variants of match expressions. Rust has some surprising semantics. Like how lifetimes work (and when you need to specify them explicitly). That stuff is legitimately difficult. But learning that if statements don’t need parenthesis is like - seriously whatever dude. If you want to spend your career never learning new stuff, software isn’t for you. I picked up objective C about 15 years ago. The only thing most of my friends knew about it was that it had “that weird syntax”. It took no time at all to adjust. It’s just not that hard to type [] characters.
- vacuity 11mo agoI'm very vocal that I don't like Python syntax, but I wouldn't refuse to write Python because of the syntax. If I had reason to write Python, I would grumble a bit but write the Python.
- samdoesnothing 11mo agoIt's not about learning syntax, it's about finding it generally tolerable to read. I personally find Rust syntax repulsive and would opt for a different language unless Rust was literally the only option. Thankfully it's never the only option, now or in the future.
- josephg 11mo agoCan you give some examples? Its hard to agree or disagree if you're not going to make any substantive claims.
- cogman10 11mo agoI'd say that rust has a weird level of being both verbose and terse in strange ways. If you ever have to deal with lifetimes, then the verbosity goes up pretty significantly. And, dealing with pointers ultimately introduces multiple layers of concepts that you don't necessarily run into with C++/Go/Java. Yet, with the type inference by default, rust can often feel shockingly terse. Doing collection manipulation is just as terse as any language you could imagine. I think that's probably where complaints about syntax comes in. C++ hides a lot of that complexity with move semantics, shorthands, autocoersion, and by making lifetime issues runtime problems. Languages like Go/Java/Python simply push everything onto the heap and try to avoid exposing low level memory semantics. It's easy for me to see why someone wouldn't like rust. I think it's fine, but I'm also brain broken from perl and php.