User:Wuzzy

From Minetest Developer Wiki
Jump to navigation Jump to search

Hi! I'm Wuzzy. I make a few changes in this wiki.

My user page on the Mintest Wiki has more general infos about me: https://wiki.minetest.net/User:Wuzzy

My development philosophy for writing Lua code

When I write Lua code for Minetest mods and games, I tend to follow loosely a set of rules I have been used to over the years:

  • local is your new best friend. Use local religiously for every variable, unless you are sure it must be global
  • Introducing a global variables is a big deal. Do this only if other mods ought to access resources inside that mod (e.g. for an API)
  • Never re-use technical mod names for no reason! Seriously, stop doing this! Once a mod with name “xyz” is released, this name is taken. Deal with it!
  • Do not re-invent the wheel. Do research to check if your task has not already been implemented nicely by someone else
  • One mod shall only fulfil one task, but well. Mods which do multiple completely unrelated features at once are bad.
  • When possible, turn dependencies into optional dependencies
  • Document your own API and code
  • My personal coding style can be summarized in 2 rules:
    • Get your indentations right
    • If you find it hard to navigate your own code, rewrite it
  • Implement localization support as early as possible
  • Use SemVer, when it makes sense
  • Avoid proprietary stuff like the pest