Tech Blog

Jay's Technical blog

A .NET Developer in an Ever Increasing JavaScript World

23 April 2015
Jay Kimble

So maybe you are like me, I’ve been a developer for 20+ years now, and I have gone from a Desktop developer to a Web Developer to a Silverlight/WPF Developer, and now back to a Web Developer. Ok, maybe you aren’t like me. Maybe you consider yourself an enterprise developer, and you do your best to avoid writing too much client script in your apps. You build enough to JavaScript to avoid a poor experience for your users, but you really haven’t embraced it. All this talk of using JavaScript in mobile apps (aka things like PhoneGap or WinJS) or JavaScript on the server, etc. sounds absolutely stupid to you.

We could be brothers, my friend. Now mind you, I have actually been paid to train folks on enhancing web sites with JavaScript (so my skills aren’t bad).. I have always “loved to hate” JavaScript. I keep waiting for it to grow up and become like my favorite language: C#; I’ve been waiting 15 years for it to arrive. I keep hearing about it arriving, but it has yet to fully happen. There are always caveats.

Ok, we’re on the same page if you are still with me. If you are a JavaScript lover, this series might not be for you.

That said, I watch what is going on in the software industry (both on the windows side and the non-windows side of things). I’ve started to play with some stuff that I have never played with before.. and I am finding it hard to admit,.. but my reaction is “This isn’t all that bad. In fact I could learn this and use this.. if it weren’t for the fact that I would be leaving C# and .NET far behind.” 

The Experiment
I think this stuff is not all that terrible. While I’m not thrilled with some of the players, that’s politics and not technology. The one thing I ask is that you don’t apply your enterprise mentality to this (at least for now). Let’s pretend like this is a CTP that has been released and we are evaluating it like it’s something we might use in a year or so (when it is finally released).

We’re going to look at the MEAN stack (more or less). I want to really press down on what is appealing about this and figure out how we can both learn it and learn from it.

So we’ll be learning to build apps with no C# or VB. We’ll also be leaving behind SQL Server and regular old relational databases. We will be using Visual Studio (thanks to some recent enhancements to it, VS is a great tool even for this arena).

We’ll be gaining a couple advantages. First of all we’ll only need to know 1 language, and that language is programming JavaScript. To make that a little more palatable for those of us who use C# (or VB) we’ll use TypeScript instead of pure JavaScript. This will let us leverage types (in a way) as well as have a very clear manner for building Namespaces (actually their called Modules in JS and have the added ability over a namespace in that they can have functions inside them), Interfaces, Classes, Enums, etc. Needless to say writing JavaScript this way (if you haven’t yet) will feel a little more familiar to you.. this means we’ll have the ability to have all the familiar OO mechanisms we are used to.

Additionally we’ll be able to deploy our code on machines with Node installed; I know that’s not much different from .NET which has mainly been seen on Windows machines and in Xamarin/Mono capable machines. With .NET Core we will be seeing more opportunities, but NodeJS is already there.

NodeJS also runs a little differently than what you are used to it. It uses a single thread, but manages it’s activity very efficiently. It’s also compiled (so it’s not slow interpreted JavaScript either),

With Mongo, we’ll be gaining a Database server that was designed for the cloud. While NoSQL may seem a little weird, I promise once you understand it, you’ll really like it.

The “E” in MEAN is for Express which is the web server plugin for NodeJS; it offers routing and honestly nothing all that special in comparison to ASP.NET MVC.

The “A” in MEAN is for AngularJS; I’m sure you’ve heard of that (and probably have worked with it some).

We’ll also be talking about another “A” that I like a little better than AngularJS: Aurelia. Although it’s barely an alpha, it’s showing great promise!

Anyway, looking forward to our first post.