about summary refs log tree commit diff
path: root/src/doc/style/features/loops.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/style/features/loops.md')
-rw-r--r--src/doc/style/features/loops.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/doc/style/features/loops.md b/src/doc/style/features/loops.md
new file mode 100644
index 00000000000..b144825f981
--- /dev/null
+++ b/src/doc/style/features/loops.md
@@ -0,0 +1,13 @@
+% Loops
+
+### Prefer `for` to `while`. [FIXME: needs RFC]
+
+A `for` loop is preferable to a `while` loop, unless the loop counts in a
+non-uniform way (making it difficult to express using `for`).
+
+### Guidelines for `loop`. [FIXME]
+
+> **[FIXME]** When is `loop` recommended? Some possibilities:
+> * For optimistic retry algorithms
+> * For servers
+> * To avoid mutating local variables sometimes needed to fit `while`