https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Using
Isolating module scope using the
(function() { ... } ());
syntax works well but seemed to mess up paper.js scoping and though the error was probably mine, I changed paperGlue to use javascript scope which meant going through and changing all the Point operators to math functions. The operation of layers also seemed to change and a inferred layer nolonger worked for baseLayer. Also the document body must be loaded before initialising the paper scope using
paper.install(window);
paper.setup('myCanvas');
The home html now has a module loader for checking that modules and their dependancies are met before an init() function is activated. For foreign modules, I have relied on on onLoad() but for home grown modules, the last line on each module attempts to call window.globals.loadModule().
Exploring methods to isolate name space in modules, I discover the module pattern - see this articleh JavaScript-Module-Pattern-In-Depth and this which has better example code. The alternative popular method is to use the AMD module loadings system such as Require.js or DoJo. Another alternative is the CommonJS compiler which bundles everything into one js file.
I am trying a mash of the two, using the function expression to define a namespace (this is working quite well with a dialog.js module test) and then mixing in dynamic script loading - see JavaScript Madness: Dynamic Script Loading. While this will only work for my own scripts, it seems much cleaner for my brain for the moment.
Opened my first github respository and slowly built up 54 pushes using old copies of the paperglue project.
I am still very new to javascript - apart from some SVG scripting my adventures in javascript began after Christmas 2015. Web based 3D seems to be undergoing a revolution with WebGL and, apart maybe from Unity3D, seems to be the only viable multi-platform development framework. I was further inspired by the discovery that with a node.js server running on a PC, client-side storage and client-side hardware interface is greatly expanded.
My employment takes me to Adobe Director and the scripting language Lingo and the to Flash with some Action script. Then moving to Visual Basic using WPF with Visual Studio 2008 and then 2010. Also some MikroPascal for .. micro controllers. Later some C# is added plus C using Arduinos. At home I using Python with Blender first with the 2.49 IDE and then the 2.7 IDE. Tried Unity3D for a bit.
Work at the University finds me using C++ with Motorola IsoPods, C++ with RealTime Linux, C with Arduinos, C/C++ with Ubuntu Linux and finally Python/PyGame with Ubuntu. Partly formalised my skills with a few courses (project management, 2 x java, 1 x python) towards a Diploma in Software Development, mostly through skill recognition, but piked at having to do a lengthy database project. Started a python/pygame car driving simulation.
While repairing Z80 based security systems, I continued to study C++ programming using Allegro. Switched from a purely PC based stepper controller to a Z80 one and did some Z80 compiler development. Also picked up some PIC AXE microcontrollers. Redeveloped my shares tax evaluation system in Java which I am still using in 2015.
Purchased a second hand copy of Borland C++ and bought my first desktop PC. Tried unsuccessfully to develop a train simulation game. Created a shares tax evaluation system.
My first employment requiring programming but only using a BMS tick the boxes system.
Learning Quick basic on my Toshiba laptop - my first PC. It has 3.5" and 5" floppy drives. I paid $2500 which would be about $8000 in todays money! The last PC I bought in 2014 cost $300.
My employer has a MiniComputer on which I can program in C. Wrote some pipe flow and heat transfer calculation programs and a pretty cool 3D render of the local town center. Also still programming in Basic on my Atari but cassette tape loading is painful.
Bought my Atari400 - I think it cost about $600 with Basic, Music sequencer and Star Raiders cartridges. I paid an extra $40 for the 3 technical manuals but rashly through them out just a few years ago. I wrote a 6502 assembler using the basic but did little else to impress.
Built two micro computers. The first with 1k ram and a National Semiconductor SCAMP microprocessor. It had a video output using raster timing and I was able to show the letter 'A' on the screen despite the lack of character generator, and also a simple wall maze game. Code entry was via a wire shorting out 8 copper pads.
Version 2 recycled those components and added a character generator board, a second processor (a motorola 8080), a keyboard, a cassete deck, 4K of ram and 4K of eprom. It was very power hungry and the hand etched boards failed to make good contact with the edge connectors.
A Tandy store opened near our house and I saw my first TTL chip. It was love at first sight. My father encouraged me to build a logic trainer. The TTL devices were indestructable. A good start in electronics.
On a trip to the Victorian science museum I saw a naughts and crosses computer that used just relays. I could understand that. Later, at Essedon Airport (Melbournes main airport at the time) I was a "video" game that used a tread mill landscape and flashing lights for bombs. My imagination soured.