Suggestion for default variable names/labels (instead of x and sprite)

Hi - instead of creating variables with a default label of “x”, could they be
var label or var variableName or something that gets away from the “mathy” x? I think it would help my students see that they need to give a descriptive name to the variables they create. It would also keep some confusion away from students who are mixing up the x,y for coordinates with the x for the default variable name.

Similarly, when creating a sprite variable, could the default be spriteLabel ? I think this would to also help students see that they are creating a new sprite that should have a unique label.

Interesting suggestions Barbara. I think that x is used out of programming tradition or convention. I’ve seen it in other programming languages as a default variable name. It can confuse some students, though, until they are used to being more descriptive. I tell them that their variables should always be descriptive and their sprite names as well. On a related note, I have the same issues when I teach PhotoShop and they don’t rename their layers.

You are correct that the sprite label can also be confusing. Sometimes I have students name multiple sprites with the same name and sometimes, they even work (until the programming gets too complex). Good things for all of us to watch for, though!

Mike

Yes - I definitely point this out, but for my students who are new to the concept of “x” in pre-algebra/algebra, and given that we use x, y coordinates a lot in game lab, I think being more descriptive with the default would be helpful.

Barb

1 Like