News for hackers. Stuff that matters.
Re:Zero to Production in Rust by cjg on Saturday June 05, 2021 @12:24PM (#27406360)
In my experience, Rust code is relatively easy to read, even by developers with no Rust experience.

Of course, you can write hard to read code. But that's not typically what comes out of a process of writing production software.

That's not to say that someone with no experience will fully understand the ownership transfer & borrowing that's happening, but that's just stuff you need to do for the compiler. Reading code that already compiles, you can mostly ignore that and focus on the program logic.

Re:Zero to Production in Rust by cogman10 on Saturday June 05, 2021 @01:00PM (#27406673)
Yeah, readability is high, it's writing that can be a bit harder IMO.

Especially for someone unfamiliar with rust, it can be hard to really know why someone is using self, &self, or &mut self. Yet the code reads the same.

That's the funny thing about rust.

Re:Zero to Production in Rust by zozbot234 on Saturday June 05, 2021 @01:39PM (#27407050)
The compiler is supposed to tell you when you get it wrong. This does leave design issues on the table, but it's also good for those to be addressed explicitly, by the more senior people on the project.
Re:Zero to Production in Rust by Thaxll on Saturday June 05, 2021 @02:14PM (#27407333)
Rust is one the hardest language to read. Take two people that never used Go or Rust and make them read code, good luck with Rust.
Re:Zero to Production in Rust by timeon on Saturday June 05, 2021 @03:15PM (#27407759)
So I have opened golang.org:

v1, ok1 := <-c1

Not sure what is difference between := and = and what is that arrow. But if I'm going to do something with the language - I guess it will be easy to find out. Like with Rust.

Re:Zero to Production in Rust by rob74 on Sunday June 06, 2021 @12:17PM (#27414120)
Sure - except that in Go there are (my impression after taking a look at various Rust resources) far fewer things you have to find out this way than in Rust. Which, of course, some view as a limitation, others view as a plus for Go.
Re:Zero to Production in Rust by dpifke on Saturday June 05, 2021 @07:49PM (#27409389)
I'm a newcomer to Rust, and find it relatively easy to read, at least at the level of "what is this code doing?" (Not necessarily "why did they need to specify lifetime there?")

The major exception to this are cases where authors use macros to invent their own DSL inside Rust code. This sort of thing seems common in the Servo codebase, amomg others. It reminds me of C macros or Python metaprogramming magic, both of which directly led to some incredibly difficult past debugging experiences.

Re:Zero to Production in Rust by davidkunz on Saturday June 05, 2021 @03:30PM (#27407864)
It depends on what you're trying to read. If you want to understand every technical detail (e.g. who owns this variable) then Rust is great. If you want to understand the business logic behind it (e.g. under what circumstances is a customer allowed to return that product) then Rust is not so great as you would have to mentally filter out all the technical noise.