Tag Archives: herdingcode

Herding Code 183: Semantic Merge with Pablo Santos

The guys talk to Pablo Santos about Semantic Merge, a merge tool that understands your code.

Download / Listen: Herding Code 183: Semantic Merge with Pablo Santos

Show Notes:

  • Intro
    • (00:18) Semantic Merge is a diff tool with a semantic understanding of your code.
  • Language support
    • (01:01) Jon asks about what languages Semantic Merge supports. It currently supports C#, Visual Basic.NET and Java, and they’re currently working on adding support for C, then C++.
    • (02:00) Jon noticed that they’re using Roslyn and asks about that. Pablo says that it worked really well, handling the parsing to allow them to focus on the important things like diff calculation and semantic merge calculation
    • (03:02) Jon asks about support for JavaScript. Pablo says it’s still under development and there’s a lot of demand for it. Since JavaScript isn’t so tightly structured, they’re still working on figuring out how to come up with something really useful there.
    • (04:08) Jon asks about how they handle parsing outside of Roslyn and .NET. Pablo lists the different parsers they use for different languages. They’ve opened up the way that languages plug in, which allowed for a community contributed Delphi parser.
    • (5:33 Scott K. asks about support for Typescript, since it’s more strongly typed. Pablo says that’ll be easier, but they’re working through the language support list in order of demand.
  • What kind of semantics can Semantic Merge understand?
    • (06:28) K. Scott talks about what Semantic Merge does at a high level and asks about the different refactorings Semantic Merge can and can’t understand. Pablo explains a common scenario in which you’d be afraid to refactor code while adding or changing functionality if you know someone else is also working on it. Semantic Merge understands the refactorings so it’s easy to merge the actual changes. What Semantic Merge currently doesn’t handle is multi-file semantic merges, e.g. with code being refactored into another file. They’ve got a working prototype for that, but it’s harder to plug into different source control systems since they handle multi-file merges differently.
    • (08:52) Pablo points out that, while it’s called Semantic Merge, the diff functionality is really useful on its own.
  • The importance of graphical representation of merge issues
    • (09:17) Jon talks about how good the graphical representation is – both really easy to read and just generally nice looking. Pablo says they’ve put a lot of work into that and explains why they’ve designed it as they have.
    • (10:41) Scott K. says that developers are often stuck in a textual viewpoint for diff and merge, but a good graphical representation can be really useful. Pablo says that we’ve seen a recent revolution in source control tools, but we’re still using tools and technologies from twenty years ago. Jon says that the older ways of displaying diff and merge results with plus and minus lines was based on working with the old source control systems and mostly doing two-way merges.
    • (13:25) Pablo says it’s something that you really miss when it’s not there – big merges with lots of files look scary, but when you see that the actual changes are minimal it’s not such a big deal. Scott K. mentions a joke he saw on twitter about how a ten line code review finds ten issues, but a thousand line review passes easily.
    • (15:17) Jon asks how Semantic Merge has changed the way their team develops code, for instance by making them more ready to refactor code. Pablo gives an example with working on a year-old branch in which traditional diff gave him tons of merge conflicts but Semantic Merge only gave him one.
    • (17:19) Jon noticed that many of the samples were able to automatically merge everything and asks how Semantic Merge detects merge conflicts. Pablo explains how Semantic Merge not only is able to detect when changes don’t cause conflicts, but can also detect merge conflicts that other tools won’t find.
  • Version control integration
    • (19:36) Jon asks about which version control systems Semantic Merge integrates with. Pablo lists Git, Mercurial, TFS, Perforce, Sourcetree and Subversion and says that it’ll plug into just about anything because just about all version control systems use common conventions for diff / merge tool integration.
  • Platform support
    • (20:51) Jon asks about their recent Linux support and asks if that’s done using Xamarin and Mono. They use Mono for common backend code, but wrote native front-end code for Linux using Gtk#. They’re currently working on an OSX version using MonoMac, which gives it a true native front-end with a standard Mac look and feel.
  • Pricing model and free licenses
    • (22:52) Jon asks about the pricing model. There’s a 15 day free trial and a monthly subscription for $4/month. They wanted to experiment with pricing to make it so inexpensive that pricing wasn’t an issue. Jon asks if the subscription checking is complex. Pablo says it give you a lot of leeway so it won’t block you if you’re coding on a plane or something. They don’t obsess over security since it’s such an inexpensive application to begin with.
    • (25:36) Jon asks about their free licenses for open source developers. Pablo says they use Mono extensively and have been offering open source licenses for Plastic SCM for a while. Pablo mentions some of the open source projects using Semantic Merge, including F-Spot and a lot of other Mono projects.
  • Semantic based insights
    • (26:57) Jon asks they could use their information about semantic changes to source code over time to offer other insights to developers. Pablo says that this is something they’ve been doing with Plastic SCM with features like semantic method history, so you can track changes to a method over time across renames, refactoring to other files, etc. They also can offer richer metrics, so you don’t just see lines of code changed but can understand methods changed, refactorings, etc. Their goal for a long time has been to transform version control from a delivery mechanism to a productivity tool for developers.
  • Plastic SCM
    • (29:04) Jon asks how Plastic SCM compares to other version control systems. Pablo recommends going to PlasticSCM.com and look at the branch explorer. It’s as powerful as Git but very easy to use. It’s fully decentralized. It’s very graphical, and you can do almost everything from the branch explorer. It integrates well with enterprise security with support for things like ACL’s. It (of course) offers support for a lot advanced merge scenarios. It’s been under development since 2005, they’re in version 5 right now. It’s free for every team under 15 developers.
    • (31:25) Jon asks if there’s a way to test-drive Plastic SCM against an existing Git repository. Pablo explains how to do that without changing version control systems, since Plastic SCM can natively use the Git API.
    • (34:25) K. Scot asks about an old blog post about a small Windows Git application client; Pablo says that’s no longer required as it’s built into Plastic SCM.
  • Wrap up
    • (34:55) Jon asks about where listeners can find out more about Semantic Merge and Plastic SCM.
    • (35:50) Jon mentions that he really likes the team page on the Plastic SCM site – all the faces follow the mouse cursor as you move it around. He’s easily amused.

 

Show Links:

Herding Code 182: Durandal Kickstarter with Rob Eisenberg

The guys talk to Rob Eisenberg about the Durandal Kickstarter. This Kickstater ends on January 10, 2014, so go back it now!

Download / Listen:

Herding Code 182: Durandal Kickstarter with Rob Eisenberg

Show Notes:

  • Durandal overview
    • Quick overview of what Durandal is
    • How Durandal compares to other SPA frameworks
    • Durandal updates to date
  • Durandal Kickstarter
    • Timeframe
    • Contribution amounts and benefits
    • List of Kickstarter goals
    • How Kickstarter benefits relate to OSS release
  • Release goal
  • Tooling goal
  • Training goal
  • NextGen
    • Flexible modules
    • Web Components
    • Object.observe
    • Dependencies
    • Polyfills
  • Backer benefits

Show Links:

Herding Code 181: CouchDb, Cloudant, MyCouch and SisoDb with Max Thayer and Daniel Wertheim

The guys talk to Max Thayer and Daniel Wertheim about document databases, especially focusing on CouchDb and Cloudant’s cloud-hosted CouchDb offering.

Download / Listen:

Herding Code 181: CouchDb, Cloudant, MyCouch and SisoDb with Max Thayer and Daniel Wertheim"http://herdingcode.com/wp-content/uploads/HerdingCode-0181-CouchDb.mp3"

Show Notes:

  • Intro
    • (00:40) Jon says he heard about Daniel because of SisoDb, a document database running on top of SQL Server. Jon and Daniel talk about what SisoDb does and why it could be useful in a "SQL Server only" shop.
    • (01:55) Daniel introduced Jon to Max, who works as a developer evangelist at Cloudant and hacks on Node.js and CouchDb.
  • CouchDb and Cloudant basics, multi-master replication possibilities
    • (02:30) Jon asks Max what Cloudant does. Max says that Cloudant is a database as a service – a hosted, managed document database based on CouchDb.
    • (02:58) Max talks about multi-master replication and some of the implications, including PouchDb (which treats your browser as a CouchDb instance), and even running a node on your phone that you can replicate against. Jon’s mind is blown.
    • (04:30) Jon asks about the latency involved in using an HTTP database as a service. Max says that local caching helps, as well as having your database service physically close to your users (or app/web servers). Queries are always done against precomputed indexes, so query time is always logarithmic. Daniel says you can use replication to bring data as close as possible, and emphasizes the importance of in-application caching.
    • (06:38) Kevin says that there have been a lot of attempts at replication based systems over the years and asks what CouchDb does differently. Max says that the big difference is in the way CouchDb handles multi-version concurrency control by keeping revision trees. This lets them run a lockless system and investigate changes later. Daniel says that consistent hashing helps with this and explains the terms. Max talks about the use of revision numbers and conflict handling.
    • (09:08) Daniel says he likes that Cloudant adds clustering support, and he’s excited that Cloudant is contributing this back to CouchDb. Max says that they’ve also added a new administrative interface called Photon, which they’ll be contributing back.
    • (10:19) Daniel asks if this means that Big Couch is being deprecated. Max says yes, and Kevin asks for more information on what Big Couch is.
  • Migrating to CouchDb
    • (10:57) Jon asks about the migration path for applications using traditional RDBMSs to Cloudant or CouchDb. Max explains two options: the do it yourself option (uploading data as CSV’s or similar) or using the WEAVE@cloud service from CloudBees.
    • (14:13) Daniel asks about task of moving from traditional queries to map – reduce queries. Max talks about some of the migrations he’s been a part of, and talks about the use of Lucene queries as a bridge. Daniel says that in moving to document databases you really need to think differently about how you’ll consume the data, e.g. . Max talks about design documents, which store indexes, list functions.
    • (16:06) Jon says that when he started looking at document databases, he found that it was also helpful to store additional data in a way that it’s easy to query. Max gives an example using medical data in which you can normalize data as part of the map reduce process, so you rarely have to worry about schema. Daniel says that it’s the result of the map that’s being indexed. Max says that unlike some other systems like Hadoop that do the mapping in a batch, CouchDb updates indexes incrementally.
    • (18:42) Jon asks how CouchDb compares to Mongo. Max says he found Mongo to be a good transitional system from relational databases because the querying was similar, but it broke down at scale.
    • (19:50) Jon puts K Scott on the spot and asks how this strikes him due to his recent work with medical data on Mongo. K Scott says it’s good to know CouchDb is an option if they hit scaling issues.
    • (20:43) Jon asks about the process of migrating from Mongo to CouchDb. Max says he’s written a script that dumps data from JSON in Mongo to be imported into CouchDb. He says that on the surface, Mongo and CouchDb store data similarly so migrating data isn’t that hard – the real differences are in querying and locking.
  • Cloudant – features, pricing model, free account setup
    • (22:21) Jon asks how Cloudant compares to other database as a service offerings. Max lists some, and Daniel mentions Iris Couch. Daniel talks about how easy it is to get started with CouchDb on Windows, then migrate to Cloudant.
    • (24:12) Max talks about some of the features they’ve added recently, like Lucene queries and geographic querying. Max says that they contribute a lot to CouchDb.
    • (25:30) Jon asks how Cloudant integrates with the hosting providers they’ve got listed. Max says that they work to host Cloudant servers in the same datacenters as their hosting partners.
    • (27:05) Kevin asks how Cloudant charges. Max says that for dedicated clusters, it’s per-node and dependant on the hosting provider since they all charge differently. For multi-tenancy, it’s on a per-request and per-storage. Migrating between dedicated and multi-tenant is handled using the standard replication mechanism.
    • (27:39) Jon asks about the process of getting started with the free level. Max explains how it works and says they’ll only charge you if you exceed $5 per month, which is a good amount of use. Daniel says it takes less than 5 minutes to get started.
  • Client libraries and MyCouch
    • (29:03) Kevin asks if there are client libraries for most libraries. Max says there are, but most are just adapted from the CouchDb libraries.
    • (29:43) Daniel built MyCouch as a purely async library that doesn’t hide the domain knowledge of CouchDb. Jon asks about the overall flow of using the MyCouch NuGet package to get started. Daniel says he’s use Portable Class Library support to cover the different the different platforms.
    • (31:53) Jon asks about the Query.Configure interface to build a query.
    • (32:44) Jon asks about the history of Daniel’s interest in CouchDb and MyCouch.
  • Migrating from Cloudant to in-house CouchDb
    • (33:20) Kevin asks if Cloudant is a hosted version of CouchDb or a fork. Max says that currently it’s a fork, but they contribute a lot back.
    • (33:43) Kevin then asks about what would be required in bringing a Cloudant-hosted application back in-house to run under vanilla CouchDb. Max say that in addition to losing the managed / hosted value, you’d lose Lucene querying and (soon) the geo-indexing features. Daniel also points out Cloudant’s clustering support.
  • Questions from Twitter
    • (34:55) Rob Sullivan asks Daniel how working with SisoDb and CouchDb affect the way he views document databases and RDBMSs. Daniel says that he doesn’t want to see an ORM anymore and he’s noticed that a lot of people are creating hierarchical document structures in SQL Server when a document database would be a better fit. He says that there’s a little less safety in distributed document databases, and you just have to get used to working with that. Kevin asks about some of the application strategies people use to deal with that. Max says that CouchDb provides ACIDity at the document level, so as long as you wrap your transactions into a single document you’re fine. This leads to event sourcing, in which all your transactions are handled as separate documents.
    • (39:23) Steve Strong asks about the offline story to synchronize change changes to a web client. Max talks about PouchDb and how it works in web clients with intermittent data access.
    • (41:31) Jon asks if PouchDb and CouchDb could be used in peer-to-peer systems. Max says this is something he’s profoundly interested in. He’s done some conference talks about it and has a project called Quilter which is aimed at feature parity with Dropbox but with full user control, security and privacy by eliminating centralized network infrastructure. Daniel asks if it’s NSA-safe, and Max talks about how you can protect things using HTTPS and friend / reputation systems
  • Erlang
    • (46:13) Kevin asks what it’s like working with CouchDb’s code, since a lot of it’s written in Erlang. Max says that it’s built around building effective distributed systems since it incorporates fault handling. Daniel talks about the low memory footprint and Max talks about the ability to pass native Erlang messages over arbitrary protocols including HTTP.
    • (49:02) Jon asks where to learn more about Erlang. Max points out the book (available online) called Learn You Some Erlang For Great Good.
    • (49:44) Jon asks about what it’s like to integrate Erlang into parts of an application.
  • CouchDb vs. Mongo
    • (50:51) Kevin asks why Mongo gets more press than CouchDb. Max says that Mongo has a similar interface to traditional RDBMSs, but a lot of it’s just been a marketing victory. He talks about some unappreciated CouchDb advantages, like the fact that it’s got a built-in REST interface. He also says that CouchDb scales better than Mongo due to technical differences such as multi-version concurrency control. 

Show Links:

Herding Code 180: Visual Studio 2013 Web Tools, Web Essentials and Side Waffle with Mads Kristensen

The guys talk to Mads Kristensen about all the new web tools in Visual 2013, Web Essentials, Side Waffle and Web Dev Checklist.

Download / Listen:

Herding Code 180: Visual Studio 2013 Web Tools, Web Essentials and Side Waffle with Mads Kristensen

Show Notes:

  • Intro
    • (00:34) Mads works on the ASP.NET team building tools for everything that has to do with web development. He’s also done a lot of open source development – BlogEngine.NET, Web Essentials and some other Visual Studio extensions.
    • (01:25) Jon asks Mads to overview what’s new in Visual Studio. Visual Studio 2012 included a new JavaScript and CSS Editor, Visual Studio 2013 added Browser Link.
    • (02:48) Visual Studio 2013 has Browser Link, which allows you to connect any browser with Visual Studio. Any extension in the browser or Visual Studio can talk to each other via a web socket connection. The refresh browser feature in Visual Studio 2013 is just a proof of concept, the real feature is the communications channel.
    • (04:07) Scott K Asks about the Page Inspector feature and whether that would be integrated with Browser Link. Mads says that Page Inspector was introduced with Visual Studio 2012. It includes browser tools and source mapping which allow you to trace the markup back to what generated it, including C# code and server controls. Mads took over the Page Inspector team almost a year ago, and they’re using the same underlying engine. Right now you don’t get live updates in Page Inspector with Visual Studio 2013, but with the Web Essentials extension you will.
    • (07:19 Jon asks about how the source mapping works. Mads explains that the ASP.NET runtime injects a script tag at the end of your page, and Visual Studio is listening for it to connect on a localhost endpoint. Mads explains that the Browser Link connection is only made under specific conditions – running locally, in debug, etc.
    • (09:10) Jon asks about some of the recent extensions Mads has demonstrated, especially the example which tracks unused CSS class names. Mads says this has been a long requested feature, but it’s only possible to do this right from inside the browser. They’re now able to add smart tags into the CSS editor to show unused CSS classes. It’s available now using Visual Studio 2013 and Web Essentials.
    • (12:24) Scott K asks if it’s possible to see which classes are overriding others. Mads said it’s not there yet, but on the way.
    • (13:08) Jon asks about the process for creating an extension, and what parts are open source. Mads says that the project and item templates are open sourced. He explains the steps to create a Browser Link extension. The project template contains a C# file and a JavaScript file which are able to talk to each other. The Browser Link JavaScript contains an isolated copy of jQuery. In both the C# and JavaScript, you can call directly into the other side using simple Call methods.
    • (17:23) Scott K asks if they can hook up the model binder to allow deserializing more complex types. Mads says it’s not available yet, but on the way.
    • (18:00) Scott K asks if they’ve done any prototyping for unit testing automation, to allow running JavaScript testing frameworks like Jasmine with Visual Studio integration. Mads says it was part of his initial pitch for the Browser Link feature, but it hasn’t been implemented yet.
    • (19:04) Jon says they could also test performance using testing automation, and Mads says that they could do quite a bit more with performance and browser testing by working with browser extensions – Page Speed, SEO, accessibility, etc. They can call off to any service anywhere on the internet.
    • (21:10) Jon asks about some of the extensions and prototypes he’s worked on. Mads says he’s wrote an extension for LESS and CSS editors which updates the page as you type – without even requiring you to save the CSS document.
    • (23:50) Mads talks about the inspect mode extension. When you hit ctrl-alt-I in the browser, you can hover over any DOM element and see the source in Visual Studio (including controls, views, Master Pages, partials, etc.).
    • (25:35) Mad talks about design mode (ctrl-alt-d) which turns any DOM element into a content editable field, which allows you to type in the browser and change the server-side code. He talks about some complexities due to changing the server-side code which throws off the source mapping, and how when they make some future changes to allow updating source maps on the fly they’ll be able to allow pretty complex browser-based design and editing.
    • (29:35) Scott K asks if they could use the shadow DOM to allow updating the source maps. Mads says that wouldn’t work with older browsers, and there’s some discussion of legacy browser support.
    • (31:17) Scott K talks about a feature he liked in Brackets, which allowed viewing styles applied to a code fragment when editing HTML. He asks if he could get something like Visual Studio 2013 Code Lens to view the styles and navigate to the CSS. Mads talks about some of the complexities there, explaining how they inject ID’s into all elements and include the mapping in a JSON blob. Given an element ID, your JavaScript can look up the source file and range that corresponds to it on the server.
  • Web Essentials
    • (36:12) Mads talks about the history of Web Essentials. It started out in 2010, but the old Visual Studio HTML and CSS editors limited what he could do. He used Web Essentials as the test project to make sure that Visual Studio 2012 supported the extensibility API’s, then released a new version to correspond with Visual Studio 2013. He open sourced it at BUILD 2013 in June.
    • (37:36) Jon asks about how Mads migrates features from Web Essentials to Visual Studio. Mads says that he does this on every Visual Studio release (including updates) which allows him to delete a lot of code. There are some features which don’t get migrated – niche features, features for which they’re still testing out the user experience. He talks about some neat features in Web Essentials that he likes, but he doesn’t think enough people use to justify migrating.
    • (39:57) Jon asks about the language Web Essentials supports. Mads lists Markdown, LESS and Coffeescript. Mads talks about how they were able to include LESS and Coffeescript support from Web Essentials while waiting on the Visual Studio 2012.2 release, then removed it when that update shipped. He talks about the problems they hit due to the editor overlap. Mads said that situation caused him to change his philosophy on features to add in Web Essentials – he’ll no longer include features in Web Essentials which could cause a conflict with Visual Studio, especially compiler related features; that’s why he removed TypeScript support from Web Essentials.
    • (44:14) Jon mentions robots.txt support in Web Essentials. Mads explains that this is a great example of how his personal web development frustrations turn into Web Essentials features. He’s hoping that open sourcing Web Essentials will lead other developers to contribute as well.
  • Web Dev Checklist
    • (46:35) Jon asks about Web Dev Checklist. Mads and Sayed were both working on building out some sites last year, and they came up with a list of important checks for any website – performance, accessibility, SEO, etc. They got on Hacker News and were happy that their site held up well under the traffic.
  • Side Waffle
    • (49:16) Side Waffle is a Visual Studio extension which gives you a lot of templates so you can add things to your projects which were written the write way, by experts. They’ve got Angular controllers, Durandel, robots.txt, etc. They’re hoping for other developers to add new templates.
    • (51:36) Mads says that the teams at Visual Studio can’t create and maintain all the templates over time. Jon says he’s seen this again and again – new things get released but don’t always get maintained over the years. Mads says this makes it easy for developers to add and update templates.
    • (53:28) Mads says Sayed came up with the name from ordering a side order of waffles in a restaurant.
    • (54:24) Mads explains some of the technical complexities that he and Sayed had to deal with to allow adding new item templates to Visual Studio. Due to the strange ways they worked with MSBuild, Side Waffle isn’t allowed into the Visual Studio Gallery. They register Side Waffle as a Visual Studio gallery provider so when new templates are added, it will show up in the Visual Studio updates list. Jon’s confused, and Mads explains more about what’s going on.
  • Lightning Round questions from Twitter
    • (58:31) Barry Dorrans asks why Mads is pushing the #region agenda on unsuspecting HTML files.
    • (59:08) Warren Buckly asks “There is support for LESS, will there ever be support for SASS?”
    • (59:34) Jonas Eriksson asks Is it possible to extend the new HTML editor IntelliSense?”
    • (51:52) Jonas Eriksson asks if it’s possible to start a Grunt task and monitor its output.
    • (1:00:09) Saul asks how to create a static website in Visual Studio.
    • (1:01:07) Bret Ferrier asks about getting Angular IntelliSense with TypeScript.

Show Links:

Herding Code 179: xSockets with Uffe Bjorklund and Magnus Thor

K Scott and and Jon talk to  about Uffe Bjorklund and Magnus Thor about xSockets, a free framework for Web Socket and WebRTC communications.

Download / Listen:

Herding Code 179: xSockets with Uffe Bjorklund and Magnus Thor

Show Notes:

  • Intro
    • (00:30) Uffe and Magnus introduce themselves.
    • (00:50) K Scott asks about how xSockets got started, and what problem it solves.
    • (02:05) Jon asks if xSockets is a business or a project. Magnus says it’s now a full-time business – they’ve been working on xSockets for four years, but they’ve gone full-time earlier this year. Uffe points out that while it’s supported by a full time business, xSockets is free to use.
  • xSockets compared to SignalR, unique xSockets features
    • (02:57) K Scott asks how xSockets compares with SignalR. Magnus says they’ve been working on this for 4 years and mentions some differences. Uffe compliments the SignalR project and community, then points out that one important difference is that xSockets is stateful, whereas SignalR isn’t.
    • (04:54) Jon talks about the different approaches towards stateful controllers, and that it seems that stateful controllers could simplify things. Uffe describes some advantages, like filtering where you send messages dynamically with lambda expressions (a lot more control than groups in SignalR).
    • (06:10) Magnus talks about the JavaScript proxy in the xSockets which also is able to interact with state on the server.
    • (07:09) K Scott asks about other differences. Uffe says that xSockets is very portable – running on IIS, OWIN, Azure, Amazon, a Raspberry Pi, even your cellphone if you want. It runs on anything that runs .NET 4 or Mono, and they’ve had reports on it running a wide variety of hardware.
    • (07:52) Jon says he’s heard of people using local servers for desktop applications. Uffe says they have people in Russia doing that with xSockets.
    • (08:20) Magnus says that they have support for long-running controllers.
    • (08:50) Uffe says they’ve got a plugin framework. It was originally built on MEF, but they’ve recently rewritten it to remove the MEF dependency. You can drop an assembly in the xSockets  folder and it will be picked up. Jon says it looks pretty similar to MEF; Uffe says he loves MEF and kept it pretty similar.
    • (09:55) K Scott says it feels very similar to ASP.NET MVC, in that there’s a controller base class that you extend.
    • (11:00) K Scott asks if there’s a routing mechanism. Uffe describes the extension methods that allow sending messages as well as using the routing system.
    • 11:52 Jon says he noticed the generic controller which works as a message dispatcher. Uffe describes how it works as a smart dispatcher, which will only dispatch messages to people who are subscribed. This is useful to people who are familiar with JavaScript; they can do pretty advanced stuff without needing to write any server-side code.
    • (12:56) Magnus describes the channel system, which allows for some complex, private communications without requiring server-side code.
  • Web Sockets protocol
    • (14:02) K Scott remarks that the Web Sockets protocol has changed quite a bit over the years. Magnus says that it was very difficult earlier, but has stablilized.
    • (15:02) K Scott asks if there’s a test suite for Web Sockets available. Uffe says there are some, but all have problems. The xSockets team uses their own testing system.
    • (16:00) Jon asks if the Web Sockets API is difficult to use. Magnus says the two first versions were pretty easy, but the RFC introduced some more difficult concepts like control frames and continuous frames.  There are a lot of solutions on GitHub and CodePlex for dealing with protocol stuff.
  • Web RTC
    • (16:40) Jon asks about Web RTC support. Magnus says Web RTC enables realtime communications in the browser using peer-to-peer communication without requiring a server or middleman once the communications are established.
    • (18:47) K Scott asks if the Web RTC communications are TCP or UDP. Magnus says it’s UDP so it can be unreliable. There’s a NuGet package with a full sample showing how it works.
    • (20:00) K Scott asks about the processing pipeline. Uffe describes the Rewritable attribute – you can use that to override anything in the pipeline.
  • Fallback and pipeline
    • (21:05) Jon asks about fallback support for older browsers. Magnus says there’s long-polling support based on MVC; they’re going to replace that with a Web API based solution. Uffe says it’s easy to implement; just add a JavaScript reference. He also says there’s no MVC dependency in xSockets, so you can use it without MVC if you want.
  • External API
    • (22:25) K Scott asks about the external API. Uffe says it should probably called something clearer – it’s a client that can be used in any C# code, as well as PowerShell and even compiled stored procedures in SQL Server. Uffe describes some of the ways he’s seen it used.
  • Crazy things people have been doing with xSockets
    • (24:24) K Scott asks if there’s anything crazy they’ve seen people do with xSockets. Magnus talks about a microscope control system used in Jamaica. Uffe talks about a realtime water monitoring system in Dubai running in C# 2.0 on Windows CE. They’re now able to control the water system via a web page, which replaced the need for an entire water monitoring facility.
    • (27:32) Magnus talks about a Fruit Ninja like game using xSockets, HTML5 canvas and Kinect. That lead to a job building a virtual lobby, which they completed in 10 days.
    • (28:18) K Scott asks about authentication and authorization with xSockets.
  • Final questions, Samples and Videos
    • (29:08) K Scott takes a question from Twitter about what they think about OWIN. Magnus says they support it and it seems like a good idea, but he can’t
    • (29:42) K Scott asks about the While You Were Gone example. Uffe says this is a queue system that handles offline messages, so if you’re disconnected for a period of time it will deliver the messages when you reconnect.
    • (31:12) K Scott asks if there’s anything that may have been missed. Uffe talks about clustered servers – they’re all siblings which communicate peer-to-peer.
    • (32:48) Uffe talks about some upcoming travel they’ve got later this year for Desert Code Camp in November and possibly NDC London in December.
    • (33:22) Jon talks about the best way for people to get started. Magnus recommends the videos on xSockets.net.

Show Links:

Herding Code 178: Async, C# Syntax, AngularJS, Document Databases, Podcast Hosting, A New Job and Summer Vacations

The guys chat about Async, .

Download / Listen:

Herding Code 178: Async, C# Syntax, AngularJS, Document Databases, Podcast Hosting, A New Job and Summer Vacations

Show Notes:

  • Async: Our Generation’s Goto Statement?
    • (00:19) Jon introduces a listener question referring to .
    • (00:52) Kevin says he thinks the Callback Hell problem is overblown. In the Node world, there are flow control libraries like Async and good practices.
    • (01:51) Scott K agrees – using named rather than anonymous functions solves a lot of problems he sees. He asks if things would be better if everything was Async by default. Jon says he thinks Async-creep and Async by default push you down a better path most of the time. Kevin says since Node’s always forced that pattern it’s been simpler.
    • (04:40) Kevin says he Async / Await only address simple cases where you want a series of steps. Flow control libraries allow for more complex flow, parallel operations, etc. Jon talks about how multiple async operations can get complex pretty quickly – dealing with error conditions, timeouts, etc. and Scott K points out the difference between parallel processing and async.
  • C# Syntax and Xamarin Speculation
    • (07:42) Jon says there’s room for a lot more syntactic sugar in C# – not just async, but dynamics, chained null checking, etc. Jon and Scott K talk about the benefits and limitations of the null coalescing operator (??).
    • (10:50) Scott K says async may be the next TDD in terms of driving good design.
    • (11:47) Kevin wonders when Xamarin will cut the cord and begin innovating on C# separately from Microsoft. The guys discuss some of the things they’ve been doing – repl, SIMD support, etc., but Jon points out that it’s all innovation at the compiler level, not on the language. Scott K talks about how our recent interview with Jon McCoy talked about modifying IL, and wonders if Xamarin will get into doing that kind of thing. Kevin asks what benefit Xamarin gets from keeping compatibility with Microsoft. Jon doesn’t buy it.
    • (15:01) Scott K wonders if the C# spec or compiler were open enough that people could innovate on it. Jon thinks Roslyn could do that, but he’s just making stuff up.
  • AngularJS – K Scott’s impressions
    • (16:36) Jon asks K Scott about his recent experiences with Angular. K Scott says that most things are easy, but hard things get complex, so he’s been reading the source code. He says the source code is mind bending. There are a lot of different ways to accomplish something – binding, watching, raising events, etc. – and it’s hard to know what’s going to work.
    • (18:33) Jon refers to the Ember / Angular Cage Match at NDC and how Angular worked great until it was time for a directive, and that got trickier. K Scott says there’s room for some polish on the Angular API. For instance, there are 3 or 4 ways to register a service.
    • (19:40) Jon asks K Scott if he’s used Ember and how he’d compare them. K Scott says he’s invested Angular and hasn’t had time to dig into Ember. He says Ember seems to provide more of a path for users, whereas Angular seems more tacked together.
    • (21:02) Kevin asks how much people become locked into a front end framework. K Scott say
    • (22:00) Scott K says most of the complaints about Angular are around changes to the API and documentation over time.
    • (22:48) Scott K says it seems like Ember examples generally require more code. The guys discuss the balance of declarative code vs. magic that sometimes goes off the rails.
    • K Scott says he sometimes gets flashbacks to ASP.NET Web Forms controls. Kevin mentions HTCs in Internet Explorer and Jon says it seems like things are coming back around to that kind of thing with web components. K Scott says there are pretty good separation of concerns to directives, but directives can be really hard to extend – you want to tweak one thing and pretty soon you’re reimplementing a lot more than you wanted to.
  • Document Databases
    • (26:36) Jon says he got to use Redis on a project and talks about his experiences. K Scott’s been using Mongo for a hospital system. Kevin says he hears people complain about Mongo, K Scott says performance and diagnostics can be frustrating.
    • (28:53) Kevin’s used it for Greater Than Parts and at his new job. He says the biggest mind shift is in how you model things. Jon says that was the biggest thing he learned – it’s not just a pile of documents, you still need to model things. K Scott says migrations and configuration management are important.
    • (31:39) Kevin asks K Scott how they’re working with lack of transactional integrity. K Scott says fortunately not, everything’s bulk loaded in this application.
  • Kevin’s new job at Brandcast
    • (32:26) Jon asks Kevin about the new job. Kevin’s working at Brandcast. Their mission is to make it really easy for people to set up a web presence that works well on multiple devices without any technical background. It’s a small shop running Node and Backbone. Kevin’s gone from being the young guy at his old company to the old guy at the new job.
    • (33:47) Jon asks Kevin about the process and structure there. Kevin says there’s a test server, but they’re pretty aggressive with continuous deployment.
    • (34:39) Jon asks if they’re using frameworks on top of Backbone. Kevin’s used Marionette, They’re using Backbone Layout Manager and Supermodel.
  • HerdingCode.com Operations Report
    • (35:36) Jon gives an update on the Herding Code website and hosting setup. We’ve been running for over five years on an el cheapo WordPress account.
    • (37:00) Jon’s been using CloudFlare to do some front-end caching and security blocking.
    • (37:50) Jon talks about some of the security things he’s set up, including a plugin to lockout IPs after incorrect logins, long password and OpenID login.
    • (38:33) The new release of WordPress uses MediaElement.js to use HTML5 audio with Flash / Silverlight fallback, and Jon extended that using some JavaScirpt to show a play indicator in the browser tab when audio elements are playing.
    • (39:51) There’s a WordPress plugin to show a mobile friendly theme.
    • (40:50) Kevin says the times we’ve run into trouble have been CPU related. Jon talks about the different layers of caching – Cloudflare on the front end, W3 Total Cache on the backend.
    • (44:12) Scott K asks about what kind of value adds a podcast app could add, beyond just an audio player.
    • (45:58) Jon says that the only thing that does change on the site is comments, so he’s outsourced that to Disqus. Scott K and Kevin talk about how Disqus has been heading downhill by inserting stupid ads, or "climbing douchebag mountain" in Kevin’s words.
  • Summer Report
    • (49:30) Kevin asks what everyone’s done with their summers.
    • (49:37) Scott K had to update a Monorails site using the Brails engine. The biggest frustration was that in the latest rewrite, they pulled all the documentation and source for old versions – even the NuGet packages. Kevin says that’s why he’s not a fan of including package managers in deployment – things can disappear from the feed and you’re screwed. Jon tells an old story about a stored procedure that called a COM object to split comma delimited strings.
    • (53:42) Kevin got a new job and travelled to Paris and Switzerland and San Diego.
    • (54:02) Jon went to NDC, then worked on Scott Hanselman’s keynote demo at BUILD, then went on some family vacation time in New Jersey.
    • (55:21) K Scott worked a lot but says he’ll have exciting stories later. The guys congratulate him on all the press about his Pluralsight courses.

Show Links: