General Category > Programming

A case for coding style convention.

<< < (2/2)

Few things that works well for me:

- I like prefixing all my macros with "_" and I use capitals.

--- Code: ---_CRTC 1, 50

--- End code ---

- for labels I enjoy camel case notation, and use "_" to separate the scope

--- Code: ---DrawColumn_HorizInit

--- End code ---

Regarding code sections, I admit I mostly rely on folder usage in file system.
In my source codes, you can often see INCLUDE statements in middle of something.

--- Code: ---    INCLUDE "Code/Game/AsicSprites/BossFight/BossFight_UpdateRingSprite.asm"

--- End code ---
I do that for one big reason: fuzzy search. You know, when in your text editor / IDE / whatever, you can type few letters and then filenames appear (following your search)..
This allows me to navigate easily in the asm project.

But, as already mentioned ealier, we all have our own habits ; and workflows that work for some, will never work for others.


I am willing to conform if we can agree, but i need to cater for the below scenarios in a consistent manner.

for classes, <classname>:

for methods of a class, <classname>_<methodname>:

for methodvariables, <classname>_<methodname>_<variablename>:

for class variables, <classname>_<missingmethodname>_<variablename>:, i.e. <classname>__<variablename>:

for exit labels for iterations or conditions, suffix _<number>_e:

for start of iterations, suffix _<number>_s:

If handcoding assembler I try to be consistent but I seldom am.


[0] Message Index

[*] Previous page

Go to full version
Powered by SMFPacks Reactions Mod
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Mentions Pro Mod