mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
A `for` loop is less noisy than a `drain`, which requires: - a `mut` qualifier for a variable whose modified value we never consult - a method name appearing mid-line instead of a control structure name at the front of the line - a range which is always `..`, establishing no restriction at all - a closure instead of a block Structured control flow syntax has a fine pedigree, originating in, among other places, Dijkstrsa's efforts at designing languages in a way that made it easier to formally verify programs written in them (see "A Discipline Of Programming"). There is nothing "more mathematical" about a method call that takes a closure than a `for` loop. Since `for_each` is useless unless the closure has side effects, there's nothing "more functional" about `for_each` here, either. Obsessive use of `for_each` suggests that the author loves Haskell without understanding it.