This document describes the conventions adopted in Ledger for the relevant languages: English and C++.
This section applies to written communication in docs, code comments, commit messages, emails, etc.
The project and the resulting application are called “Ledger”. It is a proper name, hence it is not preceded by an article.
Do: Ledger synchronizes user data across devices
the Ledger synchronizes user data across devices
ledger synchronizes user data across devices
All of the data stored in Ledger on behalf of a user is sometimes referred to as this user's ledger. In that case “ledger” is a common name - not capitalized and preceded by an article.
Do: each user has a separate ledger
Don't: each user has
Ledger, like the rest of Fuchsia, follows Google C++ Style Guide. In a few cases not covered there, we choose a convention.
If there is a need to distinguish callback parameters of a method or a class, call them
This section discusses which string types to use for C++ API arguments.
absl::string_view (non-ref) if the functionality just reads the string:
absl::string_view can handle any stream of bytes without copies.
std::string (non-ref) if:
std::movethe string if they don't reuse it afterwards), or
You might want to use a
const std:string& (const ref), if you need to call a function that itself takes a
const std:string& (and you cannot or don't want to change it to take an