Full title: [Advanced Rust] 2.1. API Design Principles of Unsurprising - Naming Tips, Implementing Common Traits (Debug, Send, Sync, and Unpin)
2.1.1. What Is the Unsurprising Principle?
The unsurprising principle is also called the least-surprise principle. It means that the APIs you write should be as intuitive as possible.
Users should be able to guess what an interface does just by looking at it. At the very least, your interface should not surprise them. Its core idea is to stay close to what users already know, so they do not need to relearn concepts. For example, if an interface name contains error, users will probably guess that it is used for error handling.
In other words, we need our interfaces to be predictable, which requires attention to the following:






