Rust gives me a headache. I want to like it, but it just seems so... overengineered https://doc.rust-lang.org/std/str/struct.SplitWhitespace.htm... Why would you create a special data type to represent a string split by Whitespace? Lunacy
> Why would you create a special data type to represent a string split by Whitespace? Lunacy Because it's an iterator. A bespoke iterator type is also created behind the scenes in many other languages. How else would you do it?
There is a `splitWhitespace` iterator[1] in the Nim programming language as well and doesn't require a separate type. In Nim, the iterator is inlined.
1 - https://nim-lang.org/docs/strutils.html#splitWhitespace.i,st...