Lazycoder

16May/13Off

Herding Code 166: Tomasz Janczuk on Edge.js

Posted by Scott Koon

This week on Herding Code, the guys talk to Tomasz Janczuk about running .NET code in Node.js using Edge.js.

Download / Listen:

Herding Code 166: Tomasz Janczuk on Edge.js

Show Notes:

  • Intro and background on Edge.js
    • (00:40) Tomasz has been focusing on Node.js at Microsoft for the past 3 years. He’s been working on making Node.js run well on Windows. He’s also worked on hosting Node.js on Windows Azure with IISNode.
    • (02:08) Jon asks about Edge.js’s original name, Owin. Tomasz explains how that made sense with the original scope – connect middleware and express handlers – but it’s grown since then so it needed a more generic name.
    • (02:45) Edge.js lets you run Node.js and .NET code in one process and provides interop mechanisms between the two.
    • (03:05) Jon asks why that’s useful. Tomasz says you can do pretty much anything in either Node.js or .NET, but some things work a lot better on one platform. He gives examples like using ADO.NET to connect to SQL Server and running CPU bound computations as multi-threaded .NET code from the single-threaded Node.js event loop. There are two classes of scenarios: things that work better on one platform, or writing native extensions to Node.js without having to drop all the way down to raw C and native OS mechanisms.
    • (06:11) Jon brings up two questions from Twitter about Mono support (Jason Denizac @_jden "when’s mono support coming?" and Kevin Swiber "Mono support? Can we do legit Node modules in C#? Are grilled hotdogs really better than boiled?" Tomasz says not yet, but it’s high on the list. There are some complications to implement that support since Edge.js uses C++ CLI, which isn’t available on Mono.
  • Getting started and samples
    • (07:57) Jon asks what’s involved in setting it up. He says he ran npm install edge, then npm install edge-cs. Tomasz explains why he didn’t need to install edge-cs – C# support is built in, other language support plugs in.
    • (08:43) Jon asks about the samples. Tomasz explains the different ways of integrating CLR code into Node.js and talks about how the samples show these approaches.
    • (10:36) Jon says he liked how the samples progressed from very basic to pretty complex. Tomasz says you can do just about anything in Edge.js, but there’s a specific interface you need to follow in order to work smoothly between the Node.js async model and many synchronous operations in .NET. Every function in Edge.js uses an async function delegate, so you end up using small wrapper functions in some cases.
  • Marshalling and interop
    • (13:08) Kevin says this reminds him of COM / .NET interop and issues with object lifetime, garbage collection, etc. Tomasz says that that the async function delegate solves the threading models. Object lifetimes are controlled because everything is marshalled by value.
    • (16:22) Kevin asks if the marshal by value prevents working directly with the CLR object. Tomasz says that you can handle this using function proxies to create closures over CLR states.
    • (17:45) Scott K. asks if structs eliminate the serialiazation issues. Tomasz clarifies that the marshalling process is reflecting over the objects in .NET and recreating a synonymous JavaScript. Scott says this sounds like thunking from days of old.
    • (19:27) Jon says that he saw one sample that allows for debugging inline .NET code in a JavaScript file. Tomasz explains that this is done using the codedom compiler to create an in-memory assembly with debugging information, which can be attached to from Visual Studio.
    • (21:25) Jon says he thinks this sounds useful for using a NuGet package in a Node.js application and asks if there’s support for pulling in a NuGet package. Tomasz says that at this point it’s up to you how you’d get the assembly downloaded and set up, but that there’s an open issue to get script-cs integration going and that would handle this.
  • Overhead and performance
    • (23:06) Jon asks about the overhead of running two virtual machines and marshalling. Tomasz says there is some overhead, but it’s better than running two different processes. Edge.js is built for solving some specific scenarios, and it’s fast in those
    • (24:55) Kevin asks if there’s a delay when Edge.js spins up. Tomasz says that happens when you require Edge, but it’s not really noticeable.
  • Misc questions
    • (25:55) Jon asks what was the hardest part of implementing Edge.js. Tomasz says the function proxies to handle lifetimes and reconciling threading models.
    • (27:45) Scott says this sounds useful for authentication or using a legacy .NET library. Tomasz lists several more.
    • (29:20) Kevin asks how exceptions are handled. Tomasz explains how the exceptions are marshalled and thrown across VM boundaries.
    • (30:15) Kevin asks if it’s tied to specific Node.js versions. Tomasz says it works on all current stable versions.
    • (31:30) Question from Twitter: @jeremydmiller "I’ve seen a lot of samples of hosting . Net in node, but how about running node in a .net process?" Tomasz talks about an open issue, Mission Double Edge which would handle that. He explains that the challenge is that Node.js doesn’t have a hosting model.
    • (33:20) Jon says he saw several of the samples had the C# script named with .CSX extension and asks about that. Tomasz says that this is partly done to follow Roslyn conventions, including specifying assemblies as references in code using #r.
  • Future plans and next steps for listeners
    • (34:25) Jon asks what’s planned going forward. Tomasz talks about Mono support and adding support for additional languages, including F# (note: this has been added http://tjanczuk.github.io/edge/#/3) . Jon asks what’s involved in adding language support.
    • (36:30) Jon asks about the relationship with OWIN. Tomasz says there’s a separate module which allows you to plug any OWIN compatible .NET application and plug it into an Express.js pipeline. Jon says this reminds him of the Edge name and Tomasz explains that the idea is that mathematically an edge connects two nodes, so Edge.js connects differe.
    • (38:25) Jon asks about next steps for people to get started.
    • (38:55) Jon asks if this is a Microsoft project. Tomasz says it’s his own separate open source project that’s inspired by his day job, and this allows him some more flexibility to work with the community. He lists some of the community contributions they’ve seen so far.

Show Links:

30Apr/13Off

Herding Code 165: Mark Seemann on AutoFixture and Unit Testing

Posted by Scott Koon

While at the Danish Developer Conference in Copenhagen, Jon sat down with Mark Seemann to talk about AutoFixture and Unit Testing.

Download / Listen:

Herding Code 165: Mark Seemann on AutoFixture and Unit Testing

Show Notes:

  • AutoFixture
    • (00:44) AutoFixture is an open source library that simplifies the "Arrange" part of the standard Arrange / Act / Assert steps in unit tests.
    • (01:20) Jon asks about anonymous variables. Mark says he got that terminology from Gerard Meszaros’ book, xUnit Test Patterns. Anonymous methods and variables are necessary for a test, but their implementation doesn’t matter.
    • (02:23) Mark describes the test data builder pattern, from the book Growing Object-Oriented Software. The pattern works well, but it gets to be repetitive and mechanical to write and maintain, so he wanted to automate it. AutoFixture uses reflection to create the needed instances.
    • (04:00) Jon asks about the usage pattern for AutoFixture.(04:16) Jon asks about the different values returned for strings, ints, etc. Mark explains how that’s changed over time – numbers no longer just return sequential values, they now return random small numbers.
    • (05:20) Mark explains equivalence classes. Jon says "Okay" a lot. You can use AutoFixture in cases where you don’t care about the value; in cases where you do, you can configure what you want to. Mark explains some of the different ways you can use the AutoFixture API to set specific values when needed.
    • (09:15) Jon asks how AutoFixture works with mocking. Mark says there are NuGet packages which will interface with Moq, Rhino Mocks, FakeItEasy and NSubstitute.
    • (10:25) Jon asks Mark what his talk said about equivalence. Mark explains identity and value objects with an example with overriding the equals operator on a money value object. The more you can model your domain as value objects, the easier your tests become. Jon asks if this is an example of TDD driving a good design. Mark says that he tried letting tests completely drive his design a few years ago, but he found that it alone didn’t drive a very good overall design.
  • Testing philosophy, Testing Trivial Methods
    • (15:56) Jon asks Mark about his recent post advocating testing trivial methods. Mark says that his post was in response to Robert C. Martin’s post, The Pragmatics of TDD. Mark makes a case for testing getters and setters – if you decide to use a property rather than a field, that decision probably warrants a test to verify the property is maintaining the behavior that drove the original decision.
    • (20:38) Jon asks how this applies to the example of testing ASP.NET MVC controller code. Mark says he’s in the habit of testing everything, and has written a lot of tools to make writing the tests easy enough that it’s not a concern. The question is, how much does it cost you if a unit of code doesn’t function as designed? Mark explains how a controller action models the data flow in an MVC application, and decomposing the flow allows you to write smaller, simpler, more targeted tests.
    • (25:03) Jon asks how this relates to outside-in testing using tools like Selenium. Mark says that testing at the external boundary is fine if you can, but most applications become complex enough that boundary testing would require an impractical number of test cases.
  • Wrap up
    • (26:04) Mark says that many of these concepts are covered in more detail in Mark’s Pluralsight course.

Show Links:

22Apr/13Off

Herding Code 164: OWIN and Katana with Louis DeJardin

Posted by Scott Koon

This week on Herding Code, the guys talk to Louis DeJardin about OWIN – the Open Web Interface for .NET – and Katana, an open source OWIN implementation for ASP.NET and IIS.

Download / Listen:

Herding Code 164: OWIN and Katana with Louis DeJardin

Show Notes:

  • Intro
    • (00:44) Scott and Louis explain what OWIN is.
    • (01:33) Louis explains the difference between OWIN (the community standard) and Katana (actual bits – an implementation of the OWIN standard for ASP.NET).
    • (03:18) Jon asks if this is similar to the distinction between HTTP / HTML standards and browser implementations. Louis explains what’s required for an implementer to participate in a request. Each request calls a simple func with an IDictionary<string> which returns a task.
  • The killer app: middleware
    • (04:54) Scott talks about how the pipeline might not sound like much, but it can support a lot of really useful middleware scenarios like static caching and domain splitting – especially in a way that’s common across frameworks.
    • (06:05) Louis talks about the challenge they’ve had in describing the benefit of OWIN in non-academic terms, and that it’s not until you want to apply cross-framework concerns like authentication that OWIN really shines.
    • (07:52) Scott says that previously these kinds of concerns – logging, etc. – were wrapped up in System.Web, and they had performance implications regardless of whether you used them. The pipeline model lets you avoid those hits unless you explicitly want the features.
    • (10:03) Scott mentions some of the frameworks which have implemented OWIN, including NancyFx, Fubu, ServiceStack.
    • (10:50) Kevin says that the current implementation examples are full web frameworks rather than middleware. Louis says that probably because ASP.NET and IIS already had pipeline implementations so there’s less of a forcing function than there was with Node and Ruby. Scott says that since the current implementations already have full stacks, there’s less need to plug in modular solutions. Jon says he thinks that the late arrival of NuGet and other open modular systems like this mean it’ll take a while to get traction.
    • (14:40) Louis says we’ll need a killer app, and HttpListener hosting alone isn’t that. Jon asks if you’d host Katana under IIS to manage the process. Louis says yes, and until there are other hosts than IIS he doesn’t see the hosting as a big draw – he thinks auth is probably it.
    • 1640 Scott says he could see auth frameworks and scaling middleware. Louis says that David Fowler updated JabbR to run on OWIN, and was able to move some of the scale pieces into OWIN middleware.
    • (18:25) Jon asks if he can take an existing ASP.NET application to start taking advantage of middleware without rewriting the application. Louis says that if you add the Microsoft.Owin.Host.SystemWeb NuGet package, you can put an OWIN pipeline on the route table. You can also use an IHttpHandler to plug in middleware. They’re looking at third option – an integrated pipeline module which will delegate to the application if an OWIN handler doesn’t pick it up.
    • (22:22) Jon asks Louis has some other ideas for middleware, and Louis lists several (static file handlers, authentication, etc.) and points to Rack and Node as examples. He lists another example – anti-bot  protection that returns an HTTP 200 for a URL pattern.
    • (23:50) Jon asks if it’s possible to plug things in at runtime. Louis talks about the Startup class – it’s a POCO class so you can easily work with it via IoC, plug things in whenever – it’s just code.
    • (25:05) Scott says he looked at implementing URL rewriting in middleware. Louis explains how this works perfectly with the pipeline and describes how you could also use this to monitor 404s.
    • (26:45) Scott says hosters could implement middleware to set ETAGS, enforce things, etc.
    • (27:40) Louis explains why it’s really powerful to have middleware that’s not coupled to a specific implementation like ASP.NET MVC.
    • (28:35) Jon asks if it’s possible that some of this middleware could run on hardware. Louis says it is, and gives an example with a reverse proxy.
    • (29:57) Scott talks about breaking middleware into application and networking uses and talks of some optimizations that could be done in middleware.
  • Next
    • (31:48) Scott asks where we go from here – are done? What’s the next goal? Louis says the current 1.0 version of Katana has IIS hosting; the 1.1 version will add production grade HttpListener and self host story, and after that it’s about supporting emerging standards and looking for synergies. Louis says documentation would be nice, but Scott says that the model is so simple that there’s not a lot to document.
    • (34:50) Scott and Louis talk about how this will affect the ecosystem in general, with an example of how smoothly the SignalR implementation worked.
    • (35:25) Jon asks about the future for hosters like Azure, AppHarbor, etc. Louis talks about an example for  supporting zip file based deployment, Mono hosting.
  • Getting involved
    • (37:05) Louis talks about what’s available in the Katana Project, including sample code and pre-release packages. The Google Group – net-http-abstractions – is the best place to discus OWIN.
    • (38:15) Jon asks if the Katana project takes pull requests. Louis says it’s run under the MS Open Tech organization and is clear to take pull requests from developers who have signed a contributor license agreement. Jon asks for areas where they’d like help. Scott says he’d like to see lots of middleware; Louis he’d love to see an OWIN Contrib project emerge.
  • Questions from Twitter
    • (41:05) Sean Massa (@endangeredmassa): Is it possible to use the DLR?
    • (41:45) Eric Hexter (@ehexter): what do MVC and Web Forms look like on OWIN. Louis says there are two exciting things there – you can have an Owin pipeline running in front of your application, or you can use self hosting to put an application inside of your own process (not supported but fun!).

Show Links:

10Apr/13Off

Herding Code 163: Sticker Tales and Building Windows Store apps with Damien Guard and Robert Sweeney

Posted by Scott Koon

This week on Herding Code, the guys talk to Damien Guard and Robert Sweeney about Sticker Tales (a Windows Store application for kids), some challenges in building touch applications for kids, their CSharpAnalytics open source library, and a companion app they built for Western Digital.

Download / Listen:

Herding Code 163: Sticker Tales and Building Windows Store apps

Show Notes:

  • Introductions
    • (00:39) Damien describes what he’s been up to since we last talked to him.
    • (01:25) Robert worked on the Windows user interface, then XBox.com, then several apps for NetFlix.
    • (02:57) Jon asked about the experience of building high scale customer facing applications at XBox and NetFlix. Damian tells about how they ran the XBox store on two servers.
  • Building Sticker Tales
    • (03:38) Jon asks how they decided to build a sticker book app. Robert explains how they got started.
    • (04:45) Robert describes how they decided to spend some money on professional illustration.
    • (05:40) Jon describes how Sticker Tales works and how he loves watching what his five year old daughter comes up with, especially how she plays with scale. Robert says he sees the same as his daughter
    • (6:57) Damien describes some of the surprises they saw in user testing.
    • (8:30) Scott K asks if their experiences in watching how kids interact with touch gestures will influence their design in general.
    • (9:18) Damien talks about some of the changes the kids inspired, especially using direction of motion to flip things. Jon says he wants this flip gesture everywhere, and Scott K says he thinks kids should be interaction testing all touch interfaces.
    • (10:44) Damien gives another example with how pinch / zoom didn’t work well for kids, and they added a handle instead.
    • (11:26) Jon asks about how they were interacting with the illustrators. Robert describes the interaction and how they handled different image sizes, exporting, etc.
  • In-app purchases
    • (13:37) Jon asks about the "free app + in app purchase" model. Robert explains why they chose that model.
    • (14:48) Jon asks if the in-app purchases were difficult to set up. Damien says yes and explains how it was set up. Robert says the purchasing is easy, but the delivery is up to you as the developer.
  • Google Analytics and the CSharpAnalytics library
    • (17:00) K Scott asks about what kind of analytics they were using. Damien explains how they used Google Analytics and explains they published that library as CSharpAnalytics on GitHub. Damien likes tracking usage patterns, Robert says he loves the real-time and geographic views.
    • (18:19) Robert says they track initiated vs. completed purchases, and they see it’s only about 10%. Jon speculates that’s because kids start the purchase and the parents veto it.
    • (19:08) K Scott asks if it’s only available for Windows 8. Damien says that’s all that’s documented, but he’s set it up to work with Windows Phone as well.
    • (19:30) Jon asks about how auto-analytics work.
  • Platform targeting – iPad future, Windows 8 implementation
    • (20:40) Kevin asks if they’re looking at porting this to iPad. Robert says they’re looking at using Xamarin for that.
    • (21:24) Jon asks about what Windows 8 integration points they’re using. Robert discusses live tiles, sharing, search, and background download API support.
    • (22:58) Jon asks if they used C# / XAML or HTML. Damien says they went with C# / XAML partly because the touch API support seemed better early on.
  • SharpDX and performance
    • (23:30) Damien explains that they’re using SharpDX to be able to take screenshots for live tiles, sharing, etc. Jon gets confused and thinks they’re using SharpDX everywhere, but Robert explains it’s only for saving screenshots – everything else is using image controls.
    • (26:54) Jon asks if they ran into any performance issues. Robert explains some of the guidelines they’d learned at NetFlix and says that everything’s worked really well in StickerTales. Damien says they’ve seen great performance on Surface / ARM as well. Jon says he’s seen Audacity recompiled for ARM and it worked great on Surface, too.
  • Data storage and MVVM perspective
    • (28:34) Jon asks what they’re using for data storage; Damien says using XML.
    • (28:46) Robert says they’re not using MVVM because it just doesn’t work with the Microsoft tools and isn’t worth it for the kinds of thin clients they’ve been building, even at NetFlix.
  • Western Digital companion application
    • (30:07) Jon asks how about their next project, a companion application for Western Digital. Damien describes how Western Digital wanted an application that would present an all-up aggregate view of media on external media.
    • (30:42) Damien says they using SQLite for that project and explains the challenges they ran into with hierarchical data storage in a relational database engine.
  • Unit Testing Windows Store application code
    • (32:52) Kevin asks about the testing story. Damien says they used MSTest and it all worked fine, with the exception of determining code coverage. Jon asks some questions about testing frameworks and test focus for Windows Store applications.
    • (35:20) Robert says the WinRT platform wasn’t written in a very testable manner – there are lots of static classes and a generally test resistant API.
  • Business Challenges and Opportunity for Windows Store Developers
    • (36:38) Jon asks about the challenges of building and running a company that’s building Windows 8 applications. Robert describes some of the perception and education issues they face in selling the potential to customers.
    • (38:20) Scott K compares the current Windows Store opportunity to the pre-iOS Mac development market – a nice place to create a niche product and make a good living. Damien says it is nice to be featured in the store, and that’s difficult on other platforms. Robert says that ease of developing Windows Store applications means that you still need to market your applications.

Show Links:

25Mar/13Off

Herding Code 162: Whacha doin, Goodbye Google Reader, scriptcs and Lightning Round!

Posted by Scott Koon

This week on Herding Code, the guys talk about what they’ve been up to lately (including Kevin’s new Greater Than Parts site), lament the passing of Google Reader, talk about scriptcs, and even fit in a lightning round!

Download / Listen:

Herding Code 162: Whacha doin, Goodbye Google Reader, scriptcs and Lightning Round!

Show Notes:

  • What are you up to?
    • (00:29) Scott K is doing MVC with a lot of JavaScript.
      • He laments the quality of the code he’s working with.
      • There’s a discussion of how bad code happens and how to clean it up.
    • (07:58) Kevin’s been working on his GreaterThanParts site.
      • He soft launched it on twitter and got more response than he expected, but it’s been holding up.
      • It’s a full JavaScript stack – Node, Backbone, Mongo.
      • Kevin was surprised how resistant developers were to trying out the site via Google / Facebook login, so he set up an anonymous (cookie based) login.
      • Scott K has some specific feature requests.
      • Jon asks if the design feedback was coherent or contradictory. Kevin says some was really good, a lot wasn’t
    • (15:40) Jon talks about the ASP.NET Jump Start event he did in February and some upcoming Web Camp he’s doing – Denmark, Istanbul, Sunnyvale, San Diego. In his spare time he’s working on a book about programming Windows 8.
      • Scott K mentions a blog post he read about a developer who was frustrated he couldn’t store password protected zip files or preview office docs. Jon says it’s an app model and it’s different than building desktop apps. Kevin wonders about how the updates will work for Windows Store apps.
      • Scott K says he read about limitations in displaying help files. Jon says that some things are easier to do using the HTML dev model, and he’s seeing some people writing business logic in C# and using it in an HTML app.
      • K Scott talks about the current campaign to pay developers for apps. Jon says he thinks that may be driven by the fact that all the tech columnists just write about the number of apps in the store, but he agrees that fewer quality apps is better. The Windows Store has a try / buy model, which effectively halves the number of apps required compared to Android and iOS. Jon talks about how he’s been using the Surface RT.
    • (25:49) Google Reader
      • K Scott asks if anyone’s upset. Kevin is.
      • Scott K hasn’t used it in a while because he just uses Twitter and an RSS reader he likes.
      • Jon says he used to read tons of feed, but he now gets most of his info off Twitter, Hacker News, and TheCadmus.com
      • Scott K says he’s going to need to replace Reader because he follows some feeds he cares about that will never make their way onto Hacker News.
      • Jon says he used to use Reader more when it had Google Gears support. He talks about how he tried to write his own RSS reader which never materialized, but he learned a lot along the way.
      • Kevin says the bigger problem is that so many apps use Google Reader as an RSS sync backend.
      • Jon says he’s happy that the whole RSS system isn’t dependent on Google Reader, and that it’s a good thing that major parts of the web stayed open.
    • (34:45) scriptcs
      • K Scott overviews the idea.
      • Scott K says he thinks it’s interesting – a natural use of Roslyn. He’s been wanting something that would output assemblies so it could create projects.
      • Jon talks about some of the samples they’ve got, including WPF, Mono, etc. He says he’d prefer it to PowerShell since it could be more portable and the syntax is better.
      • Kevin says many of these ideas came from the Node community. He’s really enjoying the low overhead of working in vim. Scott agrees. Jon says he doesn’t see Visual Studio delays, maybe because he’s not using heavy add-ins. A border skirmish erupts. Kevin says that he thinks that .NET programming kind of requires Visual Studio. Jon like the new web tools stuff.
    • (44:27) Lightning Round!
      • K Scott asks if anyone cares about the S4 release. Nobody does. We’re all kind of tired of smartphone releases.
      • K Scott asks what we’d recommend for teaching someone to program. Scott K, Kevin, and Jon all agree that they’d start with the web and JavaScript and talk about some of their favorite tools.
      • K Scott asks what everyone thinks about the new Rearden.js library with the Rearden Metal templating system.

Show Links:

14Mar/13Off

Herding Code 161: Single Page Applications with John Papa and Ward Bell

Posted by Scott Koon

While at MVP Summit, Jon and the Scotts talk to John Papa and Ward Bell about Single Page Applications, the new ASP.NET and Web Tools 2012.2 SPA templates, and John and Ward’s new Hot Towel SPA template (you need a hot towel at a spa, get it?).

Download / Listen:

Herding Code 161: Single Page Applications with John Papa and Ward Bell

Show Notes:

  • Intro
    • (01:10) K Scott asks John Papa about to overview what’s just been released.
    • (01:24) Jon explains how he remembers the ASP.NET and Web Tools 2012 release, comparing it to a video game "map pack".
    • (02:04) John says that one of the new features in this release is that you can create new File / New / Project templates for ASP.NET MVC using VSIX.
    • (03:18) Scott K says you can find all the new goodies at http://asp.net/vnext.
  • Hot Towel overview
    • (03:37) K Scott asks what happens when you create a new Hot Towel project.
    • (04:30) K Scott asks what’s included:
      • Durandal
      • Knockout
      • Breeze
      • Some other nice things: jQuery, Bootstrap, Moment
      • The useful parts of the ASP.NET stack
  • Durandal and getting the various libraries to play well together
    • (06:00) Jon asks if everything in the Hot Towel parts fit together well, and if it was hard to get them to play well together.
    • (07:14) Durandal uses Require.js for AMD for script dependency resolution. Hot Towel is still using ASP.NET Bundling and Minification system, although when you deploy you can use Durandal’s compilation system.
    • (09:03) Ward talks about what he likes about Durandal.
      • You can bring any thing you know from Caliburn.Micro in, including convention based view composition.
      • It includes a lot of useful debugging and tracing information in the console. That includes intercepting problems with Sammy.js (which would otherwise just report "Error" without any context), binding failures, etc.
    • (10:24) Hot Towel also includes Toaster, which is really useful for debugging.
    • (11:15) Hot Towel has really been carefully assembled and and configured so it all really works well together.
    • (12:06) John says Hot Towel solves a common problem people experience when getting started with SPA development – it’s hard to figure out which libraries to use and how to hook them together.
  • What’s the sweet spot? Line of business apps? Websites?
    • (13:20) K Scott asks if the sweet spot for Hot Towel is for for line of business applications. John says that’s what it’s been used for. It’s great for data intensive applications, but he says it’s not a good fit if you’re just building a website.
    • (13:53) Jon asks about the SEO story. John says there really isn’t a great solution for it, but says that for most SPA stories – e.g. line of business CRUD apps – you probably don’t need or want search engines to be able to read it. For some cases, like a store scenario, you might want a hybrid solution. The store would be a standard website that’s SEO friendly, but when you shift to buying something you enter a SPA experience.
  • Organize all the scripts!
    • (15:45) K Scott asks how John organizes code for a SPA. John says he likes to put all the application specific scripts into a separate /scripts/app folder. Jon says he noticed that in the RTM version of the SPA template, and Ward and John confess to having been the driving forces behind that change.
    • (17:37) John talks about the two crowds who are using these scripts – there are people who have been using JavaScript for a while, and developers who are used to C# and are starting to do more JavaScript development. Simple things like pascal casing vs. camel casing make a big difference in how experienced JavaScript developers perceive and enjoy the shipped JavaScript code.
  • Bringing grownup architecture into client side coding
    • (18:19) Ward talks about other problems in earlier versions, like lumping the viewmodel and data access, etc. He says he understands the effort to make things easy for beginners to figure out, and Scott talks about some of the sloppy, oversimplified JavaScript in some other Microsoft releases. John says that the new script organization in the release turned out both better and easier to understand.
    • (20:48) Scott talks about his thoughts on client-side MVC: HTML is the model, CSS is the view, JavaScript is the controller.
    • (22:04) John says we’ve been figuring out of the past few years that it’s not okay to just throw JavaScript code up there until it works. He says he often surveys developers and asks how many of them have read a book on JavaScript with dismaying results. Scott says it’s not just a problem with disorganized code, you end up with resource management issues. Scott, John and Ward commiserate on the problems they’ve seen with sloppy code in long running JavaScript applications.
    • (24:31) Ward talks about the importance of good coding principles, especially the single responsibility principle. John says SRP is incredibly useful just about everywhere. Scott says he sees the same thing with testable JavaScript code.
  • Hello World and Hello World scenarios
    • (26:37) K Scott asks if there’s a hello world style application when you create a new Hot Towel application. John says there is, but it’s absolutely minimal so that it’s actually useable as a starting point for an application. There’s no database. Ward says Hot Towel has two simple pages with just enough code to get you started; use the other SPA templates to learn about the frameworks, then build your real app with Hot Towel – if you’re going with a Knockout-based UI.
    • (28:37) Scott K says he sees Knockout and Angular cluttering your HTML in ways that violate some of the principles discussed earlier. Ward that you can do both without declarative HTML binding if you want. There’s a discussion of convention based bindings; K Scott asks if the Caliburn.Micro convention based bindings are used in Hot Towel, Ward explains why it’s not done.
    • (31:40) John talks about some poor practices he sees in Knockout demos which just throw in some JavaScript code after the bindings rather than just using a click binding or using delegation.
    • (33:32) Scott asks if we’d have imagined 10 years ago that we’d be writing JavaScript code.
    • (33:54) Ward says the thing that blows his mind is that we’re talking about a ToDo list like it’s rocket science. There’s a description of the canonical sample scenarios. Jon proposes the Contoso SPA, Scott talks about how everyone was writing blog samples a few years ago.
    • (35:43) John explains that he wrote Hot Towel so that you could use it without having to rip out a bunch of demo code; Ward says it also completes the stack, providing IoC, screen management, etc. The price tag of restructuring around composed JavaScript libraries is a lot of small files, figuring out AMD, etc. John and Ward praise Durandal some more.
    • (38:52) Scott K says there’s still a tooling problem with lots of injected JavaScript files. Ward and John say they don’t see that as long as they keep things organized.
  • Getting started with SPA development
    • (40:27) K Scott asks for two things developers should do before getting started with SPAs. John says the first thing is to remember that you can apply your current good coding practices, the second is that you should treat the code as a real language and take advantage of patterns, especially the module pattern. Ward says use your intuition – if something smells bad, stop doing it and ask for help.
    • (43:03) John says don’t worry too much about which framework is the best, just pick one that feels natural. There’s a discussion of how the different frameworks have different feels, and you can just pick one and get started.
  • Did Silverlight development experience help?
    • (45:15) Jon says he first encountered a lot of these issues in Silverlight development. John says yes, and explains how his skills applied. Ward says he can’t comment on how it’d have been for him if he hadn’t used Silverlight, but that if you do have Silverlight experiences they’ll definitely apply. John talks about his experiences with Code Camper.
  • Can mere mortals create VSIX MVC templates?
    • (50:18) K Scott asks how difficult it was to create a VSIX based MVC template and if listeners could start with it. John says he waited for Ward to figure it and he copied Ward’s work, which wasn’t too bad. Ward explains what was difficult – mostly it comes down to poor documentation and duplicate references to files. He says he also hit issues with pulling in NuGet packages from multiple sources. Hot Towel is available as a NuGet package as well.
  • Randomness
    • (58:11) The customary discussion of Ward’s wardrobe occurs.
    • (1:00:00) John talks about his upcoming PluralSight courses. Ward says he’s excited that BreezeJS was selected as part of the SPA story for ASP.NET and that he and IdeaBlade are focused on helping people as they’re getting started with Single Page Application development. 

Show Links: