Saturday, July 26, 2014

strict chutzpah

I saw Ryan Vice give a talk on AngularJS on Monday at the Austin .NET User Group. His talk has been put up to UserGroup.tv by Shawn Weisfeld and you may certainly check it out there. It was a fairly straightforward "What is AngularJS?" talk. There were two interesting things that came up beyond Angular that I find fascinating enough to blog about here. The first is scoping strict mode like so:

(function() {
   'use strict';
   whatever();
})();

 
 

This will keep strict mode from breaking third party libraries in a scope beyond your own code. Ryan Vice offered that his idea comes from Chris Love who is working with Ryan on the team Chander Dhall spearheads at Dell. The other interesting thing beyond Angular that came up in this talk was the running of Jasmine scripts by ReSharper within Visual Studio. In these scenarios, Ryan had many commented out lines of code at the top of tests which looked like this:

/// <reference path="../Scripts/angular-resource.min.js" />

 
 

...which became "uncommented" at runtime as part of the Jasmine with ReSharper test-running process! Chutzpah will, per Ryan, empower this trick in build scripts too, but the powers that be at Dell do not allow its use there so his team has to embrace some creative workarounds instead.

No comments:

Post a Comment