Castlevania Dungeon Forums
Off Topic => Off Topic => Topic started by: TheouAegis on May 07, 2011, 10:57:14 AM
-
I heard someone use it in another forum, but forgot what the word was. In other words, say I have the following code:
for (i=0;i<10;i+=1){if x/16=i{y+=2;sprite_index=spr_fish;image_index=2;image_yscale=-1;flipped=true;}}
What is the term for making it look like this instead:
for (i=0;i<10;i+=1)
{
if x/16=i
{
y+=2;
sprite_index=spr_fish;
image_index=2;
image_yscale=-1;
flipped=true;
}
}
-
Umm... indenting?
That's what comes to mind, but our resident programmers might know more about this.
-
making it more human readable
-
I. Am. Not. Human. But. Some. Day. Humans. May. Want. To. Read. My. Code. So. I. Want. To. Lower. My. Standards. To. Human. Levels.
-
Formatting I suppose would be the commonly used term. Though in itself formatting doesn't necessarily mean that style, or using those conventions, but its an accepted use of the word.
A common value convention is using capitals instead of '_'. Also by prefixing the value names with their types. Example;
image_index
would be
intImageIndex
Not sure if Game Maker specified between numbers though. In this case I would use int because it is an integer. Though I myself am guilty of leaving the type off, since I usually can tell by the wording, or looking at the class. In which case the above example gets changed to simply; imageIndex
-
They started using integer specifications in GM8. I personally use '_' and capitals both. Like, spr_bat and obj_Bat to specify it's a sprite of a bat (minor code) or the actual object of the Bat (major code).
-
yeah I do that too. I name em for their use like that too like for effect graphics I name em efx_whatever for the objects. For graphics tho its either spr_ or bg_ or ts_
I reminds me I really should work on my lil project today instead of sittin around watchin ncis
-
Do both: one line per commercial break.
AND THAT'S WHY THERE'S NO CASTLEVANIA ENGINE v0.02 YET!!
;D
-
that would work... if there were commercials...