Skip to content

Commit

Permalink
Merge pull request #1421 from tigerbeetle/matklad/main-on-top
Browse files Browse the repository at this point in the history
style: main on top
  • Loading branch information
matklad committed Jan 16, 2024
2 parents 3fef80d + 748640d commit 2b935f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/TIGER_STYLE.md
Expand Up @@ -273,6 +273,13 @@ Beyond these rules:
* Callbacks go last in the list of parameters. This mirrors control flow: callbacks are also
_invoked_ last.

* _Order_ matters for readability (even if it doesn't affect semantics). On the
first read, a file is read top-down, so put important things near the top. The `main` function
goes first.

At the same time, not everything has a single right order. When in doubt, consider sorting
alphabetically, taking advantage of big-endian naming.

* Don't overload names with multiple meanings that are context-dependent. For example, TigerBeetle
has a feature called *pending transfers* where a pending transfer can be subsequently *posted* or
*voided*. At first, we called them *two-phase commit transfers*, but this overloaded the
Expand Down

0 comments on commit 2b935f7

Please sign in to comment.