magazine
THE MICROSOFT JOURNAL FOR DEVELOPERS
DECEMBER 2015 VOL 30 NO 13
Modern Tools for Web Development:
Grunt and Gulp
Adam Tuliper .................................................................................14
Azure Service Fabric and the
Microservices Architecture
Cesar de la Torre, Kunal Deep Singh and Vaclav Turecek .........22
Babylon.js: Building a Basic Game
for the Web
Raanan Weber ...............................................................................36
Build a Cross-Platform UX
with Xamarin.Forms
Keith Pijanowski ............................................................................50
How Azure, Web API and Redis Helped
Deliver Data Faster
Sean Iannuzzi .................................................................................58
COLUMNS
UPSTART
The Long Game
Krishnan Rangachari, page 6
DATA POINTS
Aurelia Meets DocumentDB:
A Matchmaker’s Journey, Part 2
Julie Lerman, page 8
TEST RUN
Introduction to Spark
for .NET Developers
James McCaffrey, page 64
THE WORKING
PROGRAMMER
How To Be MEAN: Express Input
Ted Neward, page 70
ESSENTIAL .NET
Designing C# 7
Mark Michaelis, page 74
MODERN APPS
What You Need to Know About
Windows 10 App Development
Rachel Appel, page 77
DON’T GET ME STARTED
Refactoring Higher Education
David Platt, page 80
JavaScript Task Runners
for Web Development.......14
1215msdn_C1_v3.indd 1 11/9/15 11:49 AM
msdn magazine
2
ID STATEMENT MSDN Magazine (ISSN 1528-4859) is
published monthly by 1105 Media, Inc., 9201 Oakdale
Avenue, Ste. 101, Chatsworth, CA 91311. Periodicals
postage paid at Chatsworth, CA 91311-9998, and at
additional mailing ofces. Annual subscription rates
payable in US funds are: U.S. $35.00, International
$60.00. Annual digital subscription rates payable in
U.S. funds are: U.S. $25.00, International $25.00. Single
copies/back issues: U.S. $10, all others $12. Send orders
with payment to: MSDN Magazine, P.O. Box 3167, Carol
Stream, IL 60132, email MSDNmag@1105service.com
or call (847) 763-9560. POSTMASTER: Send address
changes to MSDN Magazine, P.O. Box 2166, Skokie,
IL 60076. Canada Publications Mail Agreement No:
40612608. Return Undeliverable Canadian Addresses
to Circulation Dept. or XPO Returns: P.O. Box 201,
Richmond Hill, ON L4B 4R5, Canada.
Printed in the U.S.A. Reproductions in whole or part
prohibited except by written permission. Mail requests
to “Permissions Editor,” c/o MSDN Magazine, 4 Venture,
Suite 150, Irvine, CA 92618.
LEGAL DISCLAIMER The information in this magazine
has not undergone any formal testing by 1105 Media,
Inc. and is distributed without any warranty expressed
or implied. Implementation or use of any information
contained herein is the reader’s sole responsibility. While
the information has been reviewed for accuracy, there
is no guarantee that the same or similar results may be
achieved in all environments. Technical inaccuracies may
result from printing errors and/or new developments
in the industry.
CORPORATE ADDRESS 1105 Media, 9201 Oakdale Ave.
Ste 101, Chatsworth, CA 91311 www.1105media.com
MEDIA KITS Direct your Media Kit requests to Chief
Revenue Ofcer Dan LaBianca, 972-687-6702 (phone),
972-687-6799 (fax), dlabianca@1105media.com
REPRINTS For single article reprints (in minimum
quantities of 250-500), e-prints, plaques and posters
contact: PARS International Phone: 212-221-9595.
E-mail: 1105reprints@parsintl.com.
www.magreprints.com/QuickQuote.asp
LIST RENTAL This publication’s subscriber list, as well as
other lists from 1105 Media, Inc., is available for rental.
For more information, please contact our list manager,
Jane Long, Merit Direct. Phone: 913-685-1301;
E-mail: jlong@meritdirect.com;
Web: www.meritdirect.com/1105
Reaching the Staff
Staff may be reached via e-mail, telephone, fax, or mail.
A list of editors and contact information is also available
online at Redmondmag.com.
E-mail: To e-mail any member of the staff, please use the
following form: FirstinitialLastname@1105media.com
Irvine Ofce (weekdays, 9:00 a.m. – 5:00 p.m. PT)
Telephone 949-265-1520; Fax 949-265-1528
4 Venture, Suite 150, Irvine, CA 92618
Corporate Ofce (weekdays, 8:30 a.m. – 5:30 p.m. PT)
Telephone 818-814-5200; Fax 818-734-1522
9201 Oakdale Avenue, Suite 101, Chatsworth, CA 91311
The opinions expressed within the articles and other
contentsherein do not necessarily express those of
the publisher.
President
Henry Allain
Chief Revenue Ofcer
Dan LaBianca
Chief Marketing Ofcer
Carmel McDonagh
ART STAFF
Creative Director Jeffrey Langkau
Associate Creative Director Scott Rovin
Senior Art Director Deirdre Hoffman
Art Director Michele Singh
Assistant Art Director Dragutin Cvijanovic
Graphic Designer Erin Horlacher
Senior Graphic Designer Alan Tao
Senior Web Designer Martin Peace
PRODUCTION STAFF
Director, Print Production David Seymour
Print Production Coordinator Anna Lyn Bayaua
ADVERTISING AND SALES
Chief Revenue Ofcer Dan LaBianca
Regional Sales Manager Christopher Kourtoglou
Account Executive Caroline Stover
Advertising Sales Associate Tanya Egenolf
ONLINE/DIGITAL MEDIA
Vice President, Digital Strategy Becky Nagel
Senior Site Producer, News Kurt Mackie
Senior Site Producer Gladys Rama
Site Producer Chris Paoli
Site Producer, News David Ramel
Director, Site Administration Shane Lee
Site Administrator Biswarup Bhattacharjee
Front-End Developer Anya Smolinski
Junior Front-End Developer Casey Rysavy
Executive Producer, New Media Michael Domingo
Ofce Manager & Site Assoc. James Bowling
LEAD SERVICES
Vice President, Lead Services Michele Imgrund
Senior Director, Audience Development
& Data Procurement Annette Levee
Director, Audience Development
& Lead Generation Marketing Irene Fincher
Director, Client Services & Webinar
Production Tracy Cook
Director, Lead Generation Marketing Eric Yoshizuru
Director, Custom Assets & Client Services
Mallory Bundy
Editorial Director, Custom Content Lee Pender
Senior Program Manager, Client Services
& Webinar Production Chris Flack
Project Manager, Lead Generation Marketing
Mahal Ramos
Coordinator, Lead Generation Marketing
Obum Ukabam
MARKETING
Chief Marketing Ofcer Carmel McDonagh
Vice President, Marketing Emily Jacobs
Senior Manager, Marketing Christopher Morales
Marketing Coordinator Alicia Chew
Marketing & Editorial Assistant Dana Friedman
ENTERPRISE COMPUTING GROUP EVENTS
Senior Director, Events Brent Sutton
Senior Director, Operations Sara Ross
Director, Event Marketing Merikay Marzoni
Events Sponsorship Sales Danna Vedder
Senior Manager, Events Danielle Potts
Coordinator, Event Marketing Michelle Cheng
Coordinator, Event Marketing Chantelle Wallace
Chief Executive Ofcer
Rajeev Kapur
Chief Operating Ofcer
Henry Allain
Senior Vice President & Chief Financial Ofcer
Richard Vitale
Executive Vice President
Michael J. Valenti
Vice President, Information Technology
& Application Development
Erik A. Lindgren
Chairman of the Board
Jeffrey S. Klein
General Manager Jeff Sandquist
Director Dan Fernandez
Editorial Director Mohammad Al-Sabt mmeditor@microsoft.com
Site Manager Kent Sharkey
Editorial Director, Enterprise Computing Group Scott Bekker
Editor in Chief Michael Desmond
Features Editor Sharon Terdeman
Features Editor Ed Zintel
Group Managing Editor Wendy Hernandez
Senior Contributing Editor Dr. James McCaffrey
Contributing Editors Rachel Appel, Dino Esposito, Kenny Kerr, Julie Lerman, Ted Neward,
David S. Platt, Bruno Terkaly, Ricardo Villalobos
Vice President, Art and Brand Design Scott Shultz
Art Director Joshua Gould
DECEMBER 2015
VOLUME
30
NUMBER
13
magazine
1215msdn_Masthead_v1_2.indd 2 11/9/15 8:34 AM
msdn magazine
4
ey say things happen in threes. at’s been the case here at MSDN
Magazine, where we’ve seen three big changes to our columnist
lineup over the past month.
Things got started in November, when we welcomed Mark
Michaelis on board as author of our new Essential .NET column,
which focuses on C# and .NET Framework development issues and
challenges. en we learned that Modern Apps columnist Rachel
Appel was returning to work at Microso and would no longer have
time to write her column. Frank La Vigne—a Microso technical
evangelist and an occasional MSDN Magazine author in his own
right—will be helming Modern Apps starting in the January issue.
e third shakeup in our trifecta? Kenny Kerr, author of the
long-running Windows with C++ column and a guy who has been
working with MSDN Magazine going back to 2004, is ending his
tenure as a columnist. Like Appel, Kerr has accepted a position at
Microso, joining the Windows Engineering team to help produce
a new Windows Runtime language projection for Standard C++.
Kerr has been manning an important ank here at MSDN Magazine,
providing expert coverage of C++ programming. While most of
our readership is committed to C# development (fully 70 percent
identied C# as their primary programming language in our latest
reader poll), C++ remains the primary language of 10 percent
of MSDN Magazine subscribers. at makes it the second-most
engaged programming language among readers.
Over the years, Kerr has written some of the most-widely read
columns in the magazine. His piece, “e Evolution of reads and
I/O in Windows” (msdn.com/magazine/jj883951), in January 2013 was
the h-most-viewed column we’ve published over the past ve
years, based on rst-month trac. Two other columns, “A Modern
C++ Library for DirectX Programming” (
msdn.com/magazine/dn201741
)
and “Using Regular Expressions with Modern C++” (msdn.com/
magazine/dn519920
), placed 12th and 14th, respectively, out of more
than 450 total published columns over the time period. Not bad
for a column that should appeal to, at most, 10 percent of readers.
Kerr’s favorite MSDN Magazine article, however, isn’t one of his
columns. It’s the feature he wrote for the MSDN Magazine 2014 spe-
cial issue on Visual Studio 2015 and Microso Azure, “Visual C++
2015 Brings Modern C++ to the Windows API” (
msdn.com/magazine/
dn879357). Based on the Implements class template he wrote for
Microso, it’s Kerr’s single-most-visited article going back to 2009.
“Implements is a variadic class template that implements IUnknown
and IInspectable entirely with modern C++ metaprogramming tech-
niques, rather than traditional macro-heavy approaches popularized
by ATL,” Kerr says. “It was the rst time I had written anything useful
with variadic templates and proved to be quite novel and very eec-
tive. It is coincidentally one of the foundational metaprogramming
constructs in Modern C++ for the Windows Runtime.”
Can you tell that we’re going to miss Kerr around here? ere is a
bit of good news to report: Kerr plans to return to our pages, writing
the occasional C++-themed feature. And as Kerr puts it, our readers
aren’t the only ones who benet from his articles.
“ere is simply no better way for me to truly understand some
technology, language or technique than to have to try to explain it
to someone else,” Kerr says. “I hope developers have beneted from
my content, but I suspect I beneted the most.”
On the contrary. We’ve been fortunate to have you here for so long.
Goodbye, Kenny
© 2015 Microsoft Corporation. All rights reserved.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, you are not permitted to reproduce, store, or introduce into a retrieval system MSDN Magazine or any part of MSDN
Magazine. If you have purchased or have otherwise properly acquired a copy of MSDN Magazine in paper format, you are permitted to physically transfer this paper copy in unmodied form. Otherwise, you are not permitted to transmit
copies of MSDN Magazine (or any part of MSDN Magazine) in any form or by any means without the express written permission of Microsoft Corporation.
A listing of Microsoft Corporation trademarks can be found at microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx. Other trademarks or trade names mentioned herein are the property of their respective owners.
MSDN Magazine is published by 1105 Media, Inc. 1105 Media, Inc. is an independent company not afliated with Microsoft Corporation. Microsoft Corporation is solely responsible for the editorial contents of this magazine. The
recommendations and technical guidelines in MSDN Magazine are based on specic environments and congurations. These recommendations or guidelines may not apply to dissimilar congurations. Microsoft Corporation does not make
any representation or warranty, express or implied, with respect to any code or other information herein and disclaims any liability whatsoever for any use of such code or other information. MSDN Magazine, MSDN and Microsoft logos are
used by 1105 Media, Inc. under license from owner.
Visit us at msdn.microsoft.com/magazine. Questions, comments or suggestions for MSDN Magazine? Send them to the editor: mmeditor@microsoft.com.
MICHAEL DESMOND
Editor’s NotE
Kerr has been manning an
important ank here at MSDN
Magazine, providing expert
coverage of C++ programming.
1215msdn_DesmondEdNote_v2_4.indd 4 11/9/15 8:40 AM
msdn magazine
6
Early in my career, I tried compulsively to nd my “passion.” At
first, this passion was coding, until the novelty wore off and my
responsibilities grew challenging. I interpreted this unpleasantness
to mean my passion lay elsewhere. Over the coming years I switched
roles, companies and industries repeatedly, sometimes back and
forth. I read innumerable books on careers, took personality tests,
spoke to career counselors and interviewed non-stop.
I’d start a new job, fall in love with it, conclude I’d nally found
my passion, then (eventually) get bored and switch again.
In retrospect, I’d made discomfort a problem to be xed, not a
stage through which to pass. I realized that my repetitive cycles had
only one common denominator (me), and no matter what I xed,
I was eventually unhappy again. I was “passion hunting.” I’d imag-
ined a career with no diculties and a workplace of unending joy,
and when reality conicted with my fantasy, I’d bolt!
If I wanted a change in my environment to make me happy,
I was avoiding taking full responsibility for my own future. For
example, I believed that by switching to a start-up, I’d improve my
social life because I’d have younger coworkers and develop more
friendships. Alas, that was a way for me to avoid working on my
own social fears. Instead of facing my character diculties head-on,
I was blaming the company I worked for!
Today, instead of seeking a hit from “doing what I love,” I abide
in the possibility that I’m already there. Finding my passion isn’t a
one-time event, it’s not even a one-job or one-career event—it’s a
lifelong process of self development by “loving what I do.”
I’ve given myself permission to have dierent careers and jobs
over time. When I see my career choices as all-or-nothing, make-
it-or-break-it moments, I burden myself emotionally and allow
zero room for error. At work, I set a loftier goal not focused on
myself—say, to serve my customers and coworkers—independent
of whatever role or industry I’m in. If I make any changes along the
way, I’m not accepting defeat; I’m just growing.
Enthusiasm Overload
In one of my rst jobs, I quickly burned out from working 60- to
80-hour weeks. I worked myself to such numbness that I could
recover only by quitting altogether. I wasted months in a haze of
helpless unproductivity, as my body attempted to recover from the
intensity of years of overwork.
I had dened myself by my own assumptions about what it meant
to be a Real Programmer. I’d heard of start-up execs who wouldn’t
go home for days, and engineers who’d ignore their families, only
to achieve grand IPOs years later. I saw anything less than such
commitment as a failure.
Over time, I healed the burnout by not looking to work as my
only savior. Today, I go to spiritual retreats, cultivate hobbies, take
self-development classes, develop close relationships, journal,
mentor, get mentored, spend time in nature, take naps, meditate,
read and hike. Each of these lls a need that work by itself can’t ll.
I also look to early indicators (for example, getting angry at loved
ones, zoning out or feeling down) as reminders for me to take a
“gentleness break.” I initially felt self-conscious in taking care of
myself—leaving work on time, not working on weekends or evenings,
or removing work IM from my phone—because I was surrounded
by so many coworkers who didn’t engage in self-care.
As I’ve seen positive results—peace and joy, promotions and
rewards, productivity—I realize I’m playing the long game, not just
for work but for all areas of my life. When I take care of myself and
avoid burnout, I’m just recharging so that I can make better, more
consistent contributions—to work, family and friends—for the
next six decades, not just for the next six months. n
K
rishnan
r
angac h ari
is a career coach for the tech industry. He is one of
the youngest-ever graduates of UC Berkeley. At age 18, he joined Microsoft
full-time, and by age 20, he became the fastest-promoted employee in his division.
Rangachari has worked in senior development and product roles for many tech
rms. Visit radicalshis.com to get his free career success kit.
The Long Game
Upstart
KRISHNAN RANGACHARI
I was “passion hunting.”
I’d imagined a career with no
difculties and a workplace of
unending joy, and when reality
conicted with my fantasy,
I’d bolt!
1215msdn_RangachariUpstart_v5_6.indd 6 11/9/15 8:47 AM