Meligy’s AngularJS and Web Dev Goodies – Issue 4: ng-europe Special

Hello there,
First, allow me to welcome all the new subscribers who joined the newsletter since last issue. You can view the newsletter archive at any time on I’d also like to thank all the subscribers who have been on board for a few issues already. Please make sure to tweet about the newsletter to all your friends to get on board as well.

This time we have a bit of a theme around ng-Europe conference and recent Angular.JS 1.3 and 2.0 announcements.

A small warning though. This is a bit of a different issue. One that I get to be a bit more chatty at instead of just describing the links being shared. As always, I’d love to hear from you whether this style is better or worse. Reply to this email or mention me on twitter as @Meligy.


ng-europe is the European version (was held in Paris) of ng-conf 2014, the first big single-track Angular.JS conference. It took 2 days with presenters from the Angular team and community leaders. The conference is important as it’s the place where the Angular team finally explained their big plans for Angular 2.0, and a few related topics got more exposure like Angular Material Design.

Conference Notes:  Day 1  |  Day 2    (biggest announcements came out in day 2)
A wiki-style collection of notes written by conference attendees. The best place to go to for getting a summary of the conference. You can later decide which sessions you might want to watch in details.

Video: All ng-europe Videos
All the conference videos are on YouTube. Check them out. Plenty of good stuff.

ng-europe Session Slides
For times when/if you need to refer to any of the session of the session slides.

Video: ng-conf 2014 Videos & Slides
I found this while preparing the newsletter, from the same site that put the ng-europe slides together. If you are bored you can check it out. Most if not all topics are still relevant.

Angular 1.3

Angular 1.3 was announced in early October, the main focus has been speed improvement and getting some directive improvements for form manipulation. We see one-time bindings, new way to create validations and show error messages, and more. Beware though, no IE 8 support.

Official Announcement — AngularJS 1.3.0 – superluminal-nudge
The post where Angular.JS 1.3 was announced. A good summary with links to documentation for each of the new major features. There’s alway the full changelog as well.

Vide: Angular 1.3 by Jeff Cross & Brian Ford at ng-europe 2014
I thought I’d highlight this video in particular. If you have 20 minutes to spare, watch this video, a good walkthrough of the features from the team that developed them.

Angular 2.0

Angular 2.0 has been in design phase since last December, while Angular.Js 1.3 was in development as well. Since then, we knew Angular 2.0 is going to be a big change and a complete rewrite, but we didn’t know how big exactly till ng-europe.

In Angular 2.0, the team plan to use EcmaScript 6 module system to replace Angular’s own module system AND dependency injection.

They also plan to use ES 6 classes to create directives in a new way that doesn’t just replace the current directive system but also the Angular controllers. With no controller, there will be no $scope as well (they referred to $scope as “Directive Definition Object”, DDO in ng-europe).

While on it, Angular 2.0 will also get rid of jqLite in favor of using the DOM directly (since it’s designed for modern browsers, where the DOM API has evolved enough already).

RIP in AngularjsJS 2

Video: Angular 2.0 Core by Igor Minar & Tobias Bosch at ng-europe 2014
(Just highlighting the relevant ng-europe video)

The announcement of Angular 2.0 had many reactions, more negative than positive. The main issue is that Angular 2.0 as explained in ng-europe feels like an entirely different framework.

Angular 1.x (The way from 1.3 to 2.0)

The announcement of Angular 2.0 makes people very skeptical of using Angular 1.x, even with Angular 1.3 still new, having tons of great features and performance. Here are a few write ups and news that help you make an informed decision whether to use Angular 1.x or not.

New Project Lead for Angular 1.x
Igor Minar (@IgorMinar on twitter), the AngularJS team lead, has decided to assign the most active Angular.JS community member as the leader of Angular 1.x. He says that there’s a lot of work to be done in Angular 1.x and if he focuses on both releases, not much of it will happen as he’s mainly focusing on Angular 2.0. Also check Angular 1.x: The plan forward, the letter Igor wrote to the team about the change.

Angular.JS Weekly Meeting
While not specific to Angular 1.x, this seems to THE place to watch for what’s happening in the Angular 1.x space. It’s as close as we can get to what the team is thinking, at least for now.

If you watched the ng-europe videos, you might be confused about the migration path from Angular 1.x to 2.0, as it looked like there isn’t going to be any. Looking at the plans and meetings for Angular.JS team, there are a few hints that suggest things might be a bit better than expected.

For example, there is a plan to share some critical components between Angular 1.x (1.3 in fact) and 2.0. Material Design and the Angular 2.0 router are the biggest names to mention in this context. Some 3rd party libraries have similar ambition as well, like Restangular.

Screw You Angular
Although the title suggests a rant, this post is actually tries to address all the criticism AngularJS got for lack of obvious migration path from 1.x to 2.0 (I was collecting these posts for the newsletter since they had very good points, but changed my mind as the post links to them anyway).
The answer the post provides is that the team hasn’t thought about migration because Angular 2.0 doesn’t exist yet! Once v2.0 gets more shape, the team can then think what the migration path to that could look like.
Not a very bad argument, and since the author is an AngularJS insider, it’s more of a knowledge than a guess.


It seems that even EcmaScript 6 was not enough for Angular 2.0 vision of declarative programming that the team decided to implement their own language, AtScript! Crazy, huh?

It sure it. Many reject Facebook’s JavaScript framework, ReactJS, just because it introduces a new language (extension of JavaScript, .jsx files) that mixes HTML and JavaScript and requires its own compiler to translate to JavaScript. Angular.JS did something similar except the syntax isn’t as weird.

AtScript, is an extension of TypeScript that should be able to compile to ES 6 (and then can be compiled to ES 5, the current JavaScript) or Dart (I know, I don’t care too, but BTW, most of the PoCs and early experiments of Angular 2.0 and some 1.x were in Dart). It adds some annotations that the framework will use to differentiate different kinds of directives and more…


AtScript, Google’s new superset JavaScript runtime
A good article with highlights from the ng-europe session.

Video: Miško Hevery – Keynote on AtScript at ng-europe 2014
The video of day 2 keynote where AtScript was announced. Pretty fun to watch BTW.

Video: ES6 in Angular 2.0 by Erik Arvidsson at ng-europe 2014
This video explains how Google is planning to extend its ES 6 to ES 5 compiler so that it handles AtScript as well (from the user point of view). You get to see how the pieces of the puzzle come together.

AtScript Primer
The official AtScript design document.

If you are like me, you must have been quite surprised that Google has considered Microsoft’s TypeScript as a base for AtScript, here’s what Sir Anders Hejlsberg, the father of C# and TypeScript, thinks about that, in 140 letters or less:

More from @Meligy / GuruStop

Thanks a lot for making it that far. If you like what I brought you today, let’s connect in even more ways!

Follow me on twitter — @Meligy

Check The Newsletter Archive —

Get friends to receive the newsletter —

Remember that you can just reply to this email or mention me on twitter to tell me what you feel needs to change in next issue. And please to tweet it to your friends too, the more people enjoying this, the more it encourages me to make it better.

Until next issue,


Meligy’s AngularJS and Web Dev Goodies – Issue 3

Hey there,
Welcome to Issue 3 of the newsletter. If you want to check the previous editions, you can go to You can access a particular issue like, for Issue 2 you go to

This time I have played a bit with the schedule and the order of sections. The idea is to experience different ways and hear your feedback on what works better. either on twitter or by email (simply replying to this message).

SEO — News

Video: Google will render JavaScript by end of the year
During AngularJS NYC usrgroup for September 2014, Brad Green, a Google engineering manager working on Angular.JS among other things said that Google crawler will render all JavaScript by the end of this year, and their should be tooling for checking that in Google Webmaster Tools as well – Discuss on reddit.

Angular.JS — Libraries

bind once for Angular.JS < 1.3
A set of directives that allow you to bind values to the UI only once instead of watching for model changes to update the UI. This is particularly useful when you have a long readonly list inside ng-repeat where most properties are unlikely to change until the entire list changes (and then the whole template will be re-rendered).
The concept is now native in Angular.JS 1.3, and there are other libraries that try to enhance it, like angular-watch-require and angular-watch-when.

If you use require.js and want to have lazy-loaded modules with it, there are several tries out there that get that sort of thing done. If all you want though is just lazy loaded modules that are loaded and bootstrapped on the fly when a certain route tree is matched (like areas in ASP​.NET MVC Areas or Rails Namespaces). Might be good for large Angular.JS apps. It also has been mentioned on the Adventures in Angular podcast.

JavaScript — MVC Frameworks

MVC Architecture
A very nice article about how we don’t exactly implement MVC as 3 parts, Model, View, and Controller. We usually had other parts too. I think the closest way to how I implement MVC is the last picture in the article.

Why I Don’t Want Your JavaScript Framework but I Love You
If you are in the mood of reading about what homework you may want to do before you actually go ahead and use a JavaScript framework, this could be a good read.

JavaScript — Ember.JS

I have a few links for Ember.JS this time that it will feel like I’m moving to it, although I’m not, I still find its innovation very inspiring as you’ll see below.

Mistakes I Made in My First Ember Project
If you have been following the newsletter for a bit, you know I value knowing how other SPA/MVC/MV* frameworks solve the same problems that Angular.JS solves. I think this knowledge is beneficial regardless of the framework because many of the issues have equivalent in every framework, and thinking about different approaches can really help you get the most out of whatever framework you use.

Event Delegation in Ember.JS – StackOverflow
When you use ng-click inside ng-repeat in Angular.JS, it doesn’t usually set one event handler for the parent of the element and use event bubbling to set it, although you can do it yourself via a directive. It was interesting to find out randomly via StackOverflow that event bubbling is how Ember.JS works by default!

Building rich single-page application with Ember.js
Historically, one of the things that stopped many people from learning Ember.JS was how hard it was to get to understand its pieces. This is now changing a lot (or may I say changed?) with better documentation and more great guides, like this one, which was very simple and lovely to browse.

JavaScript — ES6

Traceur is Awesome! … but still a little Painful
Don’t be turned off by the title. Traceur is a nice tool from Google to compile ES6 code to ES5 code that can run in any ES5 browser (most browsers, and even older ones can be polyfilled). This post describes what the experience is like when using it (.NET people might find using TypeScript a better option for its VS integration though, although it’s not not exactly ES6, you can sometimes go even crazier with some F# mix).

JavaScript — Debugging / Performance

Video: Advanced Debugging Techniques with Chrome
A must see video of what goodies exist in Google Chrome dev tools (including some of the relatively new features like new enhancements to emulation), this is probably a must-watch video for you. I have been using the tools for years and found quite a few things I didn’t know before.

JS Parse and Execution Time
When you use a framework (quite often you should), there’s only so much you can control in terms of performance. This article examines the time it takes to parse and execute jQuery on so many browsers and devices. It has some interesting observations, like how the total times vary like crazy between different devices, and how device hardware is still the major determinator is hardware rather than software (OS or browser).

Security – HTTPS

I think we are in the (very?) early days that will lead to all websites running HTTPS by default. Apart from privacy concerns, SCARY attacks, there’s also industry leaders push and relative ease of implementation. But it’s not something that everyone needs to worry about just yet.

SSL and SEO: Don’t Panic
There are a few messages that I want to send from sharing this:
1. Google announced they will consider SSL as one of its many ranking factors
2. This doesn’t mean you should freak out if you are not using SSL (the point of the link above)
3. But SSL is worth it anyway, as in most recent hardware and software (including IIS 8 and maybe 7.5) it’s already fast (the traditional old concern about SSL, apart from cost for tiny websites).

Slides: Is TLS fast yet?
If you are thinking about implementing HTTPS and worried about CPU performance, your server documentation documentation should tell you whether there are significant performance overhead (I checked some common ones and they were all saying nothing to worry about). This presentation helps assure the same idea.

Cloudflare – Introducing Universal SSL
The well known CDN provider Cloudflare announces availability of SSL services for all their plans, including their free plan. They serve files in HTTPS, and can be configured to pull assets (as source files to publish on the CDN) from HTTPS URLs as well. Here’s a basic write up of how to use it.

Security — General

Waxing Poetic with SwiftOnSecurity
I didn’t plan to make this newsletter mostly about security as it ended up being, but this story that reminds us of how some users can be so vulnerable in a way we can’t blame them for, is quite a good read.

Microsoft — Windows 10

Video: Windows 10: Enterprise Features & Core Experience for Businesses
You must have seen a ton of Windows 10 videos already, for me, this was pretty much the deepest one of them that related to me as a developer and showed the philosophy of the product.
One fun moment in the beginning of the video was giving a reason for the name, Windows 10 (instead of Windows 9), apart from considering Windows 8.1 as 9 (if you want) which the video didn’t suggest, it said that the main idea was calling it Windows One, similar to Xbox One and One Drive, etc. Windows One was taken as Windows 1, so they went for Windows 10! (if this is silly still – I think it was meant to be more funny than true-, I promise the rest of the video isn’t).

Video: Scott Hanselman Detailed Windows 10 Tour in just 8 Minutes
Scott is very well known in the ASP​.NET developer community as his work at Microsoft is mainly around that community and ASP​.NET MVPs, etc. He is a great person and speaker. His Windows videos are not something that he does for work, which makes them even greater and more realistic.

Windows 10 Insider Program / Preview
Just in case you missed the URL to get the technical preview! I have heard a few positive comments from some of those who played with it, especially on a Surface laptop (of course).

Apple / IPhone / iOS — Quick Links

iPhone 6 Screens Demystified
Also check their iPhone resolutions guide

iOS 8, thoroughly reviewed
Very long / detailed review

Video: Steve Jobs introduces WiFi to the masses with a hula hoop!

JavaScript — Quick Links

Promises in the Google APIs JavaScript Client Library
Google’s JavaScript SDK now return promises, for easier integration into promises-all-the-things!

Bye Bye Javascript Promises!
async/await like code in JS?

A JavaScript library to generate responsive stylesheets.

Explorations In Automatically Fixing JavaScript Linting-errors
By Addy Osmani from Google

Calculating Standard Deviation with and Array.reduce, In JavaScript
A bit of a different challenge

More from @Meligy / GuruStop

Thanks a lot for making it that far. If you like what I brought you, let’s connect in even more ways!

Follow me on twitter — @Meligy

Check The Newsletter Archive —

Get friends to receive the newsletter —

Remember that you can just reply to this email or mention me on twitter to tell me what you feel needs to change in next issue.

Until then,

Serializing A PagedList Using JSON.NET In ASP.NET MVC – Gotcha And Workaround

Recently I discovered that there’s no one standard way for AJAX-driven server-side paging in ASP.NET MVC (in Web API, you can expose an IQueryable). For the case in hand, I decided to use PagedList for the server bit of the game.


The PagedList interface looks a bit like this (for demonstration only, real code is a bit different, check its source code for the real stuff):

It provides nice properties for paging, and exposes itself as enumerable and has an indexer. Apart from this snippet, the library also provides an extension method ToPagedList() to apply to any enumerable and allow it to populate the properties from it (by enumerating on it, and by calling the Count() method).

We were also using JSON.NET for JavaScript serialization, which is pretty much defacto standard nowadays.

The JSON.NET Serialization Problem

JSON.NET has a nice implementation, if you serialize a class that implements IEnumerable<T>, and you don’t have a special treatment rule for it (via what JSON.NET calls “Converter” classes), when you serialize an instance of the class to JavaScript, it will be serialized as a JavaScript array, where the enumerated objects are the contents of this array. Makes lots of sense right?

Well, yes, except when you have a custom collection like PagedList, and you want to treat it as an object that has several properties, not as an array. JSON.NET does provide a solution for this actually, all you need to do is apply the [JsonObject] attribute to your class.

Unless you don’t own the source code of this class.

In this case, you need to inherit from it. By doing this, I lose the nice ToPagedList() extention method (because it creates an object of the PagedList class directly), but luckily it does nothing but calling new PagedList() with the parameters we give it, so, we don’t lose much.

Here’s how my implementation looks like:

Apart from having to copy the constructors to pass parameters to the base ones, have you noticed the extra Items property in there?

That’s because the Subset member it includes is actually a field, not a property, and JSON.NET won’t serialize that by default, I could override it somewhere else, but since I’m fiddling with this here, it made sense to just stick a property to the class.

Bonus: A Bit More On Implementation

In my actual code, I have added the Dynamic Linq NuGet package, and assumed a single property for sorting (which was fair for the situations where I intend to use this), so, I complemented the code above with another class that looks like this:

This allows the controller to instantiate an instance of the SerializablePagedList class, pass it all the way to whatever repository method I have.

The repository method will take it as a parameter, work out what IQueryable it needs, and instead of passing it to UI, it calls CreatePagedListFromQueryable(), which returns an innocent-looking PagedList object (because SerializablePagedList inherits PagedList) that the repository can pass back to the controller, which can serialize it to JavaScript without a problem, then the rest is all JavaScript code to work out how create the paging parameters, and how to use the returned paging hints.

Even more, now that I think about it, maybe I should change the return type to SerializablePagedList, to make the Items property visible to the developer (because they’d think it’s magic, and in coding, magic is BAD). I’ll leave this as an exercise for you :)

Final Words / Disclaimer

The motivation behind this post is that I found the problem of serializing PagedList using JSON.NET a challenge and I wanted to help others work it out faster than I did. Is this how I’d recommend doing paging? Well, I don’t know, but if it’s what you choose, I hope that I have saved you some time.

And more importantly, is it good enough to be the defacto standard I mentioned I was after in the beginning of the post? Not really. I think it’s not bad, but definitely not the best. I’d love to see less clever (read: hacky), and more simpler solutions.

Manually Compressing Any ASP.NET Page, PageMethod, MVC Action, HTTPHandler,..

Compressing A Single ASP.NET Response Manually

This post is about compressing your HTTP result without using IIS Dynamic Compression. I’ll save the story to the end and give you the code first:

using System;
using System.IO.Compression;
using System.Web;
namespace WebCompressionSample
    public static class ResponseCompressor
        public static void Compress(HttpContext context)
            // Quite often context will be something like `HttpContext.Current`
            // which in some conditions may not be available.
            // This is likely due to mixing conerns in calling code, 
            // so, it's up to you whether to handle differently.
            if (context == null)
            // Among other things, this header tells the server 
            // whether the client can decompress compressed responses, 
            // and what compression format(s) it supports
            string acceptEncoding = context.Request.Headers["Accept-Encoding"];
            if (string.IsNullOrEmpty(acceptEncoding))
            // The two common compression formats in web are GZip and Deflate
            if (acceptEncoding.IndexOf("gzip",
                StringComparison.OrdinalIgnoreCase) > -1)
                // Read the response using a GZip compressor ,
                //    and replace the output with compressed result
                context.Response.Filter = new GZipStream(
                        context.Response.Filter, CompressionMode.Compress);
                // Tell the client the ouput they got is compressed in GZip
                context.Response.AppendHeader("Content-Encoding", "gzip");
            else if (acceptEncoding.IndexOf("deflate",
                StringComparison.OrdinalIgnoreCase) > -1)
                // Read the response using a Deflate compressor ,
                //    and replace the output with compressed result
                context.Response.Filter = new DeflateStream(
                    context.Response.Filter, CompressionMode.Compress);
                // Tell the client the ouput they got is compressed in Deflate
                context.Response.AppendHeader("Content-Encoding", "deflate");

Well, this shows how to do the compression itself. Depending on how you do ASP.NET, you probably will call it differently.

In my case, I called it manually from an ASP.NET Webforms PageMethod (more on why below), but if you are using ASP.NET MVC for example, you probably want to wrap it in an ActionFilter and apply that to the action you want to compress its output. Let me know in the comments or on twitter if you have a problem implementing it in a particular situation.

IIS Dynamic Compression

IIS 7+ has built in dynamic compression support (compressing output of server-side scripts like ASP.NET, PHP, etc.). It’s not by default because compressing dynamic content means running the compression for every request (because it doesn’t know what the server-side script will generate for every request, the point of using server-side programming is generating dynamic content!).

Static compression on the other side (caching static files like styles and scripts) is on by default because once the static resource is compressed, the compressed version is cached and served for every future request of the same file (unless the file changes of course).

General advice: I’d say if your server side scripts expect to return large text-based content (say, large data, even after paging, etc. like large reports or whatever), always turn dynamic compression on, at least for the pages that expect to return large data sets of text.

In many cases though the majority of large files will be scripts (and possibly images) will be the larger parts though, which are often taken care of (for scripts for example) by IIS static compression or ASP.NET Bundling.

Python, Ruby, or PHP? (My Take On Answering The Question)

A friend I know has been developing desktop applications with .NET for quite long time. He wanted to improve himself even more by going out of his comfort zone learning more stuff he’s not familiar with. So, he spent some time learning client side web technologies and wanted to add some “non” .NET server technologies to the mix. He emailed me asking for recommendations on what to learn,: “Ruby, Python, or PHP ?”.


After sending the answer, as with other previous emails, I thought maybe I’d share it with you here.


Let’s start with Python, since it’s the language I know least about (take that as a disclaimer against everything I claim about it next). Note that Python also has similar options to Ruby (maybe even earlier than Ruby had for some of them) even the MVC application frameworks (like django), but they aren’t booming as much as, say, Ruby..

Python’s real power is that it’s one of the old languages with great standard library doing networking and several pieces of functionality, in a way closer to C++ than it is to .NET or Java. I think also it’s runtime is historically has better performance and wider platform support than, Ruby.

I’d argue though that those benefits are usually less important in the web world, where you worry about web specific features (templates, personalization, AJAX support, etc…), than library features really, and only have a known set options for the platform hosting the web app/.


Here Ruby comes to play, with similarly old-enough-to-be-mature age, more web friendly (ex: white-spaces significance is optional), and generally getting a sense of dynamic features with C#/Java familiar syntax as "option" syntax style (rarely used). The ease of catching calls to non-existent members by one handler (method_missing or something) inspired a lot of nice syntax APIs.


The key attraction around Ruby world is not Rails. It’s actually Ruby gem, the "package manager" inspiration for NuGet and alike.This made sharing Ruby libraries and frameworks really easy, like other scripting languages, they allow you to extend the console features as well and add commands that perform repetitive tasks and code generations and so, which is an area .NET capability is still lacking much in.


Another killer thing about Ruby is the integrated eco-system. People would be using Git, github, Ruby, Ruby Gem, Rails, MongoDb, SASS (for CSS), CoffeeScript (for JavaScript), Heroku (cloud hosting),… and al of them have a specific workflow (or series or workflows) that make development much easier. This is also one main area in addition to console extensions that you’ll be blown away with.


Obviously, most people working with Ruby use Rails, the MVC framework for it, which has its own common workflows using specific options for ORM, mails, and other common tasks. It’s the opposite of .NET where we care about multiple options, they "do" have multiple options, but they care about the awesomeness of the experience with the option they choose rather than the ability to replace this option in the future. Quite another mindset shifting.


I’d suggest you don’t start with Rails. Start with Sinatra instead. Sinatra is like a basic web framework that just handles routes and templated views and few other things. People loved it for its simplicity and a lot of people build proof of concept and prototype startup ideas using it, especially when things don’t involve DB, or a lot of DB work. It’ll also introduce you to the way you depend on scripting a lot to perform various tasks in development.


Don’t get too deep into Sinatra, once you get to the point you think you understand its pieces well, move on to the next level, Rails (next in terms of number of features built-in, not in terms of better). Build something with it, usually people choose to create To-Do list or a Blog as those are the hello-world apps in web world, right? Try to discover which gems most Rails developers use most and really teach yourself to follow the workflow most tutorials and users will suggest. Expect a lot of "you are doing it wrong" times :)


A note on PHP: The reason PHP is still strong and won’t die any time soon is the amount of awesome web apps built with it over the years. WordPress, Drupal are the obvious names, but hey, the examples are uncountable. PHP has been trying to adopt to recent trends and copy features from other languages (like everybody else do), but I think it’s just causing it to lose it’s original power, which is being a simple lightweight language.

Modern PHP developers have created their own common workflows as well and those moved beyond going MySQL-PHP to REST and MVC framework and more, but the workflow for something like Ruby feels more "natural" rather than "addition" and hence makes more sense the more you apply it in your coding practices.


Another option you haven’t mentioned is NodeJS, or server-side JavaScript.A lot of people who do Ruby for long time mix bits of other languages in their workflows, like Scala and Clojure and others. So, being used to this, many Ruby guys actually turned to become NodeJS guys.

They copied the usual workflows pieces to their usage of Node, like git, and NPM (the Node equivalent of Gem or NuGet), and even equivalents of Sinatra (which is almost standard, called ExpressJS) and Rails (various options). Some mix it with CoffeeScript and DB tools (although JavaScript doesn’t have special features to create ORMs like Ruby method_missing and mixins), and it’s quite booming recently.


It’s also a good time to consider it since Windows support just recently became good enough to use (earlier it didn’t have NPM support for example, which is like Ruby without gem, pure key piece of the workflow missing and making the platform pretty much useless).


I think Node will bring you some of Ruby workflows via ExpressJS and brothers, and make you more fluent in JS (which is becoming THE universal language of the web), and blow your mind in the special way it handles creating the web app (although ExpressJS makes it more like just handling routes in ASP.NET MVC or Sinatra).


So, I’d go for long term spending on Ruby then Rails (going a b it of Sinatra), or do some plain Node stuff for a while and then start learning ExpressJS. Whatever you do, keep an eye on what’s usually called "workflow" in these areas, which is like "best practices" in our own terms. Whenever you do something and it feels harder than it should, it’s likely because you are not following another piece that makes it easier for other people who do both.

#MvcConf 2 – Call For Speakers


Assuming some of you have attended live or watched the recordings for the past MVCConf conference. It’s a virtual conference concerned (as the name tells) about everything related to Web MVC Frameworks in .NET (ASP.NET MVC, FubuMVC, Spark, …).

Videos from the previous MvcConf event can be found at: and

MvcConf 2

They plan to have a second event after the great success of the first one. And they started a call-for speakers. See:

Quoting Details


Tuesday Feb 1st 8AM – 5PM CST




Check back 1/17

Call For Speakers

If you would like to speak at this years conference. Fill out the Speaker Proposal form.

An Awesome Conference

MvcConf is a virtual conference focused on one thing: writing awesome applications on top of the ASP.Net MVC framework. Your brain will explode from taking in so much hard core technical sessions. Sounds fun eh?

This is a community event and we want the best and brightest sharing what they know.

We intend to record each session and make them available online for viewing. We intend to make the videos available free of charge, depending on conference sponsorships.

Giving Back

Keeping this conference a community event is important. We are donating a portion of the proceeds from the event to the jQuery project.


Speaker proposal from can be found at:

MVCConf, An Online ASP.NET MVC Conference Coming Tomorrow


Another internal company email I sent today and found useful enough to share in the wild (after few modifications)…

Hey all,

There is an online conference (streamed over the Internet, you don’t have to go to physical place) tomorrow called MVCConf; in addition to the MVC in the name it’s related to so many .NET and SQL and jQuery related stuff.


You may want to attend as many sessions as you can.


The conference is going to be TOMORROW  July 22 from 8 AM to 5 PM CDT (that means UTC – 5 time, considering Abu Dhabi is UTC + 4, the mentioned time is 9 hours late than Abu Dhabi, so, 8 AM CDT  = 5 PM  for us, 5 PM CDT = 2 AM for us).


Of course you do not have to attend all the sessions. Actually you cannot, because they have 3 parallel tracks. (3 sessions at a time).

The conference is streamed over Microsoft Live Meeting.


Register from:


See you online :)

Let me add here that the conference agenda can be found at:


The conference sessions are planned to be recorded. I hope they manage to do it.


Being in Abu Dhabi, 5 PM to 2 AM sound perfect to me. I hope I haven’t ruined up the calculations.


Note For Egypt

For Egypt, I think that means 4 PM to 1 AM. Most developers in Egypt won’t make it before 6 – 7 PM I believe, but then you can watch the rest (most) coming after that!

More On Razor Syntax / Expressions

This post gets enough said about how the Razor parser works.,guid,89b7bd90-52d7-4d49-b87d-4e888f285b4c.aspx

The guy, Andrew Nurse, is the one who wrote the parser!   (from Haack’s note)


After reading it and a quick chat with @Haacked on twitter, it seems all your “escape” kind of Razor expressions (that is meaning: when mixing code and text without spaces etc…) will look like @(someCode)someText. This is coming from an example, to escape a C# identifier that’s also a keyword, say “class”, you’d be using @(@class). The @(…) style is the new <%: … %> but only required for escape situations.


Also, it seems that switching from being equivalent to <%: … %> to being equivalent to <%= … %> by using some Razor notation is not gonna make it. You need to do it through doing some classes implementing IHtmlString interface.


Of course I’m not so sure that’s exactly the case. Anyway, Razor is only available now in WebMatrix mini-IDE, not much MVC love yet (pretty soon).  Just thought it might be interesting…

Just In Case You Missed The New ASP.NET Betas (WebMatrix, Razor, IIS Express, SQL Server Compact, Web Platform Installer)

Similar to the last post, it looks like the best way to continue blogging for me is to copy private company/list emails (when appropriate of course). This is a mail I just sent to .NET list in my company, with slight modifications:

Hey all,

Just in case you have not noticed it already, early last night (before I woke up near midnight our time!) Microsoft released public betas of some new and fancy stuff…

1- IIS Express

Remember when I mentioned it before? A nice alternative to Visual Studio built-in dev server.

Supports SSL and other nice stuff, works even on Windows XP but simulates IIS 7.5, no admin privileges required

2- SQL Server Compact Edition

A file-based database engine, just like SQL Server Express, except that when you develop your website with it, you don’t need it to be installed on the server to get running (or anything else installed)

3- New ASP.NET Pages Syntax code-name Razor

This is a new syntax that is going to replace the old <% … %> ASP-Classic-like style we write ASPX/ASCX pages

It’s going to be mainly for ASP.NET MVC, but watch out, I smell like it’s may reach web-forms also

(It already now can work with or without MVC)

4- Microsoft WebMatrix
You may have heard the name before as a very old web tool for .NET 1.x,

No, this is a completely new Web development and deployment tool.

It installs all the previous components in it (but total small size 15 MB) and supports them out of the box

Also support Search Engine Optimization Kit for IIS Express and nice automatic Web Deployment model

Targeted at .NET beginners (typically coming from other dynamic languages I’d say based on what I see, it doesn’t have intellisense even, which is common in these languages IDEs)

5- Microsoft Web Platform Installer 3.0

The component you can use to install different web development stuff like the mentioned above (and like SQL Express, Visual Web Developer Express, and even PHP) and also read-applications like blog engines and such that you can sstart with and modify their source later

The announcement from Scott Guthrie that came yesterday can be found at:

For great tutorials see Scott Hanselman Post (Most Importantly, it has links to video and tutorials about all mentioned)

For feature-specific announcements from Scott Guthrie see:

· IIS Developer Express: A lightweight web-server that is simple to setup, free, works with all versions of Windows, and is compatible with the full IIS 7.5.

· SQL Server Compact Edition: A lightweight file-based database that is simple to setup, free, can be embedded within your ASP.NET applications, supports low-cost hosting environments, and enables databases to be optionally migrated to SQL Server.

· ASP.NET “Razor”: A new view-engine option for ASP.NET that enables a code-focused templating syntax optimized around HTML generation.  You can use “Razor” to easily embed VB or C# within HTML.  It’s syntax is easy to write, simple to learn, and works with any text editor.

Also, I wrote a detailed blog post on the very early morning yesterday about my thoughts of Razor syntax and ASP.NET MVC, and made sure the post is friendly to those who almost don’t know about ASP.NET MVC itself, find it here:

You know what? Let me just quote the list of videos and tutorials better…

· Channel 9 Video: WebMatrix with Scott Hunter and Simon Calvert

· Learn by Doing – WebMatrix walkthroughs

o 1 – Getting Started

o 2 – Coding with Razor Syntax

o 3 – Creating a Consistent Look

o 4 – Working with Forms

o 5 – Working with Data

o 6 – Working with Files

o 7 – Working with Images

o 8 – Working with Video

o 9 – Adding Email to your Website

o 10 – Adding Social Networking

o 11 – Analyzing Traffic on your Website

o 12 – Adding Caching for Faster Websites

o 13 – Adding Security and Membership

o 14 – Introduction to Debugging

o 15 – Customizing Site-Wide Behavior

o ASP.NET Web Pages API Reference

· WebMatrix Tutorials and FAQs

o WebMatrix Overview

o Create a Website from a Gallery Application

o WebMatrix Beta Release Readme

o Using WebMatrix Beta[Show All]

§ Download and Install an ASP.NET Application

§ Download and Install a PHP Application

§ Make your Website SEO Friendly

§ Analyze Your Website

o Using IIS Developer Express

§ IIS Developer Express Overview

§ Use the Windows System Tray to Manage Websites and Applications

§ Use the Command Line to Run a WebMatrix Site or Application

§ IIS Developer Express FAQ

o Application Gallery FAQs

§ Acquia Drupal FAQ

§ AtomSite FAQ

§ BlogEngine.NET FAQ

§ dasBlog FAQ

· File a Bug on WebMatrix or Suggest a Feature

Have Fun!


Update 01:

There is one more tutorial I forgot to mention

Thoughts On Razor, Microsoft’s New ASP.NET MVC View Engine

This is something I have posted to a private mailing list before, and thought since I have only fixed number of keyboard strokes to death, I should be sharing it with larger audience…

Before Beginning

imageI know some of the audience of this blog may have not even tried ASP.NET MVC, so, you may need to bare with me for a while ((and those familiar with it just bypass this section please).

In ASP.NET MVC, the request goes to a specific method (commonly known as Controller Action) to handle it (choosing which method/action is based on something called Routing, we don’t care about that for now).

Once the method is executed, typically it ends with calling a page or user control (commonly called a View) to send some markup to the browser. Usually this is an ASPX or ASCX file without code behind. It has some special properties to interact with the data coming from the controller action, and some special shortcut methods to write HTML markup (called HTML helpers).

This page can have a master page, include other user controls, and even have a <form runat=server if you want, however, someone may shoot you for doing it in MVC view, because no body uses server controls in MVC. All is using plain HTML/JS (with some helpers to speed the process). Typically you end up having a page that looks very similar to to ASP classic pages, with so many <%.. %> and <%= … %> inside this HTML though, and -depending on how you do it- it can get really ugly.

On View Engines…

Of course, this is not the only way to write the view markup in ASP.NET MVC. ASP.NET MVC enables something called “View Engine”. This View Engine handles finding the view file (whether it is a shared file like master page or .ASPX page or even partial like user control), parsing this view file, and executing any special code parts in it (like the parts inside <%.. %> and <%= … %>). This is not a new idea in ASP.NET MVC, as it existed before in Ruby On Rails and the open source .NET MVC Framework MonoRail.

The community then has taken care of doing alternative view engines. This means ability to write the same markup with different syntax than the ASP.NET syntax we all know (which became known as Webforms View Engine because it’s the same like in web forms development).

Some of there were ported from other MVC frameworks like MonoRail, and some were completely new. Some examples are NVelocity, NHAML, and Spark, which is created especially for ASP.NET MVC and later supported other .NET MVC frameworks like FubuMVC and MonoRail, It tries to make all the code look like html where loops and such can be added as custom HTML tags or attributes. It is also getting the most love from ASP.NET MVC developers not using the default view engine. Go to Spark homepage to get a sense of how the syntax can be different.


After Scott Guthrie, Microsoft’s Most popular Vice President, blogged about the new coming view engine from Microsoft itself code-name Razor, and showed some samples of how your view might look like using it (stating clearly that the webforms view engine will then be obsolete),  this brought many interesting points…

  • There is coming a built in extensibility support for having custom view engines integrated with Visual Studio dialogs. This is great to know, especially if you you see how people suffer to implement some support with the current tooling.

  • Part of this tooling you’ll be able to have multiple view engines set by file extension| for example, enabling you to have multiple view engines in the same project easier. This is typically something you don’t need 90% of the time, but when the rare time comes and you need it, it should be quite handy.



Razor beta is not even out. All we know about it is from different blogs and twitter conversations. Everything written here may be invalid to some point in the future or completely incorrect.


imageThere was a public discussion on twitter between Rob Conery (ex-Microsoft ASP.NET MVC team member, now runs his own business, Tekpub, a GREAT technical videos learning site) and Phil Haack (A popular Program Manager in Microsoft ASP.NET team, mainly focused on ASP.NET MVC, also founder of Subtext, my favorite open source .NET blog engine) about why Razor, why not just give even more VS love to Spark being a very popular ASP.NET MVC view engine (and given the creator of Spark is now a member of ASP.NET team also!). In this conversation Rob said he is more convinced about the decision after a phone call from Phil and some interesting comments (will mention one of them below) were simply deleted after that, as the guys in the private list made me notice. Politics :)

I also got involved in talking to Phil and others about it, but this is another (way much smaller) story…

Finally Getting to the Thoughts…

Mainly the private mail conversation was about Razor, the twitter conversation, and why Microsoft seems to clone open source projects rather than just highlight them to its customers.  Reminded me with something I retweeted few days earlier:

RT @tehlike:RT @hconceicao:RT @chriso:microsofts desire to clone OSS needlessly raises the adoption cost for all other OSS in .NET ecosystem


imageI’ll not quote anybody but myself of course:. Usually I’m too lazy when copying things from my mail box, and I think the message is self explanatory now, so, I’ll just quote it and maybe update it later…

You made me notice that @Haacked tweet about jquery is now deleted :D

In case you have been wondering, I mean when he was answering Rob Conery about why Razor, saying that he asked the same guys who started jQuery why not just use prototype.js for their stuff. That was tough!

I understand the case with NHibernate because where it originates from (The Java/JBoss roots, even though they’re not the main director of NH at least now). They had to come with something they own.

I think the jQuery support itself just came because it became the defacto standard all over the web (.NET and others). And because it made their own lives either (developing MS AJAX stuff as jQuery plugins).

But the default is that unless they can acquire it completely (which does not seem to work for OSS stuff for some reason), or they come with their own property. Because they cannot support others. Especially open source. They aim at customers that seek “professional support” here and they want to secure themselves when committing to such.

For Razor itself, I like the cleaner web forms thing, but very scared that they may or may not get this mixed-html-code thing right (don’t think it’s easy, tell me all the dynamic kids are doing so, but still.. I’m not sure MS will do it right). Also I hate “@”, even more, I hate having to escape “@” with “@@” if followed by some text that the parser can understand as code. This is really ugly. Much love the Spark ${ } style, but they won’t do something similar, as they want to escape { } / < > / <% %> open/close style. Just hope they change “@” to something less common and get the parser right.

There is a website for HTML templating stuff I’m building for a friend for some time now (paused as the friend had a higher priority project for me now). People are uploading HTML files that include Spark syntax (against a defined model with user friendly property names) and I created a couple of helper classes to read the files, get Spark engine to translate them.

It was very easy for the test designers to get started with it and they loved it that a friend designer wanted all templating stuff (email templates, etc..) in the current active project we’re doing together to use Spark also. I will probably use Razor for MVC stuff, but not abandon Spark as a great templating engine.


Spotting the Positives / New Stuff

Not sure whether this part should have come first, but to be fair, there are some good “NEW” parts expected to come with Razor. I have referred one on twitter in a reply to @Orangy (the main guy behind Resharper, the must-have plug-in for all Visual Studio Versions).

Quoting from Phil HAack’s post on Razor:

one benefit that I look forward to is that unlike an ASPX page, it’s possible to fully compile a CSHTML page without requiring the ASP.NET pipeline. So while you can allow views to be compiled via the ASP.NET runtime, it may be possible to fully compile a site using T4 for example. A lot of cool options are opened up by a cleanly implemented parser.

Also, Scott Guthrie put a comment reply to his own post about why Razor may be better for unit testing your views (if you think you want to):

The Razor parser and view engine can be instantiated and used outside of the ASP.NET application domain.  This means you can directly instantiate and use it within a unit test project without any dependencies on running ASP.NET. 

From a unit testing perspective you can indicate the view template you want to run, supply it with any dependencies, and then pass your own test models/viewmodels to it and have it run and render back a string to you. You could then verify that the correct content came back.  This would isolate the views from your controllers and any data access, and allow you to also isolate them from the runtime environment.  View engines in ASP.NET MVC VNext (both Razor and the .ASPX one) will also support and integrate with dependency injection as well.

Different people have differing opinions about the usefulness of verifying the HTML that comes back from a view using unit tests.  For scenarios involving a lot of javascript something like browser based testing is probably better.  But for basic coverage it can be useful.  It also helps verify that you don’t have compile errors or other runtime boundary errors with your views.


It’s worth mentioning that the guy writing the Razor parser seems to be a really smart fun guy. See his own writing on the parser.

Other (Better) Notes I Have Read

Some of the people who shared similar notes and I agree with (to different extents)…


So, now, what are your own thoughts?