Lou Montana/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (linked indentation styles wiki page)
mNo edit summary
Line 12: Line 12:
* prefix your public variables with your tag
* prefix your public variables with your tag
* PRIVATE (or params) your variables
* PRIVATE (or params) your variables
* Use #define SOME_CONST for constant values instead of variables


;Also:
;Also:

Revision as of 18:43, 5 September 2019

Category: Scripting Topics


Best practices
  • Make it readable
    • var names
    • format, indentation, no one-line, spacing, line returns
    • Be consistent (space/tab indentation, (camel)casing, K&R / Allman style indenting. See Indentation Styles)
  • Don't duplicate, make functions
  • prefix your public variables with your tag
  • PRIVATE (or params) your variables
  • Use #define SOME_CONST for constant values instead of variables
Also
  • don't steal code and pretend it's yours
  • don't try to obfuscate your code: it's considered rude, especially since you learnt from others
  • have fun