Skip to content

3. Developer Info and Recommended Environment

Noah Steinberg edited this page Aug 19, 2018 · 1 revision

Recommended Setup (CTO current setup)

Editor: Microsoft Visual Studio Code

Including addons: Bookmarks, Bracket Pair Colorizer, ESLint, Github build status, Gitlens - Git supercharged.

Node Version 8.9.1

OS: Windows 10 with Ubuntu Subsystem enabled for Linux testing and mySQL.

Style and Code Guide

File layout

  • app.js - base startup and bot logic
  • database.js - logic for working with persistent/stored data in the mysql database
  • generator.js - logic for providing peronalised error messages to end users
  • commands/*.js - logic for all different types of commands. Each file represents commands specific to a role/permission level.

Function Documentation

Please document all functions as specified by http://usejsdoc.org/ Furthermore, feel free to include inline comments to clarify any program logic or longer functions

Global Variable Usage

Several global variables are used to keep track of certain configuration values or constants throughout the program. As a general rule, global variables should be avoided, but if you must make use of a global, please redefine it as a local at the top of the file like ''' logger = global.logger ''' so it is easy to see what globals your module/file depends on.

Other Style Notes

Overall, all commits/additions to the code are subject to code review from a developer with merge permissions from the main repo. (Usually the CTO or a council member). Before asking for code review you should always keep in mind...

  • Is my code clear?
  • Is my code well commented?
  • Is anything in my code hacky?
  • Is there any errors I haven't accounted for?
  • Have I tested this code on my own? If any of these questions is not a resounding yes, you should reconsider asking for code review.