Ask HN: Which coordinate system is better for a beginners programming language?
There are now two versions. One with the coordinate system origin at the top left, one with the origin at the bottom left. I am interested in the reasons why one or the other version is "better" for a teaching and learning programming language.
Arguments for "top left": this is common in 2D computer graphics; it is easier to deal with a grid of rows and columns
Top left origin tutorial: https://easylang.online/apps/tut_learn.html
Arguments for "bottom left": the y-value corresponds to the height; that's how it's taught in math class
Bottom left origin tutorial: https://tiki.li/apps/tut_learn.html
These tutorials are also built into the Web ID. It is all open source.
[+] [-] stonemetal12|3 years ago|reply
If this is intro to coding 1 of N. Then go top left. They will have to learn the map is not the territory at some point why not with this easy example. It will also help when they try to take what they learned beyond the course.
[+] [-] chkas|3 years ago|reply
[+] [-] andsoitis|3 years ago|reply
Natural fit with algebra.
Someone else in the thread pointed out that Scratch does the same.
[+] [-] bjourne|3 years ago|reply
[+] [-] h2odragon|3 years ago|reply
Complicate everyone else's life: Allow the origin to be set by the user, too.
[+] [-] chkas|3 years ago|reply
[+] [-] webreac|3 years ago|reply
[+] [-] miga|3 years ago|reply
If your audience consists mostly of programmers, use top-left they are familiar with.
If your audience is familiar with primary school math, choose their coordinate system: bottom-left.
It is just convention that is consistently kept within the certain community. I would advise against any convention that is unused in your community.
[+] [-] ggambetta|3 years ago|reply
[+] [-] tompazourek|3 years ago|reply
[+] [-] dontcontactme|3 years ago|reply
[+] [-] chipuni|3 years ago|reply
[+] [-] taylodl|3 years ago|reply
Obviously I jest, but boy would it have made things a lot easier if we did them that way! To your point, I feel like we do a lot of the things we do because that's the way we've always done it. Every now and then we need to step back and ask whether that still makes the most sense.
[+] [-] thayne|3 years ago|reply
[+] [-] Sharlin|3 years ago|reply
[+] [-] yjftsjthsd-h|3 years ago|reply
[+] [-] dekhn|3 years ago|reply
[+] [-] victorclf|3 years ago|reply
Some libraries like to use top left coordinates because they are conceptually easier for stuff such as displaying rows of text and we are used to top to bottom ordering of things.
[+] [-] philipov|3 years ago|reply
[+] [-] dingleberry420|3 years ago|reply
[+] [-] onion2k|3 years ago|reply
[+] [-] jstx1|3 years ago|reply
> Arguments for "bottom left": the y-value corresponds to the height; that's how it's taught in math class
Not quite, in math class (0,0) is the center and you can go positive and negative on both axes. You would be taking the coordinate system from math class and limiting everything to the first quadrant which doesn't seem natural at all (in computer graphics or in math).
[+] [-] wruza|3 years ago|reply
Maybe advanced graphics, e.g. rotation matrix, will be more confusing later, but at this point you’re not a beginner and can always incorporate a mirroring matrix into your stack.
Note also that almost all editors and guis also use top=0 (except AppKit, where it is configurable non-default).
[+] [-] mikewarot|3 years ago|reply
[+] [-] xtiansimon|3 years ago|reply
I especially like the answers which relate one coordinate system to another system, either in mathematics or other computer software.
I wonder if there are any hardware solutions choosing one coordinate system over another…reminds me of photography in a darkroom. A corner is cut off of the film so you can orient the film emulsion in the dark. In that case it’s useful to choose a system, though any orientation would suffice.
This discussion gives me the idea that if your curriculum crosses over to require different coordinate systems, then a new lesson might emerge about how different models are used in different contexts. Like choosing Imperial or Metric, it’s part convention and part utility.
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] IceMetalPunk|3 years ago|reply
[+] [-] chkas|3 years ago|reply
Very often the suggestion comes with 0/0 in the center like Scratch. I haven't thought about that yet, because the necessary negative numbers scared me off.
[+] [-] kbelder|3 years ago|reply
Also... if they're ever going to do any trig... like "move laser to 30 degree angle", it'll be a big boon to keep it exactly in line with what they've learned in school.
[+] [-] 1e-9|3 years ago|reply
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] jcelerier|3 years ago|reply