February 2016

Volume 31 Number 2

[Editor's Note]

MEAN Streak

By Michael Desmond | February 2016

Michael DesmondIf you’ve been reading MSDN Magazine, you know Ted Neward. He’s been a regular in our pages going back to 2008, writing The Polyglot Programmer and then The Working Programmer columns. Over the years, he’s covered everything from SQL and NoSQL databases and C# tips and tricks, to the dangers of rigid programming methodologies. Through it all, Neward has applied his trademark wit and irreverence.

For the past several months, Neward has been writing about MongoDB, Express, AngularJS and Node.js—collectively known as the MEAN stack. The Node.js platform and the MEAN stack built around it have quickly earned a strong following among JavaScript developers, and with Microsoft supporting both Node.js and MongoDB on Microsoft Azure, it has emerged as a solid option for Visual Studio developers, as well. You can read this month’s column on using the MongoDB database at msdn.com/magazine/mt632276, and be sure to check out the opening column in the series at msdn.com/magazine/mt185576.

I caught up with Neward and asked him about his ongoing MEAN development series, and what motivated him to cover the topic in depth. Of course, the growing popularity of MEAN development was a factor, but he says he was drawn to the stack because Node developers tend to approach problems in ways that are “fundamentally different” from seasoned .NET programmers.

“MEAN has some interesting ideas to it, and I think it’s a useful tool to have in your tool belt, but I think the more important thing to realize is that MEAN is just an approach and a pre-defined set of architectural ‘pieces,’” Neward says. “It’s just as reasonable to have a Mongo + Web API + AngularJS + C# stack, or a DocumentDB + Web API + AngularJS + C# stack.”

In writing about the MEAN stack, Neward says he’s learned plenty, including a bit about npm and package.json, about the workings of the require method, and about the behavior of callbacks. (He warns that callbacks do not execute serially, despite how things appear when working in the editor.) So what advice does Neward have for developers considering a move to MEAN? In a phrase, look out for gotchas.

“The biggest advice I have for developers is to make sure they’re comfortable with JavaScript and the callback-based nature of Node.js. There’s a lot of subtleties involved when the flow of execution doesn’t quite behave the way the code on the page implies it will,” he says, adding that even with JavaScript fixes being made, “certain code idioms will linger for years to come.”

Neward isn’t done with MEAN yet. Readers can look forward to explorations into the Angular framework, replacing MongoDB in the stack with DocumentDB, and using Edge.js to access .NET-specific resources from Node.js. As Neward notes, “There’s a lot left to explore here.”

Are there specific aspects of the MEAN stack you would like to see Neward explore in his series? E-mail him at ted@tedneward.com.


Michael Desmond is the Editor-in-Chief of MSDN Magazine.