You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blank Lines: NO TRAILING SPACE! Blank lines should be, you know, blank.
Characters per line: ~100. When a line gets too long, start splitting it up into multiple lines. The number should only be considered a maximum value; if you find that you're doing a lot of extensive left-to-right reading rather than top-to-bottom, start splitting the lines up.
i++/i--: Do i += 1 and i -= 1 instead unless the increment is genuinely being used to its advantage. If it's that painful to do this, consider foreach instead.
Do not use var! Use the actual type name!
someMethod() rather than someMethod (), someArray[x] rather than someArray [x], etc.
(Type) cast rather than (Type)cast.
Use braces everywhere! I don't care if the if block is one line, braces! Use them!
Single line comments: // This code is derp rather than //this code is derp.
Multi-line comments: Use /* */ blocks, rather than multiple lines of //.
It's not terribly verbose like other guides, but I imagine the developer that can't guess certain styles based on the ~60k lines of existing code isn't reading much documentation...
Hi,
I was wondering if it would be a good idea to add some additional developer level documentation to FNA.
Initially I was thinking it could consist of:
Code style
This is copied from (flibitijibibo/FNA-MGHistory#147):
i++/i--
: Doi += 1
andi -= 1
instead unless the increment is genuinely being used to its advantage. If it's that painful to do this, considerforeach
instead.var
! Use the actual type name!someMethod()
rather thansomeMethod ()
,someArray[x]
rather thansomeArray [x]
, etc.(Type) cast
rather than(Type)cast
.// This code is derp
rather than//this code is derp
./* */
blocks, rather than multiple lines of//
.Additional
Native Library Sources
Would be interested to know if this seems like a good idea?
The text was updated successfully, but these errors were encountered: