Scripting:Sourcecode: Difference between revisions

Building pieces of another world.
Jump to navigation Jump to search
gravatar The Watcher [userbureaucratsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
(Created page with "The source code for TWScript, including supporting files and instructions for building the scripts is available at GitHub: https://github.com/TheWatcher/twscript If you fork t...")
 
gravatar The Watcher [userbureaucratsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
No edit summary
 
Line 1: Line 1:
The source code for TWScript, including supporting files and instructions for building the scripts is available at GitHub: https://github.com/TheWatcher/twscript If you fork the code on GitHub and make any useful additions to any of the <code>base/</code> files, or fix any bugs in the code, please send me a pull request and I'll look into merging your changes.
The source code for TWScript, including supporting files and instructions for building the scripts is available at GitHub: https://github.com/TheWatcher/twscript If you fork the code on GitHub and make any useful additions to any of the <code>base/</code> files, or fix any bugs in the code, please send me a pull request and I'll look into merging your changes.
== Layout ==
The TWScript source is organised into a number of directories:
* <code>base/</code> contains the various TWBase* base scripts and supporting code.
* <code>pubscript/</code> contains any pieces of Telliamed's Public Scripts code required to support the rest of TWScript
* <code>twscript/</code> contains the implementations of the various TWScript scripts.
If you intend to use TWScript as a basis for your own code, you will need to retain the <code>base</code> and <code>pubscript</code> directories, but you will want to replace <code>twscript</code> with your own code.


== Code Style ==
== Code Style ==
The most immediate thing you will notice when browsing the TWScript code is that, unlike the wider lg/scriptlib/publicscript code by Telliamed, this code deliberately avoids Hungarian Notation as much as possible. If you want, consider it a way of clearly separating the TW* code from the larger codebase (or maybe I just utterly loathe Hungarian Notation with the burning passion of a thousand newborn stars. Which is it? WE MAY NEVER KNOW!)
The most immediate thing you will notice when browsing the TWScript code is that, unlike the wider lg/scriptlib/publicscript code by Telliamed, this code deliberately avoids Hungarian Notation as much as possible. If you want, consider it a way of clearly separating the TWScript code from the larger codebase (or maybe I just utterly loathe Hungarian Notation with the burning passion of a thousand newborn stars. Which is it? WE MAY NEVER KNOW!)


My code also uses underscores rather than CamelCase except for class names, and functions imported from outside my code. This is partly another personal style thing, but in this case there really is the intention of marking code separation: it makes it easier for me to keep track of what's mine and what comes from Outside.
My code also uses underscores rather than CamelCase except for class names, and functions imported from outside my code. This is partly another personal style thing, but in this case there really is the intention of marking code separation: it makes it easier for me to keep track of what's mine and what comes from Outside.

Latest revision as of 11:18, 21 June 2014

The source code for TWScript, including supporting files and instructions for building the scripts is available at GitHub: https://github.com/TheWatcher/twscript If you fork the code on GitHub and make any useful additions to any of the base/ files, or fix any bugs in the code, please send me a pull request and I'll look into merging your changes.

Layout

The TWScript source is organised into a number of directories:

  • base/ contains the various TWBase* base scripts and supporting code.
  • pubscript/ contains any pieces of Telliamed's Public Scripts code required to support the rest of TWScript
  • twscript/ contains the implementations of the various TWScript scripts.

If you intend to use TWScript as a basis for your own code, you will need to retain the base and pubscript directories, but you will want to replace twscript with your own code.

Code Style

The most immediate thing you will notice when browsing the TWScript code is that, unlike the wider lg/scriptlib/publicscript code by Telliamed, this code deliberately avoids Hungarian Notation as much as possible. If you want, consider it a way of clearly separating the TWScript code from the larger codebase (or maybe I just utterly loathe Hungarian Notation with the burning passion of a thousand newborn stars. Which is it? WE MAY NEVER KNOW!)

My code also uses underscores rather than CamelCase except for class names, and functions imported from outside my code. This is partly another personal style thing, but in this case there really is the intention of marking code separation: it makes it easier for me to keep track of what's mine and what comes from Outside.



Authors

  • gravatar The Watcher [userbureaucratsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+]