diff options
Diffstat (limited to 'posts/don't_repeat_yourself.md')
-rw-r--r-- | posts/don't_repeat_yourself.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/posts/don't_repeat_yourself.md b/posts/don't_repeat_yourself.md new file mode 100644 index 0000000..d39267e --- /dev/null +++ b/posts/don't_repeat_yourself.md | |||
@@ -0,0 +1,9 @@ | |||
1 | Looping constructs are bad. Consider this: | ||
2 | |||
3 | ``` | ||
4 | for (int i = 0; i < arr.len(); i++) { ... } | ||
5 | ``` | ||
6 | |||
7 | It is not obvious at all, what this loop does. Is it | ||
8 | supposed to iterate over the elements of the array? Is it | ||
9 | just a variable binding that increases up to `arr.len()`? | ||