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

API Change: Terminal.move (y, x) => (x, y). #65

Closed
jquast opened this issue Oct 10, 2015 · 5 comments · Fixed by #130
Closed

API Change: Terminal.move (y, x) => (x, y). #65

jquast opened this issue Oct 10, 2015 · 5 comments · Fixed by #130

Comments

@jquast
Copy link
Owner

jquast commented Oct 10, 2015

This issue duplicates upstream issue, erikrose#58

Problem

Terminal.location is (x, y) but Terminal.move is (y, x).

This causes issues with composability of positional (y, x) parameters. Also causes programmer mistakes.

Solution

Terminal.move to positional ordering, (y, x) => (x, y).

@jquast jquast added the bug label Oct 10, 2015
@jquast jquast added this to the 2.0.0 milestone Oct 10, 2015
@jquast jquast changed the title API Breakfix: API Change: Terminal.location positional arguments (x, y) => (y, x). Oct 10, 2015
@jquast
Copy link
Owner Author

jquast commented Oct 10, 2015

This issue deferred until grouped by other SEMVER major API breaking changes. Documentation already brings a rather severe note about the use of explicit keyword arguments.

@iderik
Copy link

iderik commented Apr 13, 2017

If you're planning to do this major API breaking changes, why not change Terminal.move to (x, y) instead? Isnt the (x, y) order more of a standard then (y, x)?

In source codes I've seen with Curses, people almost always define X first and Y second, but then reverse the order when passing them as parameters because of Curses. What I mean is that people "think" (x, y) and not (y, x). The first time I noticed that in Curses, I immediately went looking for an alternative.
It might confuse the user about order of width and height too.

Here's a quote from Python 3 documentation of Curses: "This breaks the normal convention for handling coordinates where the x coordinate comes first. This is an unfortunate difference from most other computer applications, but it’s been part of curses since it was first written, and it’s too late to change things now."

Pleaseee, dont follow the same road like they did!

@jquast
Copy link
Owner Author

jquast commented Nov 4, 2017

I grew up on (x, y) for all my graphics programming too, I generally agree! This oddity is why this bug happened in the first place, I'm sure :)

Just defaulting to match upstream api order, rather than our own. Will consider, thanks!!

@jquast
Copy link
Owner Author

jquast commented Sep 23, 2019

i would agree to go (x, y) in any 2.0 release btw

@jquast jquast changed the title API Change: Terminal.location positional arguments (x, y) => (y, x). API Change: Terminal.move (y, x) => (x, y). Jan 12, 2020
@jquast
Copy link
Owner Author

jquast commented Jan 17, 2020

Added term.move_yx and term.move_xy for next release, and we recommend only term.move_xy in the documentation and examples going forward. move still exists for compatibility, sorry, just wasn't enough to break major api!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants