A simple introduction to AngularJS, Part 1 – What is AngularJS?

AngularJS is honestly one of the best things I have stumbled upon in years. After Silverlight doing its fantastic disappearing act, my interest in developing things on the web took a nosedive. I had no interest in doing it what so ever. HTML/CSS/JavaScript was a massive step back from XAML in my mind. And I still think so. I think we are trying to do things on the web using technologies that weren’t built for it, ending up with a lot of hacky solutions…

However, when I found AngularJS and realized that I could use my MVVM experience, and my “XAML patterns” on the web, it changed a whole lot! I could focus on building applications and leave a lot of the hackyness to the side. I would still have to do the hacks, working with HTML and CSS, but at least I could build the logic side of things in a structured way.

However, Angular might not be the easiest thing to just pick up and learn. For web developers, picking up dependency injection and MVVM can be a daunting task, and being a .NET developer, taking up a dynamic language like JavaScript, and loosely strung together applications built on spread out text files, might seem less the perfect.

Angular isn’t overly complicated, and there are a million resources for learning it out there. But for some reason, I haven’t found one that suited me. So…I decided to do what all simpletons do…we re-invent the wheel and do it all ourselves… The goal is to write an introduction to Angular from my point of view, which means from the point of view of a person who normally works with C# building ASP.NET MVC applications as well as XAML-based applications. I have a background in building web applications, but more from a ASP.NET side of things than from a client-side.


Introduction to the node.js module express.js

My last post covered module loading in node…or at least try to cover the basics in an understandable way… This time, it is time to create something a bit more useful, a proper web application, using a module called “express”. And instead of me talking a whole lot about what I am about to talk about, let’s just get into it…

The first step is to install express. This is done using the NPM as always. The only thing to really decide is whether or not you want to install it globally using the -g parameter, or just locally. Me, I am just going to do it locally, so I use the following command

npm install express

If you install it globally, you can use express to create a “skeleton” application by running the following command

express -s -J <folder name>

This will give you a fullblown express app to start working with. But as I intend to explain the basics, I will start from scratch, and thus just install express to begin with.


Modules and module loading in node for n00bs

Ok, so in my previous post, I introduced Node to newcomers. And I am in now way condescending towards people new to Node. But, wait…Chris, you are always condescending!? Not quite true, but in this case I am definitely not, as I am myself a n00b in the area.

The goal with my blogging about node is to share the stuff I learn along the way, in a way that I think make sense to a C# dev like myself. It might not be the correct node lingo, and I might be wrong in some cases, but I just call it as I see it…

This time around, it is time to have a look at modules in node, and how we load them.


Getting started with Node.js or Hello World in JavaScript

Node.js has got a whole lot of attention for some time now, and I guess it is time for me to get myself an opinion on what it is, and why it is so cool. And while doing so, I will try and write some blog posts offering my opinion and learnings regarding the platform.

In this first post, I will walk through setting up the “environment” needed to build apps, build an initial “Hello World” app to see that it al works. But let’s start with the first question you will ask if you have never worked with Node. What is Node? Well, it is basically a application runtime built on Chrome’s JavaScript runtime called V8. And what does that mean? Well, it means that you get a way to run JavaScript efficiently outside of the browser.


An Introduction to Windows Azure Mobile Services

At the time of writing, Mobile Services is still in preview, so I believe that you have to “request” access to it. But as soon as you have, you get a new icon in your menu in the Azure management portal, which is all cool. But what is Windows Azure Mobile Services (Mobile Services from now on)?

Well, Mobile Services is basically a “layer” on top of Microsofts cloud offering. Initially, it is a great abstraction for SQL Databases, but the idea, as I have understood it at least, is that it will grow as the amount of Azure services expand, giving the users a simple API to work against. And in doing so, will make us as developers much more productive. But as I said, today, it is basically a very nifty layer on top of SQL Databases. However, that layer is really cool, simple to work with, and supports very rapid development.


WCF service clients for the complete n00b

Ok, so in my last post, I gave a brief introduction to WCF for the complete n00b. As a follow up to this, I would like to have a look at some different ways to consume these services.

The “normal” way to do it is obviously by adding a service reference to the project in VS, but there are alternatives that can make sense.

The samples I am going to use are specifically for Silverlight as they focus on simple bindings and features that Silverlight supports, but it can still be used for any .NET client.


A WCF introduction for the complete n00b

Ok…So I am more of a general .NET and Silverlight developer, but it is hard to get around the fact that WCF infiltrates most of the projects I ever work on. And after having read a substantial part of Juval Löwy’s book about WCF, I have realized that there was a lot that I didn’t know and didn’t fully understand. Not that I am saying that I get it all now, but I have a better understanding at least.
The thing is that WCF isn’t really very hard in most cases, but having a basic understanding makes it a lot easier. And to be honest, the basics will take you a long way when working with Silverlight, since Silverlight doesn’t support a lot of the more advanced features. To be honest, the WCF support  in Silverlight is fairly basic, but it is enough…
So based on this, I thought I would try and write a down to earth and simple introduction to the main concepts in WCF.

Introduction to setting up automated unit testing in Silverlight with NUnit

Ok, so MVVM is obviously about Unit testing right? Well, I don’t really agree, but it is definitely a part of why you chose MVVM, even if it is only a small part of the reason for me. I have been using the MVVM pattern for a while now, but I still haven’t started unit testing my code properly. I know I should, but for different reasons I never get around to it. Mostly due to time constraints.

And for all of you that tell me that writing unit tests will not take more time as there will be less bugs to fix, bug off! It does take time. It does include mocking or stubbing services. It does take time to figure out how to write useful tests. And first and foremost, it takes time to get the experience needed to do it fast… So argument ignored!

What I do do though though, is keeping it in my mind when I design my VMs. I always consider whether or no the VM is testable. If it is, then I know that I haven’t introduced any dependencies that I shouldn’t have. And even if it isn’t a fool proof way of limiting dependencies, it does help me…


Storing application wide styles in external files, aka "The ExternalStyleManager"

A couple of the guys at my company have started working on an internal Silverlight application. One of the guys is a former WPF developer, which gives him some serious advantages when starting with Silverlight. It actually gives him some serious advantages compared to my own sorry ass as well. However, it has some downsides as well. Downsides that sometimes end up with him sending me annoyed MSN messages.

He expects a bunch of WPF specific features to be available in Silverlight. I understand the "confusing". SIlverlight development is very close to WPF, except for the fact that Silverlight is in some aspects is tiny compared to WPF.