ejona86 / taus

Tetris - Actually Useful Statistics and other mods
MIT License
91 stars 3 forks source link

Disassembly: Revised / improved names for scoring labels #31

Closed kirjavascript closed 2 years ago

kirjavascript commented 2 years ago

Some revised names based on previous suggestions!

I think I prefer the more TAUS-like approach to labeling by what follows now that I've changed it over. (even if @score1AddPoints is a little awkward)

I liked @levelLoop because it describes what's being used to count the loop. Maybe @levelLoopCheck could be @LevelLoopDec instead.

Now @addLineClearPoints is a local label, do you think we should change addHoldDownPoints to just addPoints? It's called in a few places and triggers the whole scoring routine.

It's cool that the tests caught some stuff. I think I updated the two player diff properly this time =)

ejona86 commented 2 years ago

@levelLoopCheck

End-of-loop labels can be hard. I think that one is quite good. @levelLoopDec is also good. For something like this it'd also be fair to give it a short name like @loopCheck or @loopDec or @loopEnd or @dec or @iter or other such things. The common patterns need less specific names, partly because they are harder to name but also because they are easier to read. Just see how often I used @ret.

do you think we should change addHoldDownPoints to just addPoints

Yeah, it seemed it should get renamed... except looking a bit more, it isn't a function. L9BFB flows right into it. It looks like it is part of playState_updateLinesAndStatistics; so if we defined a few more labels we'd be able to make it a @ label at which point the current name seems fair.

What "is a function" is hard to tell sometimes. The control flow is complicated around the code in this case, so it doesn't really feel like a function.

It's cool that the tests caught some stuff. I think I updated the two player diff properly this time =)

The diff can be annoying to fix at times, so it is fine if you don't fix it some time. When it is easy, it is nice to fix it though. I've broken it accidentally multiple times.

ejona86 commented 2 years ago

@kirjavascript, thank you!