Hacker News new | ask | show | jobs
by astrophysics 2489 days ago
This reminds me of the years I wasted writing C++, always looking for the idiomatic approach, rather than learning about security, networking, architecture and so on. In exactly the same way, Rust is just too complicated.
5 comments

Rust is less complicated than C++, but it is more complicated than Go. However I’m a big proponent of minimizing complexity wherever possible - language overhead should not become an obstacle to programmer time.

The nice thing about Rust is that it allows you to compartmentalize complexity very nicely by creating rules the compiler will enforce, whereas with C++ the programmer is also burdened with knowing them.

I’m not sure if I’d say that it’s more complicated than Python, since Python’s flexibility can in practice lead to creative but very hard-to-follow code.

I recently realized that trying to order C++ and Rust precisely on a complexity scale is rather pointless and misleading, since it's obvious that they are in the same class of trickiness, but for different reasons.

If a significant number of the developers that come into contact with a language think it's hard, then... it's very likely hard.

Rust is harder than many languages, but just because something is hard doesn't mean that it's complicated. I find that the strictness of the compiler ends up all-but-forcing code to end up rather simple.
This article demonstrates that it is overthinking the issue — both approaches are correct and about as fast. For non-copyable structs move vs borrow are semantically different, so the choice is even clearer.

With built-in style lints and Clippy, Rust is doing quite well in keeping codebases simple and idiomatic.

Rust is too complicated because you can choose to take parameters by-value or by-reference?
It's because:

a) the language designers decided to cram several paradigms into it, including a heavier than usual dose of functional.

b) most people don't want to get pedantic about resource management

c) the syntax is weird for people coming from the C language family

> a) the language designers decided to cram several paradigms into it, including a heavier than usual dose of functional.

Rust is actually really close to JavaScript in that regard, with its mix of OOP-without-inheritance and the whole collection of functional method on Arrays and iterators (map, reduce, etc.). And while People have a ton of complain about JavaScript, none of them is «the JavaScript language is too complex».

> b) most people don't want to get pedantic about resource management

But Rust is explicitly aimed at people who do! You can't use Python or JavaScript to write a web browser, a kernel or anything where performance is paramount.

> c) the syntax is weird for people coming from the C language family

What ? Do you mean “ not coming from the C language family”? Because its syntax is clearly in the C-family (semicolon, braces).

> What ? Do you mean “ not coming from the C language family”? Because its syntax is clearly in the C-family (semicolon, braces).

My guess is that they're talking about the syntax inspired from its ML roots, like `let/let mut`, `->` for return types, and `:` for type annotations. I personally prefer these to the C-style equivalents, but I've talked with enough people who haven't used an ML-like language that I'm not quite as surprised as I used to be about people expressing misgivings about them.

Thanks I haven't thought about that part, but nowadays it has become kind of mainstream: JavaScript uses let/const and typescript uses the colon notation for type. And I've never heard anyone complaining about those for the complexity of their syntax.
I'm sure a lot of people don't care about explicitly managing resources! But there are a lot of people who do, and they need a language to use.
You're welcome to write Rust as non-idiomatically as you like! It might take a few lines of #[no-warn()] to silence the compiler, though...
I was pleased to see that there is a fuckit.rs: https://docs.rs/fuckit/0.2.1/fuckit/ in the vein of fuckit.js, fuckit.py and libfuckit
As someone said on the thread, there is a clippy suggestion to tell you that you could pass by copy given the size of your struct (without it I would never have passed a struct by copy).