2023

Intent, not implementation

When designing interfaces / APIs, it is easy to design the interface around the solution space. This makes such interfaces difficult to use, difficult to test, and difficult to maintain. Instead, our interfaces should allow users to easily express their intent.

Rust doesn't actually follow its Golden Rule

(when it comes to async functions)

A couple of days ago, Steve Klabnik published an article discussing Rust's Golden Rule, arguing that Rust's function signatures provide a clear contract that doesn't depend on the function's contents, which aids reasoning about the code. In particular, function signatures are never inferred.

However, the Rust language has evolved so that it violates this Golden Rule. While impl Trait return types by themselves are fine, they combine with auto-traits such as Send in an unfortunate manner. This is a noticeable limitation when it comes to writing async Rust code.