Hacker News new | ask | show | jobs
by Mesopropithecus 1301 days ago
> [...] most modern, procedural languages (C++, Go, Python, Java, etc.) all very similar in terms of their basic concepts. [...] With Rust, though, one needs to learn entirely new ideas — things like lifetimes, ownership, [...]

Maybe an oversight, C++ is misplaced in that list. C++ without knowing about ownership and lifetimes is a recipe for disaster.

1 comments

Even in the other languages lifetimes/ownership are a useful mental tool for managing manual resources (DB connections, transactions, mutexes, file handles, etc).

There's so much code in Go that is documented like "while this object takes a file handle, it does not close it itself even though there is a close function, you will need to close it" that in Rust is just a lifetime annotation.