27 ms·
I can't shake the feeling of how ugly Rust code looks in comparison to Python, Clojure and Go.
by itwy 6y ago
I can't shake the feeling of how ugly Rust code looks in comparison to Python, Clojure and Go.
- untog 6y agoA matter of perspective IMO. Before I learned Rust it looked messy but now that I know it I don’t think that at all. In fact the way you can use match statements and Result<T> structs make it quite beautiful to me.
- gameswithgo 6y agoas a fan of clojure you must be familiar with how people dismiss lisps because of the parens. some of the complexity of Rust is just necessary to get C speed with memory safety, some is just not being used to the “parens”
- acheron9383 6y agoEh, eye of the beholder. The stronger type system and more verbose syntax certainly makes the code look different. In a way though, it makes the code much more readable. To pick on Python, the Rust code is a lot more _specific_ in what it is going to do, I like that when I am maintaining a code base, it is easier to work on and understand. They are also targeting totally different use cases, so I understand differences of opinion depending on what kind of problem you are trying to solve.
- hombre_fatal 6y agoI had the opposite opinion. It looks like the best mix of abstractions like first-class Result, Option, Future, and Trait with some of the best performance. In Go, I write twice as much code for code that's slower than Rust. I can't even reuse code without copy and paste. Python and Clojure don't even have Rust features. Python doesn't even have .map. Go is barely statically-typed (bet you're gonna use interface{} implementing this too), Python and Clojure aren't at all -- so that's also going to be a source of gut-reaction "whoa this must be complex". The code looks very pleasing to me.
- kabacha 6y agoAs I python dev I feel kinda the opposite: rust is surprisingly pretty with the exception of massive overuse of shift key to the point where I'd consider it a health hazard. The only other low-level language that is pretty that I found is nim.
- wizzwizz4 6y agoNim is nice. I Don't Like It™ because it compiles to C, instead of a True™ compiler intermediate representation, but it's a solid language.
- aldanor 6y agoDitto, as a Python dev I find Rust a lot prettier. I've started using mypy in all Python projects, but it's a joke of course compared to proper strong typing.