Category Archives: KCDC14

KCDC Notes: Second Day

There might have been 1100+ registered and attending on yesterday (Friday May 16), but there were far fewer in attendance today.  There were also fewer bodies among the exhibitors/sponsors/recruiters.  Still a bunch of great sessions.

First Session: Designing touch-first application UX

  • Speaker has been with MSFT for 10 years, used to be an engineer, now does UX
  • Three UX principles: Size, Posture, Interactivity
  • Size: the size of the UI element is inversely related to the error rate of successfully selecting the element. At 5mm the error rate is 1 in 10; at 7mm it’s 1 in 25; at 9mm it’s 1 in 100; at 11mm it’s 1 in 1000.
  • Posture: for a phone, you have to design with the assumption that someone is going to be using it with one hand.  The bigger the screen, the harder it is to reach the top of the screen… which is where back buttons tend to be.  Screenshot for easy, okay, hard for phones. Tablets are two-hand devices and people tend to hold it on the bottom in landscape fashion.
  • Small UI elements are not forbidden, but separation becomes more critical the smaller the UI items are.  The MSDN suggestion is 2mm separation.  The point is that for UI elements that are harder to select accurately you need to minimize hitting the wrong element, so put some separation so that a missed click hits dead pixels instead of another reactive UI element.
  • Regardless of phone or tablet form factor, if you have to change grip on the device to reach a UI element than your design needs improvement.
  • Interactivity: there is a BIG DIFFERENCE between “works for touch” and “designed for touch.” Example: clicking a checkbox on a list of items and then hitting a button to perform an action is the mouse-driven way of doing it; swiping a list item to the left or right to indicate archiving, deleting, etc is a more touch-natural way of doing it.
  • Pull to refresh is another example of touch-specific gestures (as opposed to clicking on a refresh button/element)
  • Q: Is the interaction fast and fluid?
  • Q: Is there feedback immediately after putting your finger down?
  • Q: Is there feedback during the entire time of the interaction?
  • Q: Is it possible to back out of the interaction?
  • If the function of a UI element isn’t obvious then your users won’t like it.
  • JS: hand.js >> polyfil for touch
  • CSS transforms and transitions: use them… client side hardware is fast!
  • Timer + feedback can be confusing: be sure it’s the right thing to do for the app because use of timer to change a UI element is non-obvious
  • If you do use the timer to alter a UI element, constant feedback is crucial to keep the user in a non-confused state (to the degree that’s possible in the first place)
  • Feedback should make it obvious when a gesture hits the threshold to activate the functionality as well as to validate when the user backed out of (cancelled) the action
  • “The first 20 times someone users your app they don’t know how the UI works.”
  • Q: Is there feedback on commit?
  • Q: Is the interaction learnable?

Second session: Making Rich Data Apps with BreezeJS

  • Speaker has been programming since VB1, Windows 3.1 (not 3.11, thank you)
  • Breeze supports Angular, Backbone, and Knockout
  • Manages and tracks data changes
  • Supports relationships (child/grandchild)
  • Allows linq-style queries
  • Installs from NuGet (there’s a trend to this…)
  • Supports offline data (this is the selling point to this, IMO)
  • Breeze needs the data metadata first — you need to have a metadata endpoint so that Breeze can hydrate it’s data model (this is getting less interesting now, IMO)
  • Register BreezePreStart: routing
  • HotTowel SPA: (uses Durandal, KC, Breeze, Toastr, MomentJS)
  • AutoMapper (install package AutoMapper — not NuGet?)
  • If nothing else: the quick overview of AutoMapper pulled this talk out of the crapper for me.  As soon as he said you have to provide a metadata endpoint I was less interested in this; I would rather define a model and use local storage than make a json call just for metadata.  The discussion of AutoMapper, however, was awesome.
  • q.js — promises library
  • logger.js — sounds interesting, requires more research.  Logging errors is a good use of browser-side data persistence.  By the time you’ve got an error you cannot rely on being able to ship the error details to the server.
  • This is yet another speaker who says “goo-id”

Third Session: Build an MVC eCommerce Site in 5 Minutes

  • Uhm… this schmuck is doing product placement for an open source eCommerce app which is about 18 months behind the technology curve.  Why not do a talk on DotNetNuke 1.0 (the VB.NET version?)
  • “Plugins for nopCommerce might not be functional” — and this was said about payment gateways!
  • EJECT!
  • At this point I left this session and headed over to the main ballroom where there was a round-table discussion about how to make KCDC15 more awesomer.

Fourth session: Service Patterns in AngularJS

  • Speaker literally said: “I literally spend most of my day doing…”
  • Angular components: Modules, Services, Controllers, Directives, Filters
  • Modules: the container for other components; these are not loaded async — you have to have require.js for that
  • Services: custom objects shared across the app. There are injectable singletons.
  • DI in JS: supports tesability; discourages global vars allows for complex config scenarios
  • $injector variable in Angular
  • Angular has its own caching component
  • Controllers: services are injected into controllers
  • Angular does not have a model framework (but Ember does!)
  • “Angular is a framework on which to build other frameworks” — that’s an interesting quote and one I want to research more… I can see this as being either good or bad depending on the scenario
  • Someone mentioned that Ember’s router is better than Angulars… I will discuss this Friday
  • ‘Twas mentioned several times that Angular 2.0 is likely to come out this year, and there will be LOTS of breaking changes to Angular current.  Sounds like Python 2.x/3.x to me: there is going to be parallel support to Angular 1.x (possibly a fork? OSSers are notorious for doing this) and development/extension of Angular 2.x.  Should be fun for all for the Angular True Believers!

Fifth session: Intro to Powershell

  • F7 gives a menu of previous commands
  • “standard command line commands” work in PS as aliases
  • Aliases: most linux shell commands are supported via aliaes
  • PS commands take the “verb-noun” pattern
  • “Get-command -noun service” will list out the cmdlets ending in -service
  • “Get-command -verb Get” like above but for cmdlets starting with “Get” — the point being that the concept of noun and verb is core to PS and you can search for cmdlets using this concept
  • Help is very useful
  • Interesting parameters: -Whatif (trial run) -Confirm -Verbose -Debug (can call into .NET code in debug mode using this param)
  • Everything in PS is an object
  • You can export to CSV
  • Get-PSProvider
  • “Get-Childitem -Recurse -File | {do stuff}” this will find all files in the current and descending directories and {do stuff} to it.  “Get-childitem” is aliased with “dir”
  • PoshGit PS + Git
  • ScriptCS: PS + CSharp
  • Chocolaty: PS + NuGet for windows app management

Sixth session: Pragmatic Software Development: Curing the Architecture Astronaut

  • Architectural astronauts speak in absolutes, are very sure they are right, and cannot be negotiated with
  • “Anyone can design a bridge that stands; it takes an engineer to design a bridge that barely stands.”
  • Be pragmatic: practical, sensible
  • Two goals: context and levels
  • Context: pragmatic, simplicity, timelines
  • Levels: contrast extremes, simple/complex
  • “For some people and teams, TDD is fast.”
  • I wanted to ask the speaker: What training tends to yield the best gains in productivity for a development team?
  • “We are paid to deliver solutions, not to write code per se.”
  • Parkinson’s Law: work expands to fill the available time.
  • Simplicity: the art of maximizing the work not done.
  • Recommended: Extreme Programming blog
  • Lean principles
  • Book recommendation: The Lean Startup
  • Minimum viable product
  • OutlierDevelopment.com (link doesn’t work… I mis-wrote it?)
  • Deadline sanity predicts… I didn’t copy all of that phrase down before he changed slides. Dangit!
  • In a small app: methods are layers.
  • Active Record Pattern: Objects saturate and persist themselves.
  • Book: Domain Driven Design — free at InfoQ, not free at Amazon
  • My comment on this talk: To the question of “Is it better to design quick and dirty versus properly enterprised and layered from the go” the answer is the former.  Consider Facebook: it was built and expanded quickly with PHP and MySQL. Once they became big and received venture funding, they hired hundreds of PhDs to mitigate the fact that they were based on PHP and MySQL.  Because they had succeeded they had this opportunity whereas if they spent the time to do it “enterprise perfect” they would still be in their Harvard dorm room writing EJB specs instead of rapidly building value.

KCDC Notes: First Day

Yesterday’s Precompiler conferences notwithstanding, today was the first full day of #KCDC14. It was announced that there were TWELVE HUNDRED attendees (which is why 3G was faster than WiFi almost all day).  My notes on the sessions I attended are as follows: First Session: MongoDB

  • In Mongo, “Database > Collections > Documents” is somewhat akin to “Database > Table > Row” in a relational database
  • Mongo’s javascript shell uses Google’s V8 engine
  • GridFS (I didn’t catch everything that was said about this feature, only that I need to look it up and learn more)
  • MMS (Mongo Monitering Service): free if you host from Mongo; paid to host it on your box
  • GeoJSON data supported
  • As of version 2.6.x full text search is on by default (you have to activate it on 2.4.x)
  • Aggregation framework: “like Map-Reduce but different” and uses a pipeline architecture
  • Disk-based sorting (is new as of 2.6.x?)
  • Safety: write safety (w) and journal protection (j) << gets into “eventual consistency”
  • DB.findOne() returns first item in “natural order” which can change
  • Something about mapping and nested DBObjects (I didn’t catch this all)
  • Pro tip on Mac: install MongoDB using “Brew install”
  • The presenter pronounces GUID as “goo-id” (like the dude yesterday)
  • Default config will assume production presets, which will seize 10% of your hard drive
  • I might have been seeing it incorrectly, but it looked like a newly provisioned database with one collection and two simplistic records was taking 78MB (0.078GB). Really?
  • No transactions in the DB — do that stuff in your code (or service bus!)
  • Doesn’t do fancy quotes (eg: MS Word copy & paste)
  • Document design: CONSIDER THE ACCESS PATTERN so you don’t screw yourself later
  • “Who is using Mongo and how” << read more at the Mongo website
  • MongoDB University (with code in Python, Java, and NodeJS)
  • Big Data Summit in KC in November (DST is to blame for this)

Second Session: Intro to iOS Development with Xamarin

  • Pricing is per platform — getting Xamarin.Android and Xamarin.IOS means you’re buying two licenses
  • C# 4.5 is supported (including awesomeness like async await)
  • Xamarin Studio has NuGet support (w00t!)
  • iBeacons
  • Monogame.net << based on XNA Studio
  • Pro tip: get a powerful MacBook Pro and use Parallels for a mobile Xamarin dev rig

Third Session: Web Performance Analysis with Free Tools

  • The presenter’s accent was a trip!
  • Main bottlenecks for websites: Latency, bandwidth, server processing, client rendering
  • Glimpse: get with NuGet (of course!) and activate it at /glimpse.axd
  • Can deploy glimpse in prod and lock down access by policy
  • Glimpse is extendable (and I presume there are OSS plugins)
  • sp_BlitzIndex: don’t ask — just d/l it, run it on your DB, and realize how inefficient stuff is
  • WebPageTest — brilliant tool!
  • Chrome Dev Tools; using Canary you get an early warning to what Google is going to break on your website. Of particular note is the timeline tool.
  • Page Speed (plugin for Chrome dev tools)
  • Other ideas: use a CDN, Optimize images (get: image optimizer VS extension)
  • VS Web Essentials: Mads deserves mad props for this
  • GIYF — there are more great tools on the interwebz

Lunch was… interesting.  No vegetarian option, really? Fourth Session: Windows Azure Mobile Services (This isn’t the session I wanted to attend, but I spent too long talking to one of the vendors and the session I wanted to attend — on Angular $scope — was filled to capacity.)

  • Aside from me and two co-workers, I presume everyone at this session meant to be here… so why is the presenter making such a sales push for Azure?
  • Microsoft App Studio: learning about this was worth stumbling into this session by accident!

Fifth Session: Intro to Google Dart

After the Dart session I joined in on a discussion about Xamarin when getting a seat in the room for the next session. Practical advice: follow Paul Betts on twitter if you’re into Xamarin. Sixth Session: Delivering Push Notifications with Microsoft Notifications Hub

  • Memo to DPEs at conferences: if I’m in your session don’t pull a hard-sell on me. Just explain the merits of MSFT’s product and treat me like an adult capable of making a rational decision.
  • Notifications hubs on Service Bus: these look awesome from the perspective of feeding one notifications queue and getting the messages delivered to every mobile platform under the Sun.  Forget IoC: just make Azure do the delivery to each platform you support and your code only needs to be able to support Azure’s message bus
  • Another memo to DPEs: you aren’t funny… don’t try to be. ScottHa is the exception.
  • Microsoft.WindowsAzure.Messaging for push notifications (get it via NuGet — are we getting the trend regarding NuGet?)

Sixth and last session of the day: WebAPI 2: Beyond the basics

  • This presenter, Matt Milner, was awesome! On the merits of this presentation alone I’m going to get my own Pluralsight subscription (assuming I can’t talk my boss into getting the team subscription within a week)
  • Key new features in WebAPI:
  • OWIN (use NuGet — duh!)
  • AuthOptions (eg: Twitter, Google, etc.. or regular aspnet auth stuff. Or roll your own)
  • CORS (you can allow cross-site script requests to your API — ftw!)
  • Help Pages / API Explorer — your integration partners will love this!
  • Attribute Routing (define on the control or method; Routes.IgnoreRoute() wins!)
  • Global Error Handling (Add: ExceptionLogger; Replace: ExceptionHandler)
  • IHttpActionResult (can you say “unit testing”?)
  • HttpRequestContext (we didn’t really get to this)
  • OData features (we certainly didn’t get to this… but it rocks apparently. GIYF)

KCDC Precompiler

Last fall I attended Iowa Code Camp.  I took lots of notes but those notes were on paper and I never transferred them to a medium I could access at work.  Knowing how much I wished I had access to my notes while at work I decided that I’m going to transfer my notes from KCDC 2014 to a series of blog posts… this way I can look back at them later and do more research.

Today’s session was a “precompiler” session — an all-day training session before the conference starts in earnest — at KCDC 2014. The nominal topic was “building powerful web apps with ASPNET MVC, Bootstrap, Angular, and more” and in my estimation, “and more” was an understatement.  I was expecting this to be mainly an Angular presentation, which is why my team lead and I elected to attend this session.  To my delight, much more than just angular was covered.  I am not sure if my team lead thought this was a value add but she seemed to like the content.

  • Service bus architecture: powerful and under-utilized (azure, nservice bus, rabbitmq)
  • Speaker is a BIG believer in nosql, especially MongoDB
  • Check out www.mongolab.com for hosted mongodb
  • Speaker is a big believer in cloud based services (like Harvest for time entry)
  • Prediction: “You won’t be working with DBAs in the future.”
  • MongoVUE — sort of like SSMS for MongoDB
  • Use NuGet to pull the official mongodb driver into your .NET application
  • Don’t check in your NuGet packages to source control: grab them via nuget and compile
  • MongoDB: speed of read/write trumps increased storage space requirements
  • [BsonID(IDGenerator = typeof(CombGuidGenerator))]  attribute for specifying a BSON guid on a field in code
  • There are tons of ID generators for Mongo — check out mongo docs for more info
  • Site to love: FakeNameGenerator
  • mms.mongodb.com — monitoring dashboard for mongodb, “better than perfmon”
  • “Eventually Consistent” was a common theme for today
  • Visual Studio Online: Pro license is apparently $22/month (where is this link?)
  • Azure Console Host for long-running processes
  • Raygun.io: exception error tracking; Balsamiq UI mocking
  • CC payments: Stripe and Braintree
  • SERVICE BUS, SERVICE BUS, SERVICE BUS!!!
  • Azure architecture: worker role “back end” servers and web front-end servers. Do AS LITTLE AS POSSIBLE on the web servers; make the worker role servers do as much as possible, with a service bus between them.
  • MVC ActionResult: use “return Json(object);” to make a JSON api w/o WebAPI
  • Dev/Prod routing: Prod: cname.example.com/{url}  Dev: localhost:{port}/cname/{url} — switching between the two is a matter of routing specs (possibly web.config transforms also?)
  • [JsonException] — return that on an error… I didn’t take good notes on this point
  • Autofac: DI container of choice for MVC since it has handy hooks esp for MVC
  • Check the wiki on/via github for more Autofac info
  • Angular is about DIRECTIVES!
  • iirc: jsarray.splice(index,1) will remove the index element from an array in JS
  • (Lunch happened here)
  • ng-cloak — seems hackish but it works… play with it
  • Batarang: AngularJS plugin for Chrome Dev tools
  • JS testing: Jasmine & Chutzpah — know it, learn it, love it
  • JS promises — seriously: learn this! (NG uses $q library for this iirc)
  • ng-promises: .success({}).error({}).finally({ /* bIsLoading = false; */});
  • Json.net — read about it here, get it via NuGet
  • Security for MVC API: use Forms Auth or OAuth (eg: twitter, FB)
  • Morris Charts are awesome — use them (better: wrap as directives)
  • ng-grid — one of many great 3rd party controls for Angular
  • Angular Bootstrap: angular wrapper for twitter’s gift to non-designers
  • NG-google-maps FTW!
  • Themes: TheMeForest.com, Template Monster, etc — GIYF
  • Browserstack: test it or regret it.
  • Plunkr: looks like jsfiddle to me… am I missing something?
  • Noty and Toastr — great notification plugins (unless you want to roll your own)
  • Service Bus: it’s a queue (a sort of database in a sense)
  • “Windows Azure Service Bus” << get it using NuGet
  • SignalR: seriously cool… and get it via NuGet

These are my notes — I’ll be posting tomorrow and Saturday’s notes next week, most likely.