Coding guidelines & conventions

We want two things:

  • An easy to read framework codebase.
  • An easy and predictable application codebase.

Here are some principles that Cocotte developers should follow to reach those goals.

Macros should be avoided as much as possible : Macros require a brain switch to operate at another level.

Builders first, macros second : Macros are a great way to provide a nice API to the user but we want them to be built upon a manageable API. Always explore builders first.

Rust code first : Avoid definitions in an external format (e.g., YAML, TOML) to express something that will be used in code. Rust should be expressive enough for a vast majority of situations.

Sane defaults but customizable : Provide a good out-of-the-box experience in 80% of the cases.

No unsafe : It's sometimes unavoidable but our dependencies (-hal crates, Embassy) should already have abstracted the lower level pieces.

No unwraps : Unwraps are only allowed in tests and in examples.

Update mondays : We want to keep our dependencies up to date. If possible the dependencies should be updated every monday.