News for hackers. Stuff that matters.
Re:Veloren – Open-source MMORPG written in Rust by atoav on Friday February 05, 2021 @01:50PM (#26039795)
Where Rust really shines compared to other languages IMO is when software grows beyond a certain scale. The way the language forces and encourages you to "do it properly" really prevents a lot of lazy decisions that would come back to haunt you later in unexpected ways.

The magical part about Rust really is how accurately (compared to other languages) you know which little gear in the big machine is failing. Often you even know precisely why and how it is failing.

Precondition for this is of course that you really grok Rusts ownership and type system.

Re:Veloren – Open-source MMORPG written in Rust by est31 on Friday February 05, 2021 @02:50PM (#26040422)
You can do it non-properly in Rust as well, e.g. using unwraps, etc. but even then it's still way better than an UB-ridden component of a C++ codebase.
Re:Veloren – Open-source MMORPG written in Rust by atoav on Saturday February 06, 2021 @04:34AM (#26045404)
Sure you can create these situations in Rust as well, but it makes that choice very obvious. So instead of being like: Damn, there was a case that I didn't consider at all you usually are like That case I decided against handling before must be handled now.

Of course you could still ignore it then, but the language made make this choice at every point consciously so it is totally your fault if it bites you later.

I e.g. tend to comment on unwraps why they cannot panic, and if they could (because I wanted to follow another strain of thought first, I use except and a message or writw a TODO comment.

Re:Veloren – Open-source MMORPG written in Rust by sinistersnare on Friday February 05, 2021 @04:57PM (#26041738)
Using `unwrap` is not something that can come back to bite you in a long term (other than API design wise). Replacing it is dead easy, as the compiler helps you. Also, you can replace it with a call to `expect` to give a relevant message too.
Re:Veloren – Open-source MMORPG written in Rust by est31 on Friday February 05, 2021 @05:06PM (#26041823)
That's why I said it's way better. It's usage is still not considered good practice for most scenarios.
Re:Veloren – Open-source MMORPG written in Rust by rmdashrfstar on Friday February 05, 2021 @08:04PM (#26043142)
Those .unwrap() and .clone() calls make the points for optimization or improvement very obvious.