Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That link is about learning rust.

It’s quite obviously true, that you have to actively think/maintain how long each instance lives, which is simply done by the runtime in your place in case of a managed language.

In my experience, this is not a big effort at writing new code, but at refactoring/maintenance - as lifetimes are parts of the public APIs even.



> That link is about learning rust.

While this is true for most of the article, I think the quoted sentence is about more general Rust use.

> In my experience, this is not a big effort at writing new code, but at refactoring/maintenance

In my experience working on the Meilisearch codebase, Rust is the easiest language to refactor, because it catches so many errors at compile time:

1. Most languages lack the `mut` binding modifier that allows to warn when the binding does not need to be mutable (catching errors when part of the code hasn't been updated)

2. Most languages lack exhaustive initialization, destructuring and matching, that catch pretty much all the situations where a new field has been added to a struct.

3. Let's not speak about languages with null, or without static typing

Having more type information (including lifetimes) makes refactorings easier, not harder. I concede it causes a bit more boilerplate but that's not the bottleneck when writing code.


The result being safer is not the same metric as productivity of maintenance.


And being fast at writing bugs should not be considered as being productive. I think that's the kind of stuff google is taking into account when they say that rust is worth it.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: