I personally like #1, the Iterator suffix for all iterators. It is very slightly verbose, but I think most of the time this should not matter.
On Sat, Dec 21, 2013 at 10:21 AM, Palmer Cox <[email protected]> wrote: > I noticed recently that there seem to be 3 distinct Iterator naming > conventions currently in use: > > 1. Use the "Iterator" suffix. Examples of this are SplitIterator and > DoubleEndedIterator. > 2. Use the "Iter" suffix. Examples of this are ChunkIter and ComponentIter. > 3. Use no particular suffix. Examples of this are Invert and Union. > > Iterators are somewhat special objects, so, it makes sense to me that they > have a suffix in common to denote their common behavior. It seems > non-ideal, however, that there appear to be 3 separate conventions in use > since that is just confusing. Personally, I think I prefer #1 because its > far and away the most common and and because I think #2 and #3 have issues: > > #2 ("Iter" suffix): If we used this suffix, would we rename > DoubleEndedIterator to DoubleEndedIter? That looks awkward since we > abbreviated Iterator without abbreviating anything else. However, > DblEndedIter is a monstrosity. So, this convention seems non-ideal to me. > > #3 (no suffix): I think its pretty confusing while reading through code > that there are both iter::Map and container::Map since they are completely > unrelated. I'm also not a big fan of Union since I think as a union as a > collection of information that I can iterate multiple times. However, since > Union is itself an Iterator, I can only iterate it once. This means I would > have to be careful passing a Union around to make sure I don't pass around > an already iterated Union object. > > So, I opened up https://github.com/mozilla/rust/pull/11001 to standardize > on #1 - all Iterators have an Iterator suffix. > > Thoughts? > > -Palmer Cox > > > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev > > -- Yati Sagade Software Engineer at mquotient <http://www.mquotient.net/> <http://twitter.com/yati_itay> Twitter: @yati_itay <http://twitter.com/yati_itay> | Github: yati-sagade<https://github.com/yati-sagade> Organizing member of TEDx EasternMetropolitanBypass http://www.ted.com/tedx/events/4933 https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
