Because of ownership you’re forced into certain hierarchies, which make the code ugly and hard to read.
For non-gc languages you always have ownership, in most languages you just have to keep track of it manually. And whenever the rust compiler gives an error, you would most likely have had a future issue in another language. For gc languages, this may still exist if you share data between threads, causing possilbe race conditions and data corruption. So, the ownership/borrow model is just a formalization of implicit rules that exists in most languages.
wouldn't it be better to use
#[cfg(target_os = "windows")]
instead of checking an env variable?
Reference: https://doc.rust-lang.org/rust-by-example/attribute/cfg.html
Yes, you have a point. However adding heat is often implicit when talking about melting stuff. However, if it requires 3400C, then the answer would probably include a comment about that.
Oh, hadn't seen the "Time travel debugging Rust in NeoVim" before, and I'm bad at using the debugger in vim so this is definitely something I must try out.
Traits are similar to an interface, but with some differences. Here is a comparison with Java interfaces https://stackoverflow.com/a/69485860
If you look at Rust for example, then you specify the Traits instead. So, you could define a trait that defines the properties for birth, another to define if the animal have a beak, and another one to define the number and type of legs. The each animal implement these traits, which then properly can define a duck, cat and a platypus.
Error stack will give will print the full stack of errors and their corresponding line in the code. Much like a backtrace, but for errors.
Yes, I started off with a C mindset and had a bit of a struggle the first days until the mental model of ownership and borrowing landed, after that it is mostly learning to use new concepts like pattern matching, the ? operator aso.
snaggen
0 post score0 comment score