> And here's a toilet closure: |_| () > Called thusly because |_| () looks like a toilet. Pure poetry! Real talk though, this is a great introduction.
A half-hour to learn Rust
51–60 of 342 posts
Re: A half-hour to learn Rust
#52A half-hour to learn Rust Jan 27, 2020 · 51 minute read · rust maybe the site's reading time estimator is broken? sarcasm intended. But seriously, it is good to have people writing things like this.
Programmers don't read, they skim in half the time, then auto-complete in their mind with false assumptions!
Re: A half-hour to learn Rust
#53Re: A half-hour to learn Rust
#54That is the best article on Rust I've ever seen. Better than the Rust book. I've been saying that Rust needed a book that wasn't written by the designers of the language, who are too close to it. Now we have one.
But it only covers the very basics. Disclaimer: I've only scrolled through it, but the code snippets are all small. It does show an admirable amount of Rust's syntax, but it's not very discoverable, whereas the book is reasonably well structured (although not for novices, who have forgotten a specific term). The link also doesn't deal with larger programs: there's not an Rc on the page, let alone something like an Ar…
Re: A half-hour to learn Rust
#55Re: A half-hour to learn Rust
#56Re: A half-hour to learn Rust
#57A half-hour to learn Rust Jan 27, 2020 · 51 minute read · rust maybe the site's reading time estimator is broken? sarcasm intended. But seriously, it is good to have people writing things like this.
Programmers don't read, they skim in half the time, then auto-complete in their mind with false assumptions!
Re: A half-hour to learn Rust
#58I have a problem understanding how temporaries work in Rust. At least from what I see there is a difference between a temporary inside a vec that I bind somewhere to then pass it somewhere and a temporary inside vec constructed inside method invocation. I asked on SO [0], but did not receive satisfactory answer, or I'm too dense to understand it.
[0] https://stackoverflow.com/questions/64705654/why-i-get-tempo...
Re: A half-hour to learn Rust
#59You probably want to add feeling_lucky: bool as an argument to fair_dice_roll()
Re: A half-hour to learn Rust
#60Earlier quoted context omitted.
I often use the "owl" , usually in Result .
Why use a Result whose error type is empty?
I find Rust's ? notation gives a very natural way of writing such algorithms. I don't care "why" filling in the Sudoku failed, particularly because the solver will typically fail millions of times a second, so I definately don't want constructing the error to be expensive in any way.