One important thing to keep in mind while programming is scope, particularly when doing any sort of advanced programming. This is particularly important in JavaScript. The JavaScript Closure Loop issue , particularly that JavaScript is function and not block scoped. The difference between let and var in ES6 and how to avoid problems. Of course you could always use let as the Stack Overflow post suggests in ES6, but as of May, 2017 let is not supported by IE or Safari. So unless you've got a fancy transpilation process (there will be a post about this... how to setup a proper Grunt + Babel + Browserify scaffold with a sample starter kit), var will be around for some time to come. The issues around namespacing with JavaScript and why ES6 is such a huge improvement (or AMD or RequireJS). Specifically, why polluting the global namespace is horrible and why workarounds like (function () { // TODO }()) exist. How to avoid problems with var by using the var that = this idiom, and how
Significant updates to my project over the past few days. Introduced grunt, modified all my JavaScript to use Babel + Grunt + ES6 style imports. All the JavaScript gets transcompiled to a dist/ directory, then the system gets executed through grunt. All works because all the paths are relative, and the correct files are copied over to the dist/ directory each time (also introduced a cleaning task). Basic stuff, but another pain that I wish I didn't have to deal with. The good thing is everything is setup on command line now, with rudimentary continuous integration (grunt watch) and a rudimentary build process. Introducing more and more utility classes, building out the foundation of the system... getting soon to the point where I can build out the system's widgets one-by-one, and hopefully my next post will be about rendering to the phone. Here's a portion of my Gruntfile.js in case anyone has trouble setting up their Babel + Grunt configuration... in particular, the key