well, i suspect a lot of people use them interchangeably given poor knowledge of Swift’s Sequence/Collection hierarchy, and when used on Arrays, they are interchangeable, so it is a matter of style in that context. Those of us who use generics prefer zip
on indices for consistency between Array
and ArraySlice
, but ultimately that is a style preference, for Array
loops, since the code is functionally identical. But this is all very specific and not really relevant to the thread so i’ll stop.
not to shade the effort here at all, but in the spirit of standardization, it’d be nice if we had the same enthusiasm for standardizing currency/textbook types like RGBA, Vector, Matrix, Quaternion, Queue, RBTree, etc. Who’s in? (on a different thread of course)
well, count me in for the linter effort <13
i honestly probably will not use this style guide or formatting tool, though i have no objection to it being organized here. I (like others) just ask that we call it the Default style guide and not the “Official style guide” to emphasize it as a starting point rather than a prescription.
I believe the formatting tool that comes with it should be customizable, but customizations should not be called ‘Default style’, in order to maintain the standardization and consistency (and thus the whole point) of the default style rules.
In other words, we should not have a default-style-formatter
, but rather just a style-formatter
that is capable of applying the --preset=default
style, along with downloadable, team-defined, and user-defined presets. I suggest this only because I suspect much of the code implementing a default style formatter could also be repurposed to apply other styles, and offers a win-win between those who want to preserve the uniformity of the default style, and those who want to use their own presets.
this is a pretty out-there example. i don’t think anyone is going through the effort to preprocess fn
to func
just so they can spell function declarations differently. I only recently bothered with getting an automated gyb
preprocessor up and running in one of my build systems. Varying colon styles on the other hand are very much a thing.