News for hackers. Stuff that matters.
Re:100 Exercises to Learn Rust by jamil7 on Friday May 17, 2024 @12:15AM (#40386330)
There’s a world outside of web development.
Re:100 Exercises to Learn Rust by sergiotapia on Friday May 17, 2024 @12:31AM (#40386406)
interesting!
Re:100 Exercises to Learn Rust by steveklabnik on Friday May 17, 2024 @12:32AM (#40386410)
Also, just because these examples are verbose doesn't mean that all Rust code is this way. Accessors/mutators aren't used super often in my experience, and the builder pattern is used occasionally, but isn't pervasive.

(I have historically been very skeptical of Rust on the web, but by now, I find it pretty pleasant. I of course know Rust very well already though.)

Re:100 Exercises to Learn Rust by littlestymaar on Friday May 17, 2024 @01:28AM (#40386665)
> I of course know Rust very well already though

Understatement of the week ;)

Re:100 Exercises to Learn Rust by LukeMathWalker on Friday May 17, 2024 @05:07AM (#40387882)
Agreed. There's also another aspect at play: to build knowledge one step at a time with this learn-by-doing approach, you have to get learners to write code that's not perfectly idiomatic along the way. You then correct and refine those first drafts as you progress along.

In the case of setters, we get rid of them at the end of that chapter by using the newtype pattern thus guaranteeing that field invariants can't be broken even if you can access them directly.

Re:100 Exercises to Learn Rust by jimbob45 on Friday May 17, 2024 @12:41AM (#40386459)
He's right, though. Languages today shouldn't force you to jump through low-level hoops if you just want to write high-level logic. Likewise, the low-level devices should be easily and ergonomically accessible. Rust is phenomenal at the latter but weak at the former.
Re:100 Exercises to Learn Rust by amne on Friday May 17, 2024 @03:48AM (#40387462)
But who's forcing you? Oh .. the companies jumping on the latest "in Rust" hype. I see.

Just do your thing and be good at it.

PS: There was this VSCode extension to do BI stuff in the IDE (quarylabs/quary) showed here on HN and once I saw the CLI core having "Rust-based" as a feature I just closed the tab. What does "Rust-based" even mean? The tool may have been good but Rust is not a feature.

Re:100 Exercises to Learn Rust by pkolaczk on Friday May 17, 2024 @03:01AM (#40387207)
Compared to most popular high level languages like Java or Go, Rust is seriously at the more expressive end (read: can be higher level).
Re:100 Exercises to Learn Rust by jamil7 on Friday May 17, 2024 @01:36AM (#40386705)
What languages scale better in that regard? Genuinely interested in recommendations.
Re:100 Exercises to Learn Rust by jimbob45 on Friday May 17, 2024 @01:32PM (#40392323)
C# and C++. In C#, you can use pointers but most people don't even know because they so gracefully become invisible. Also ref/in/out keywords are there when you need them and invisible when you don't. Likewise, you don't even need to know about move semantics in C++ to make a simple web server.

That said, C# and C++ most certainly have their fair share of issues.