Search the Community
Showing results for tags 'closure'.
-
Hi, Does anyone have any good tools for debugging HTML5 game development? The Console in Chrome is alright, but doesn't show me that much. I'm developing with LimeJS and Closure, and as my code base footprint increases, I'm finding debugging a little tricky. Any suggestions would be appreciated. Cheers,
-
One of the hardest things I've found in getting to grips with JavaScript is translating a classical, statically typed mindset into the dynamical, prototypal world. I'm currently trying to find a nice, regular pattern to use as my bread-and-butter structure for writing and instantiating objects; I believe that the ability to make private properties and methods is genuinely useful, and so am particularly enjoying the 'module' pattern using closures. I've read a little about the negative performance implications of closures vs prototypes, and have checked on jsperf: http://jsperf.com/prototype-vs-closures/20 - where it appears that closures are generally slower to init, but quicker to read/write; the lesson I'm learning: prototypal architecture suits objects that are read/written very little but instantiated lots (particles?), and closures work for 'chunkier' implementations that benefit from a proper 'public' interface, with other properties hidden (game controller?). Do you guys have a preference or any wisdom either way? I'm trying to master JS before delving into TypeScript, which I know will make this a moot point!