Tim Murphy's .NET Software Architecture Blog

April 2016 Entries

IDEs For Developing Node.js In A Windows Environment

Node.js has become one of the most predominant JavaScript based solution frameworks over the last couple of years.  As with most ideas that start in the open source community it has crept its way into the Microsoft based platforms.  For those of us who make our living in the Windows ecosystem it is beneficial to know what tools are available to add Node.js components to our solution landscape.

This post will briefly introduce four of the development environments to build Node.js projects on the Windows platform.  These include DOS command line, VS Code, WebMatrix and Node.js tools for Visual Studio.

Command Line

image

As with most development, the solution with the fewest bells and whistles has the most power.  You can simply download the Node.js base from nodejs.org.  This will supply you with all the basic components including a Node.js command window.  At that point you can use npm to pull down what ever packages you wish to leverage and use your favorite text editor to develop solutions.

VS Code

One step up from command line is Visual Studio Code.  This is a tool that Microsoft built in response to the portion of the development community who prefer a minimalist solution where you pick every feature you want to include in your code explicitly.  Since it is a very file based/folder based tool there is no native support for managing associated resources such as modules that you want to include in your Node.js package.  In many cases you still need to leverage the command line in order to perform operations such as adding modules.

image

You can open an existing Node.js folder and effectively maintain your application.  There are several VS Code Extensions available to help with the out of the box deficiencies and more are being added all the time.

WebMatrix

With WebMatrix you add the ability to start from a project template. You still won’t have the capability out of the box to add new Node packages.  In theory this should be overcome by simply installing the NPM Gallery extension, but when I tried it there were bugs that prevented retrieving any new packages.

image

On another cautionary note, I have found that WebMatrix can have unpredictable problems where sometimes Node.js code that will work in other tools will have random results.  I’m not sure if this is a result of my environment or the WebMatrix hosting model, but buyer beware.

Node.js Tools for Visual Studio

Visual Studio is the envy of all other development platforms so it is to be expected that it is the best development experience for the Windows platform.  You have all your favorite productivity features.  If you are normally a .NET developer and need to do Node.js development this is your choice, hands down.  It gives you intellisense, debugging and profiling on top of NPM integration.  What more could you ask for?

image

Summary

In the end everyone will have their favorite toolset based on how they work and what type of projects they are developing.  There isn’t a right or wrong choice, just your personal preferences.

BUILD 2016 Thoughts: Home Sweet Windows

It is that time of year again where Microsoft developers gather in San Francisco to hear the direction that Microsoft is moving and the tools they are offering to get us there.  The big theme this year has been “Windows is home for developers”.  So what did Microsoft have in store for us?

How Far Have We Come

There were a lot of stats that showed up during the keynotes.  A couple that stood out for me were that there are currently over 270 million users on Windows 10 and that Cortana is answering over 1 million voice questions a day.  First, this makes Windows 10 the fastest adopted version of Windows in history which say to me that Microsoft is starting to get a little of its appeal back.  Second, it tells me that even if Windows Phone didn’t take of the way it should have it still brought about assets that for Microsoft that they are leveraging to the benefit of users.

Windows

Now I didn’t hear anyone at BUILD say why, but the next update to Windows 10 will be called the Anniversary Update (I guess 31 years is a nice round number).  Whatever the reason there were a number of new features that will be coming with the release that are worth looking at.  The three big features included security, ink and Linux (believe it or not). 

The one security feature that stood out is biometric logins from Edge.  This allows you to use something like a fingerprint reader to log into a web site.  My understanding is that this is an extension of the Windows Hello interface.

The second big feature is the ink enhancements.  The statement was that since most people still use a pen and paper so often that it should be front and center in your experience. This includes context sensitive handwriting recognition that can realize that if you write a word that implies a date it will be a link that can open Cortana and set a reminder.  This along with new highlighting feature, a new sketch pad and rulers that make it easier to draw lines and shapes the ability to use a pen on your computer becomes infinitely more powerful.

For the third announcement Microsoft introduced a Bash shell for Windows running Ubuntu Linux.  I’m still not sure where this is useful, but the fact that the two can live together and interact bears another look.

Xamarin

Here is where wishes come true.  It was rumored before last year’s BUILD that we would hear that Microsoft would buy Xamarin.  That announcement came earlier this year instead.  This week we really got our wish when Scott Gu announce on stage that Xamarin will come free to every Visual Studio user.  Not only that but we will also get access to the other Xamarin goodies like the iOS emulator, test recorder, and test cloud. 

BUT WAIT!  There’s more!  The Gu also announced that Xamarin will be open sourced through the Open Source Foundation.  Merry Christmas!

HoloLens

While it didn’t feature as prominently as it did last year, HoloLens still got some stage time.  It could be that your next classroom experience is with HoloLens if you happen to be a medical student at Case Western Reserve University.  Or you may find HoloLens at your next visit to the Kennedy Space Center where you can explore Mars with Buzz Aldrin.

Azure

Azure continues to be a home run and savior for Microsoft.  As PC sales decline and the types of devices we use diversify the cloud has become the backing service for everything.  You can see then why Azure is now in what will be mile long data centers and why almost the entire second day keynote of BUILD was dedicated to Azure.

Xbox And Gaming

Developers are finally getting the opportunities on Xbox One that they have been asking about since it was announced.  The combination of Universal Windows Platform (UWP) and DirectX 12 not only means that more games will be shipped for both Xbox One and PC, but developers will be able to able to write Xbox One apps and games more easily.  They will be able to test them by using the new developer mode that will be available on the Xbox One.  They will then be able to release it to a unified store.  What more can you ask for.

Cortana

As we have seen over the last year, Cortana is everywhere.  Since every device, regardless of platform, can run Cortana it has the ability to help you in ways that other personal assistant AIs can’t.  They also showed off how Cortana will be integrated with Skype and Bots to give you access to entertainment, products and services that relate to your chat conversations.

Cognitive Services and Bots

I can’t say that the keynotes really made it clear what cognitive services and bots are.  We say where they play but there was not explicit definition of what they are.  From what I saw the cognitive services are pre-packaged services built on top of machine learning.  They are handy tools that you can incorporate into your applications to make them more human friendly like the ability to detect emotions from a person’s expressions.

Bots on the other hand are built on a new framework that is available to devs which integrates services with natural language syntax understanding.  It seems to be the next step in allowing developers to create components that will plug in as part of a greater AI type experience for users.

Summary

That is a lot to take in and a ton of new things for devs to learn.  Microsoft is making it easier for developers of all backgrounds to use Windows as their main development environment and a jumping off point to develop solutions that will live on other platforms.  At the same time they are building cloud and device features that have the potential to move computing light years forward.  Even though this year wasn’t about the hardware it is still an exciting time to be developing on the Microsoft platform.  Check out the content from BUILD on Channel9 and find out which new features you can apply to your solutions.