Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small name changes #21

Closed
marcglasberg opened this issue May 31, 2020 · 2 comments · Fixed by #34
Closed

Small name changes #21

marcglasberg opened this issue May 31, 2020 · 2 comments · Fixed by #34
Assignees

Comments

@marcglasberg
Copy link

  1. iteratorAtEnd is really confusing. It should be called reverseIterator or iteratorReversed.

  2. A lot of methods have their parameters called other. I would prefer to call them sequence. For example: bool startsWith(Characters sequence) instead of bool startsWith(Characters other)

Of course, this is a matter of taste, so feel free to disagree.

@lrhn
Copy link
Member

lrhn commented Sep 4, 2020

The iteratorAtEnd is not a reversed iterator. You don't use moveNext to move backwards like I'd expect for a reversed iterator.
It's just an iterator which is currently at the end, just as if you had done var it = chars.iterator; while(chars.moveNext());.
So, the name is precise.

Not sure what sequence would add. It's a new concept (we use "sequence of characters" to say what a Characters object represents, and occasionally use it implicitly about the sequence of characters of a Characters object, but we don't "sequence" as a stand-alone noun).
If anything, I'd use characters instead of other. That would actually be better.

@marcglasberg
Copy link
Author

Ok, at the time I wrote this I didn't understand that Characters.iterator is not a traditional iterator, and can move both directions. I'm not sure but I believe this fact was not clear in the docs at the time.

I agree with bool startsWith(Characters characters)

@lrhn lrhn self-assigned this Sep 7, 2020
lrhn added a commit that referenced this issue Sep 7, 2020
Also do some clean-up.

Fixes #21, #22 and #24:

* #24
* #22
* #21
@lrhn lrhn closed this as completed in #34 Sep 22, 2020
lrhn added a commit that referenced this issue Sep 22, 2020
Add some extra functionality

Also do some clean-up.

Fixes #21, #22 and #24:

* #24
* #22
* #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants