DCSIMG
IronShay

Slides and Code Samples from my Talk at LIDNUG - What?!? C# Could Do That???

On Thursday I had the honor to do a virtual talk at LIDNUG – the LinkedIn .NET User Group. A stage where lots of .NET celebs like Scott Gu, Jeffery Richter, Jeff Prosise and others have talked in the past.

I’d like to thank all the attendees and the LIDNUG crew who made this possible – Inbar, Peter and Brian – you guys rock!

About the talk – I focused on the dynamic capabilities of C#. Started with some black magic done using the dynamic keyword, then moved on to practice witchcraft with the combination of IronRuby and C#, and ended with the new and shiny .NET spell-book also known as project “Roslyn”.

The talk was recorded and it can be found on YouTube:

The code samples from the talk are also available – click here to download them [2.47Mb].

I had a blast, hope you did as a well.
All the best,
Shay.

My Sessions at NDC2011 and Upcoming Gigs at GOTO, SDC and LINDUG

It’s been a while since NDC2011 took place but I figured out I’ve never officially published the slides and videos from this incredible event. First and foremost, I’d like to thank Program Utvikling for having me as a speaker second year in a row – you guys ROCK! this year’s conference just strengthened my belief that NDC is the best .NET conference out there. So if you have one conference you wanna go to, this is, IMHO, your best pick.

image

Anyway, I had two sessions this year – IronRuby FTW and Ruby on Rails vs. ASP.NET MVC:

IronRuby FTW!!!

Thanks for the attendees that chose my session over Scott Guthrie’s – very much appreciated! :)

Abstract:
Ruby has been a home for some great innovative frameworks like Ruby on Rails, Cucumber and Rake. In this session you will get familiar with the IronRuby language and its amazing ecosystem and you will learn to take advantage of it in everyday tasks like testing, building, enhancing current code and more. Come and see how IronRuby makes your development life better and happier!

Slides:

Videos: Dowload MP4

Ruby on Rails vs. ASP.NET MVC

I had lots of fun preparing for this session and doing it as well. Apart from my comparison, I ran a little scoreboard during the session and asked the audience a few times to vote for their favorite framework – ASP.NET MVC won by 1 vote! this is not a huge surprise – even though Ruby on Rails is still ahead in terms of community and external packages, the fundamentals of both frameworks are pretty solid at the moment and quite similar…

I did this session a year ago (with MVC 2.0) at Epicenter2010 and Ruby on Rails won 8 to 2… So this result is a very good sign that ASP.NET MVC is in the right direction – Good work Microsoft!

Abstract:
Last year was the year when two great web development frameworks arrive at the .NET world – ASP.NET MVC 3.0 and Ruby on Rails (via IronRuby). It is the time to get to know these frameworks and learn their advantages and disadvantages. In this session, Shay Friedman will walk you through the good, the bad and the ugly of both frameworks providing you points to consider when coming to choose one of them.

Slides:

Videos: Download MP4

Upcoming Gigs

In the next month I’m going to present four sessions in three different conferences and locations. If you’re around, come say hello.

GOTO Amsterdam – October 13-14 (Amsterdam, The Netherlands)

GOTO Logo

I’m going to run a single session – “ASP.NET MVC 3 Hidden Tips, Tricks and Hidden Gems”. You’ll also be able to find me on the conference party, the Meet the Speakers event and generally where they serve beer :)

Time and place: October 13th, 13:20-14:10, Foyer room.

Abstract:
The ASP.NET MVC framework has been around for more than two year now and has been constantly gaining popularity since then. However, despite that fact a lot of MVC developers are not aware of various hidden gems that can make their development experience much easier and nicer. In this session we will go through some of those which were added in the latest version – ASP.NET MVC 3.

ScanDev on Tour – October 18th (Stockholm, Sweden)

Very excited to come back to Sweden (too bad it’s not gonna be snowy, though :) ). On ScanDev on Tour I’m going to present two sessions – “ASP.NET MVC Hidden Tips, Tricks and Hidden Gems” and “Introduction to Ruby on Rails”:

Session: Introduction to Ruby on Rails
Time and place: 10:30 – 11:20, Web Room
Abstract:
The most famous Ruby–driven framework is, by far, Ruby on Rails. In the last few years this framework has been gaining popularity and now is a great time to get to know it. In this session, Shay Friedman will build an entire Web 2.0 site from scratch while using and explaining the key features of Ruby on Rails. Come and see what Ruby on Rails is all about and what's made it the success it is today.

Session: ASP.NET MVC Hidden Tips, Tricks and Hidden Gems
Time and place: 13:30 – 14:20, .NET Room
Abstract:
The ASP.NET MVC framework has been around for more than two year now and has been constantly gaining popularity ever since. However, despite that fact, a lot of MVC developers are not aware of various hidden gems that can make their development experience much easier and nicer. In this session we will go through some of those which were added in the latest version – ASP.NET MVC 3.

LINDUG – November 17th (Virtual)

LINDUG is the .NET group on LinkedIn. I’m going to run a LiveMeeting 90-minute session – “What?!? C# Could Do That?”.

Time and place: 12PM – 1:30PM (PT)
Abstract:
.NET 4 has brought us the DLR and C# 4 has brought us the dynamic keyword. With their powers combined, C# suddenly gets super powers!
In this session Shay Friedman will show you surprising and practical things you can do today with C#, the dynamic keyword and the DLR.
Registration (free): http://lidnug-shayfriedman.eventbrite.com/


All the best,
Shay.
Posted by shayf | with no comments

My Leading Candidate for Worst C# Feature – Method Hiding

I love C#, I really do. Of course is has its little annoying quirks here and there, but in general it is, IMHO, one of the best static programming languages out there. Having said that, one thing that makes me wonder “WHAT THE HELL WERE THEY THINKNING?!?$?!?” every single time is the feature known as “Method Hiding”.

What is Method Hiding?

Method hiding, in short, is the crippled, mentally-ill brother of method overriding. For example, look at the next code:

class A
{
  public string GetName()
  {
    return "A"; 
  }
}

class B : A
{
  public new string GetName()
  {
    return "B";
  }
}

Class A has a GetName method; class B inherits from class A and implements the GetName method as well. 
Look carefully at the GetName method signature in class B – do you see the new keyword there? this means that the method doesn’t override the implementation in class A, it just hides it. What does that mean? read on.

So What’s the Big Deal? Hide, Override… Who Cares?

There is a huge difference in the behavior of method hiding and overriding. Look at the next two samples:

Method hiding vs. Method overriding

The left part is a method hiding example, and the right part is a method overriding example. Now let’s go through the use cases.

First – using the father classes:

FatherHidden fh = new FatherHidden();
fh.GetName(); // = "A"

FatherVirtual fv = new FatherVirtual();
fv.GetName(); // = "A"

Both are available and return the same result. Good.

Second – using the son classes:

SonHiding sh = new SonHiding();
sh.GetName(); // = "B"

SonOverriding so = new SonOverriding();
so.GetName(); // = "B"

Again, both methods return the expected result. Swell!

Third – using polymorphism – storing an instance of the son classes in a father class variable and calling the GetName method:

FatherHidden fh = new SonHiding();
fh.GetName(); // = "A"

FatherVirtual fv = new SonOverriding();
fv.GetName(); // = "B"

See that? the hidden method (FatherHidden.GetName) had suddenly woken up, took over and returned “A” instead of the expected “B”! kicking polymorphism out the door while doing it!

Is It a Problem?

Yes, it is. I’ve never found any reason to use method hiding and I can’t think of a good reason start using it in the future. OOP is great and I can’t understand why we need ways to screw it up. In my opinion, if you get to a situation where you need to use method hiding, re-think your design and start over.

This is not just a cute code smell. It can lead to nasty bugs along the way. For instance, I came across something like the next piece of code when doing a code-review lately:

class Base
{
  public bool IsAuthenticated { get { return false; } }
}
class SomeAuthClass : Base
{
  public new bool IsAuthenticated { get { return CheckAuthentication(); } }
}

Now, as long as they use SomeAuthClass variable types on their system, everything will work fine. But once a developer comes and wants to use some OOP magic, all users will immediately become unauthenticated. And this is no fun. No fun at all.

One of my major problems with method hiding is that it is C#’s default behavior – you don’t even need to write the new keyword. And even if the method on the base class is marked as virtual, and you forget to mark the method on the inheriting class with override – you fall back to method hiding…

#sadpanda

What I Am Suggesting

I know this feature isn’t going to disappear. Ever. I’m sure some people have found a reason to use it like there’s no tomorrow and Microsoft is one of the best in keeping their products backwards-compatible.

However, I would like:

  • To get a compilation error if a method is going to hide another method and is not marked with the new keyword.
  • To make the method hiding feature obsolete (yes, obsolete!) and get a compilation warning when using this feature in future versions of the framework.
  • You to stop using method hiding.
  • Everyone to recycle more and save the planet!

All the best,
Shay.

kick it on DotNetKicks.com Shout it

Posted by shayf | 1 comment(s)
תגים:,

Windows Azure Tip: The "DeleteCurrentDeployment" task failed unexpectedly

Recently I’ve been helping a client to migrate an existing web application to the Azure cloud. We’ve been facing several different obstacles along the way, but most of them were technical. However, today we got to our first “DUDE, I HAVE NO IDEA WHAT’S GOING ON” moment – we got the next error when trying to build the Azure project in Visual Studio:

“Error 1  The "DeleteCurrentDeployment" task failed unexpectedly.
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.OLE.Interop.IServiceProvider'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{6D5140C1-7436-11CE-8034-00AA006009FA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).”

*crying inside*

Searching the web resulted in a very few unrelated cases with crazy solutions - I even tried to run regsvr32 on all of the DLLs in the system32 folder… which didn’t help. At all.

*crying out*

Anyways! 2 hours later I had everything working again! How? read on…

The Solution

There is actually nothing fancy about the solution… The thing that worked for me was uninstalling Windows Azure SDK and Windows Azure Tools for Visual Studio and then reinstalling them. That’s it.

*tears of joy*

All the best,
Shay.

Posted by shayf | with no comments
תגים:,

Please Use TryParse and Avoid Parse+Try/Catch

Recently I’ve run into a piece of class which was operating as the central place for type conversions in the system. While the idea of having such a class doesn’t sound like a problem, the way it’s been implemented definitely is.

Most of the conversion methods looked something like that:

public int ToInt(string value)
{
  try
  {
    return Int32.Parse(value);
  }
  catch
  {
    return DefaultValue;				
  }
}

I took this method for a test drive – I executed it within a loop and put a stopwatch before and after. The next chart demonstrates the results (X=number of loop iterations, Y = execution time in milliseconds):

Parse with try/catch execution time chart

100,000 calls to this ToInt method takes about 10 seconds!

This implementation would have been acceptable if there were no other solution for doing this stuff. But there is ALWAYS another way! and this time this way has a name – TryParse.

TryParse will achieve the same result like Parse but with one major difference – it will not raise an exception once the conversion is unsuccessful but instead it will return false. Changing the ToInt method implementation is quite easy:

public int ToInt2(string value)
{
  int result;
  if (!Int32.TryParse(value, out result))
  {
    return DefaultValue;
  }
  return result;
}

And now, when I re-run the test drive code I got blown away by the results – look at that chart:

TryParse execution time chart

The time for 100,000 conversions dropped from ~10 seconds to ~20 milliseconds! that is about 500% faster!!!

This is the joined chart, which makes the results crystal clear:

Joined results: TryParse vs Parse+try/catch

Conclusion

There is a single conclusion to this post: avoid using Parse+try/catch and start using TryParse. As simple as that.

All the best,
Shay.

kick it on DotNetKicks.com Shout it

Posted by shayf | with no comments
תגים:

Upcoming Gig: Expert Days 2011

בחודש הבא אני אשתתף בכנס Expert Days שיתקיים בפארק אזורים בפתח תקוה. הכנס הוא למעשה חמישה ימים של סדנאות פרקטיות בנושאי פיתוח שונים ומאורגן על ידי חברת E4D. תוכלו למצוא בכנס נושאים כמו פיתוח לווב, לענן, לטלפון ועוד.

BannerExpertDays

אני אעביר בכנס כשתי סדנאות:

  • HTML5 – בסדנה נעבור על היכולות החדשות של HTML5 ונראה איך ניתן להשתמש באפליקציות שלנו כבר היום.
  • Porting Applications to Windows Azure – בסדנה זאת נעשה מעבר קצר על היכולות של הענן המייקרוסופטי, Windows Azure, ונתמקד בעיקר בתהליך העברת אפליקציות לענן - מתכנון המעבר ועד להתאמת שיטת העבודה לפלטפורמה החדשה.

בנוסף לסדנאות שלי, יש עוד המון סדנאות מעניינות כמו:

  • ASP.NET MVC – אייל ורדי
  • Architecture 101 – אלון פליס
  • XNA – ג’וש ראובן
  • Windows Workflow Foundation 4 – ערן סטילר

להרשמה לסדנאות וצפיה ברשימה המלאה, בקרו באתר הכנס - http://expertdays.co.il

 

ודבר אחרון, לפני תחילת הסדמאות יתקיים אירוע פתיחה חינמי ופתוח לכולם עם הרצאות keynote מעניינות, אפשרות זכיה בXBOX וקינקט ועוד הרבה דברים טובים! להרשמה.

 

לסיכום, נושאים מעניינים + מרצים תותחים = AWESOMENESS!

 

נתראה שם!
שי.

Posted by shayf | with no comments
תגים:,

Upcoming Web Developers Community (WDC) Meeting: ASP.NET MVC

לחצו להרשמה לאירוע

ביום שלישי הקרוב, 17.5, אדבר על ASP.NET MVC במפגש קהילת מפתחי הווב. המפגש יתקיים במשרדי מייקרוסופט ברעננה ויתחיל בשעה 17:30.

תכנית המפגש היא שתי הרצאות בנות 75 דקות כל אחת. ההרצאה הראשונה תהיה הרצאת מבוא על ASP.NET MVC המיועדת למי שעדיין לא יצא לו לשמוע על תשתית הפיתוח הזו או שרוצה להעמיק את ידיעותיו על האפשרויות והיכולות הטמונות בה. ההרצאה השניה תהיה יותר מתקדמת עם הרבה קוד ובה אני מתכנן להציג כל מיני טיפים ויכולות חבויות של ASP.NET MVC שיכולים להקל עליכם ולקצר את זמן הפיתוח.

טכנולוגיה, קוד, אנשים טובים… הולך להיות כיף!

להרשמה אנא מלאו פרטיכם באתר http://mvc3-efbevent.eventbrite.com/. שימו לב שכדי לשריין עבורכם חניה במשרדי מייקרוסופט, דאגו להרשם עד יומיים לפני האירוע (עד יום ראשון הקרוב).

 

האג’נדה הרישמית של האירוע:

17:30 - 18:45

MVC 3 - עולם חדש ומבטיח

עד לפני שנתיים לערך תחום פיתוח האתרים בעולם המייקרוסופטי היה די ברור וידוע מראש - Web Forms הייתה האפשרות היחידה עם כל יתרונותיה ועל אף חסרונותיה. אך מאז הגיחה לעולם תשתית שונה בעלת זוית ראיה אחרת על כל צורת פיתוח האתרים - ASP.NET MVC. מאז יציאתה, צברה התשתית הזו פופולריות באיטיות אך בנחישות וכיום כבר לא ניתן להתעלם ממנה - יותר ויותר מפתחים בוחרים להשתמש בה על פני תשתית ה Web Forms הותיקה. בהרצאה זו נבין מה זה ASP.NET MVC, מאיפה היא הגיעה פתאום, למה זה טוב, מה היא מכילה ומה חדש בגירסתה האחרונה (גירסה 3).

18:45 - 19:00

הפסקה

19:00 -20:15
ASP.NET MVC - טיפים, טריקים ואוצרות חבויים

בהרצאה זו נכנס לנושאים יותר מתקדמים ולהרבה יותר קוד! כאן נעשה דרכנו דרך טיפים וטריקים פרקטיים שיעזרו לנו בזמן הפיתוח. נראה יכולות חשובות של Razor, סוגים שונים ושימושיים של HTML Helpers, שימוש בתבניות לתצוגה ועריכה של ערכים, ספריות NuGet שימושיות ועוד.

 

נתראה שם!
שי.

Posted by shayf | with no comments

Forget 42, –1 is My New Answer to Life

I’ve just stumbled upon the next code statement – Thread.Sleep(-1). It left me wondering what was happening there since MSDN tells you nothing about a –1 value for the milliseconds parameter:

“The number of milliseconds for which the thread is blocked. Specify zero (0) to indicate that this thread should be suspended to allow other waiting threads to execute. Specify Infinite to block the thread indefinitely.“ – System.Threading.Thread.Sleep, MSDN

To check that out, I opened the IronRuby interactive console and filled in System::Threading::Thread.Sleep(-1) and hit Enter just to find out that this call blocks the thread indefinitely. Could it be? –1 is Infinite?

Reflector to our aid! oh wait, RedGate now charges money for it and had planted a time bomb inside the free version which made it stop working. grrrr
ILSpy to our aid! (I highly recommend ILSpy as a Reflector alternative… very similar, free, oss… great community effort!)

Anyway, ILSpy proved my concerns:

System.Threading.Timeout.Infinite Value

So… –1 actually represents Infinity (when it comes to threading in .NET). And Infinity is much cooler than 42, hence –1 is the new answer to life.
Q.E.D.

All the best,
Shay.

Posted by shayf | with no comments
תגים:,

Razor Tip #2: Output Text in Code Context

Razor, the new ASP.NET MVC view engine is incredible. I like it. A LOT. Great work Microsoft!

In this series of posts I’m sharing some handy tips and tricks that can enhance your experience with this new view engine. Enjoy!

The Problem

Razor is the place where HTML and C# live together in harmony. This is, in my opinion, one of the things that make razor the great view engine that it is. However, there’s a fly in the ointment. Assume you want to output “Good Morning!” if the hour is between 6AM and 9AM:

Razor Tip #2

But oh no! Razor thinks “Good Morning!” is code!

The Solution

Razor has a special solution for that problem. Three different solutions for the matter of fact:

  • Writing the text inside an HTML element – razor knows to differentiate between C# and HTML so if you wrap the text with an HTML element, everything will work as expected:
    Razor Tip #2
  • Adding the “@:” symbol at the beginning of the line – using this symbol will tell razor that this line is an output line and should not be treated as code:
    Razor Tip #2
  • Using the special <text></text> element – when you want to output several lines within code context, it becomes irritating to use the “@:” symbol… For that you’ve got the special <text></text> element which tell razor that its content is to be outputted as HTML. Notice that the <text> element will not be outputted to the final HTML output.
    Razor Tip #2

All the best,
Shay.

Posted by shayf | with no comments

Razor Tip #1: Explicitly Stating Statement Boundaries

Razor, the new ASP.NET MVC view engine is incredible. I like it. A LOT. Great work Microsoft!

In this series of posts I’m going to share some handy tips and tricks that can enhance your experience with this new view engine. Enjoy!

The Problem

You have to output a variable value and add some markup content immediately after it. For example, assume you have a variable holding a value representing a font size and you want to output it inside a style attribute, as follows:

image

But oh no! Razor can’t tell the difference between our fontSize variable and the “px” text that follows it so it will go look for a variable named “fontSizepx”!

The Solution

To solve the issue, we need to explicitly tell Razor where the variable name ends, or in more general terms – where the statement starts and ends. We do that by putting the variable name between parentheses:

image

You can also use the parentheses trick to output small code statements like these:

image 

All the best,
Shay.

Posted by shayf | with no comments
תגים:, , ,

LINQ Tip: Chain Ordering

Assuming you have the next code:

public class Person
{
  public string Name { get; set; }
  public int Age { get; set; }
}

public class Whatever
{
  public void Do()
  {
    var people = new List<Person>
                  {
                     new Person {Name = "Shay Friedman", Age = 27},
                     new Person {Name = "Shawn Doe", Age = 51},
                     new Person {Name = "Elvis Presley", Age = 76}
                  };            
  }
}

And now you want to order it first by name and then by age using LINQ. If you were to do that:

var orderedPeople = people.OrderBy(p => p.Name).OrderBy(p => p.Age);

You would get incorrect results:

LINQ Tip: Results when using OrderBy after an OrderBy call.

That’s because the second OrderBy call just overrides the first call results. To fix that, use the ThenBy LINQ method:

var orderedPeople = people.OrderBy(p => p.Name).ThenBy(p => p.Age);

And now everything works as expected:

LINQ Tip: Using ThenBy after an OrderBy call.

All the best,
Shay.

Posted by shayf | with no comments

Wrapping Up my “Swedish Tour”

File:Flag of Sweden.svgI’ve just got back home after a week in Sweden. During the week I had the opportunity to travel the country a bit, to learn a few Swedish words and to speak in a few occasions about ASP.NET MVC, IronRuby and some other technologies. But above all of that, I got to meet and talk with some incredible people! it was such an amazing experience!!! thanks to all of you (you guys know who you are), you made this week one of the best I’ve ever had.

Well, yes. I know I titled this post a “wrap up” and you want the details. So…

 

 

 

Part 1 – Stockholm

The first part of my “tour” was Stockholm. I was invited to Stockholm by Tibi to participate in the unconference he had been planning. It had been snowing in Sweden before I got there so I was welcomed by a lot of snow. And I LOOOOOOOOVE snow! I was sad, though, that it wasn’t snowing while I was there…

Tibi hosted me in his place during my stay in Stockholm so huge thanks to him, to his wife Nicolleta and to his sweet daughters for having me!

On the day after I came we had the unconference in a very cool office in Stockholm. I was impressed that even university students showed up for the unconference! good for you! During the unconference we had very interesting and inspiring discussions about various different and unrelated subjects (in the .NET world). I got to talk about IronRuby and it was very interesting for me to hear the questions and the feedback.

Some photos from the event:

.NET Unconference in Stockholm.NET Unconference in Stockholm

Part 2 – SDC2011, Gothenburg

The day after the unconference, me and Tibi took the train to Gothenburg to participate in the Scandinavian Developer Conference, AKA SDC or ScanDev. We got to an amazing hotel called Gothia Towers in Gothenburg where all the speakers were hosted. The conference itself took place in a convention center that is attached to the hotel. This is how the hotel looks like from outside and the inside:

My room in Gothia Towers HotelGothia Towers Hotel from Outside

On the first evening we had a speakers dinner organized by the conference organizers. They took us to a very nice restaurant and I got to meet and talk with other speakers about technologies, languages (real ones! not just programming languages!) and other stuff. These meetings are the best thing in conferences… the opportunity to chat with people from all over the world (face-to-face) is not something that you run into every day.

Anyway, the next day I had my session, The Big Comparison of ASP.NET MVC View Engines, and it went pretty well. I had something like 100 people attending and had lots of fun. Razor won the poll again, by the way. I wrote another post about the session, in case you want to see/download the slides or code samples.

On the evening we had some food at a nice little restaurant, had interesting discussions and lots of alcohol. Everything is a bit blurry for me from this night… I love conferences! :)

On the second day of the conference I didn’t have any sessions so I got to relax, go to some sessions myself and in general, have fun! In the evening we went to a traditional Swedish restaurant and had some traditional Swedish food. It was a blast!

Part 3 – Swenug (Swedish .NET User Group), Gothenburg

The last part of my trip was the Swedish .NET user group meeting in Gothenburg. I had two ~1 hour sessions, one was about tips and tricks in ASP.NET MVC 3 (or the session’s official name – “ASP.NET MVC Rulezzzzzz”) and the second one was about IronRuby and its possible usages for .NET devs (or in its official name, “IronRuby FTW!!!!!!!”). I must say, these were one of the best presentations I’ve ever had. It felt good, I had an awesome awesome AWESOME time, got very good responses afterwards and even all the demos worked!

Thank you Anders for having me and pulling this off.

Summary

It was an amazing week. I had a chance to speak in front of the great Swedish crowd. I met so many interesting people. I ate a reindeer (sorry Santa). And I got to see snow!

Sweden, I’ll be back!

All the best,
Shay.

Posted by shayf | with no comments

MVP for Another Year!

Two weeks ago I received the email from Microsoft, notifying me that I’m a Microsoft C# MVP for another year!

MVP!
I’m very excited that I get the opportunity to continue and affect future Microsoft releases. Thanks CodeValue, Microsoft Israel and everyone else for the support!

I’d also like to congratulate the other renewed MVPs and the new addition to the list of Israeli MVPs – Shlomo Glodberg. Mazal Tov Shlomo!

All the best,
Shay.

Posted by shayf | with no comments
תגים:,

Slides + Code Samples from my Session at SDC2011

Today I had the honor to talk before the Scandinavian crowd in Gothenburg at SDC2011. My session was “The Big Comparison of ASP.NET MVC View Engines” where I compared ASPX, Razor, Spark, NHaml and the StringTemplate view engines.

Thanks to everyone who attended! I hope you had as much fun as I had!

 

The code samples from the session can be downloaded from my github account: https://github.com/shayfriedman/AspNetMvcViewEnginesSamples

And here are the slides:

A recording of the session should be available on the conference site in a few days.

All the best,
Shay.

My Session at mvcConf 2–The Big Comparison of ASP.NET MVC View Engines

About a month ago I gave a session at the virtual mvcConf 2 event. My session was “The Big Comparison of ASP.NET MVC View Engines” where I talked about the differences between ASPX, NHaml, Spark and the Razor view engines.

The session was recorded and it is available on channel 9: http://channel9.msdn.com/Series/mvcConf/mvcConf-2-Shay-Friedman-The-Big-Comparison-of-ASPNET-MVC-View-Engines (at the time of this writing, it has more than 7,500 views! amazing!)

During the session I held a few polls about the preferences of the audience… the results were kinda interesting. These are screenshots of the results of the individual votes:

mvcConf 2 - The Big Comparison of ASP.NET MVC View Engines Poll #1mvcConf 2 - The Big Comparison of ASP.NET MVC View Engines Poll #2mvcConf 2 - The Big Comparison of ASP.NET MVC View Engines Poll #3

And summing all of them together, Razor got 70% of the votes, ASPX got 13%, Spark 12% and NHaml ended up with 6%:

image

So in conclusion, my prediction is that razor gonna conquer this asp.net mvc view engine market… However, the others will stay relevant and I recommend you to check them out. If they make you happier and more productive then go with them! do NOT hesitate.

Anyway, during the session I promised to post a detailed list of resources about the different view engines – so here it is:

Thanks to all the people who made mvcConf happen! and thanks to all attendees!

All the best,
Shay.

Posted by shayf | with no comments
More Posts Next page »