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

Verbose function names #34

Closed
wants to merge 1 commit into from
Closed

Conversation

fphilipe
Copy link
Contributor

I've been glancing over the codebase and there's one thing that I found to be a bit too verbose. In src/cursor.js there are several methods that have the in their names.

  • isAtTheEnd
  • isAtTheBeginning
  • moveAtTheEnd
  • moveAtTheBeginning

In my opinion, these would read nicer without the. Also, if I understood the move methods correctly, they move the cursor before or after an element. Wouldn't it make more sense to name them moveTo{End,Beginning} or maybe even move{Before,After}Element?

@matteoagosti
Copy link
Contributor

@fphilipe I totally agree with the rename you did, names were to verbose, however I'm not that convinced about the single move method as its semantic with the two arguments may lead to confusion (what if one pass both parameters?). However I would rename those in moveBefore and moveAfter, what do you think?

@fphilipe
Copy link
Contributor Author

Damnit, wanted to add a commit to this PR but pushed that commit to master instead (c7b8eb9). The commit renames the move methods, as you suggested, to moveBefore and moveAfter. Sorry about that 😁

@matteoagosti
Copy link
Contributor

No problem :)

@matteoagosti
Copy link
Contributor

By the way, do the merge once you're OK.

@fphilipe
Copy link
Contributor Author

OK, I'll just cherry-pick this commit since it's only one 😃

@fphilipe
Copy link
Contributor Author

Landed in ce4aacb

@fphilipe fphilipe closed this Aug 27, 2013
@fphilipe fphilipe deleted the less-verbose-cursor-methods branch August 27, 2013 07:33
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 this pull request may close these issues.

2 participants