Skip to content
This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Commit 31f0ccf

Browse files
authored
Merge pull request #1421 from tigerbeetle/matklad/main-on-top
style: main on top
2 parents 42ab171 + a68f529 commit 31f0ccf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: docs/TIGER_STYLE.md

+7
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ Beyond these rules:
273273
* Callbacks go last in the list of parameters. This mirrors control flow: callbacks are also
274274
_invoked_ last.
275275

276+
* _Order_ matters for readability (even if it doesn't affect semantics). On the
277+
first read, a file is read top-down, so put important things near the top. The `main` function
278+
goes first.
279+
280+
At the same time, not everything has a single right order. When in doubt, consider sorting
281+
alphabetically, taking advantage of big-endian naming.
282+
276283
* Don't overload names with multiple meanings that are context-dependent. For example, TigerBeetle
277284
has a feature called *pending transfers* where a pending transfer can be subsequently *posted* or
278285
*voided*. At first, we called them *two-phase commit transfers*, but this overloaded the

0 commit comments

Comments
 (0)