I just watched this very awesome WWDC session and thought maybe we need actually a similar rule in SwiftLint. The opt-in rule would basically forbid any possible raw loops and force some codebases to use more generic algorithms from the stdlib. Thoughts?
I like the idea, though I wouldn’t use it. I tend to be conservative on linter rules against “discouraged” language features.
I’d certainly be for it if it were opt-in, just not opt-out.
SwiftLint has been tracking a ticket to add a rule that would suggest using higher level algorithms when it detected certain patterns in loops: https://github.com/realm/SwiftLint/issues/871
It'd be trivial to build a very basic version of this, and expand over time with more complex cases.
Cool, I'd use it, but it definitely must be opt-in by default.