Scissoring this from my previous thread on vector terminology:
I normally mention it every time someone posts code with that comment. The code itself isn't wrong, it's just the comment that's misleading. $2003 doesn't "set the low byte of the address", seeing as the sprite DMA always starts copying from $XX00, $XX being the value you write to $4014. What $2003 does is select the DESTINATION address, inside the OAM, where the data will be written to.
It made me reflect on tutorial commenting praxis in general. Normally when commenting for myself, i try to tell my future self what a line or block is for, rather than what it literally does. Is this however good praxis when writing a tutorial? I often have a feeling tutorial comments can be a little off, but it's hard to pinpoint when you're still learning the ropes.
Oh, and any other thoughts about tutorials and in-example code commenting could go in this thread, too.
tokumaru wrote:
WheelInventor wrote:
Has this been mentioned in previous threads? I haven't informed myself on this.
I normally mention it every time someone posts code with that comment. The code itself isn't wrong, it's just the comment that's misleading. $2003 doesn't "set the low byte of the address", seeing as the sprite DMA always starts copying from $XX00, $XX being the value you write to $4014. What $2003 does is select the DESTINATION address, inside the OAM, where the data will be written to.
It made me reflect on tutorial commenting praxis in general. Normally when commenting for myself, i try to tell my future self what a line or block is for, rather than what it literally does. Is this however good praxis when writing a tutorial? I often have a feeling tutorial comments can be a little off, but it's hard to pinpoint when you're still learning the ropes.
Oh, and any other thoughts about tutorials and in-example code commenting could go in this thread, too.