IronShay

Ironing code, geek t-shirts and even presentations!

NAVIGATION - SEARCH

Visual Studio - Past to Present

Recently I‘ve been working at a client site where they are using Visual Studio 2005 for their main project. I’ve gotta say that I was a bit surprised since I haven’t come across VS2005 for a few years… I immediately became nostalgic and decided to share. So I’m proud to present (with help from Wikipedia and the WWW), Visual Studio – from past to present!

The Big Visual Studio Usage Poll

Before we begin, I wanna find out which Visual Studio version people are using. And you want to know too, right? So go ahead and fill up the poll!

Year 1997 – Visual Studio 97

Included: Visual Basic 5.0, Visual C++ 5.0, Visual J++ 1.1 and Visual FoxPro 5.0.

Visual Studio 97

Visual Studio 97 

Visual Studio 97

A funny related resource: Introducing Visual Studio 97: A Well-stocked Toolbox for Building Distributed Apps

Year 1998 – Visual Studio 6.0

Included: Visual Basic 6.0, Visual C++ 6.0, Visual J++ 6.0, Visual FoxPro 6.0, Visual InterDev 1.0.

Visual Studio 6.0

Visual Studio 6.0

Visual Studio 6.0

Year 2002 – Visual Studio.NET

Included: .NET Framework 1.0, C# 1.0, Visual Basic.NET (VB 7), Visual J# 1.0, Visual C++ .NET 2002 (Visual C++ 7.0).

Visual Studio .NET (2002)

Visual Studio .NET (2002)

Visual Studio .NET (2002)

Year 2003 – Visual Studio .NET 2003

Included: .NET Framework 1.1, C# 1.1, Visual Basic .NET 2003 (VB 7.1), Visual J# 1.1, Visual C++ .NET 2003 (Visual C++ 7.1).

Visual Studio .NET 2003

Visual Studio .NET 2003

Visual Studio .NET 2003

Year 2005 – Visual Studio 2005

Included: .NET Framework 2.0, C# 2.0, Visual Basic 2005 (VB 8.0), Visual J# 2.0, Visual C++ 2005 (Visual C++ 8.0).

Visual Studio 2005

Visual Studio 2005

Visual Studio 2005

Year 2007 – Visual Studio 2008

Included: .NET Framework 3.5, C# 3.5, Visual Basic 2008 (VB 9.0), Visual C++ 2008 (Visual C++ 9.0).

Visual Studio 2008

Visual Studio 2008

Visual Studio 2008

The Present - Year 2010 – Visual Studio 2010

Included: .NET Framework 4.0, C# 4.0, Visual Basic 2010 (VB 10.0), Visual C++ 2010 (Visual C++ 10.0), F# 2.0.

Visual Studio 2010

Visual Studio 2010

Visual Studio 2010

The Future

Well, I really have no idea what Microsoft is planning for the next release of Visual Studio or when it’s gonna see the light of day. If someone knows more, tell us in the comments!

Conclusion

Visual Studio has gone a long way, with 7 major released in 13 years. However, I found out when making this post that the general concept and the UI structure have grown up over the years, but haven’t changed drastically. It’s correct, by the way, for all IDEs out there.

This leads me to one conclusion – the tools have, without a doubt, become better, but we’re still coding using the same general concept that was used 10 and even 20 (maybe even more?) years ago.

Will it be the same 20 years from now?

All the best,
Shay.

Share: : kick it on DotNetKicks.com Shout it



Embrace it–JavaScript will Rule the World (Wide Web)

At the moment, we’re witnessing two opposite yet related changes – on the one hand, front-end computers become smaller and more mobile and on the other hand, servers are centralized into large server farms – moved to the cloud.

Web development has changed quite a bit as well – more and more functionality has moved to the client along with the rise of client-side frameworks like JQuery, MooTools and others. Having said that, it seems at the moment that there’s still a lot going on on the server-side of web apps. It does depend on the site, but you can’t deny the fact that postbacks are still a usual practice.

This concerns me. The new cloud era means that we will pay for our server’s computation time, storage and network traffic. Which means that if your developers write inefficient code, you’ll pay more; if your developers consume more network traffic, you’ll pay more; if your designers use high-quality graphics, you’ll pay more; etc.

The immediate effect on web development would be, IMHO, more client-side code. Why? because code that runs on the client doesn’t cost us anything, that’s why.

Postback Vs. AJAX – the Test

To show you what I mean I’ve put up a test – I wrote a very simple page with a form; You write a message inside a textarea box, click submit and your message is written to the server’s event log. Pretty simple.
I implemented this page in two ways:

  • Using a postback.
  • Using JQuery to call a WCF AJAX-enabled service.

The Postback-driven Page

  <%@ Page Title="Home Page" Language="C#" %>

  <script type="text/C#" runat="server">
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
      System.Diagnostics.EventLog.WriteEntry("EventLogger", "Logged: " + tbMessage.Text);
      tbMessage.Text = String.Empty;
      lblThanks.Visible = true;
    }
  </script>

  <html>
    <head>
      <title>DemoApp</title>
    </head>
    <body>    
      <form runat="server">
      <h1>Welcome to Event Logger!</h1>
      <h4><asp:Label runat="server" ID="lblThanks" Text="Thank you!" Visible="false" /></h4>
      Your log message:<br />
      <asp:TextBox runat="server" ID="tbMessage" TextMode="MultiLine" />
      <br />
      <asp:Button runat="server" ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Click" />    
      </form>
    </body>
  </html>

When I click the submit button, about 800 bytes travel to to server and about 1000 bytes travel back – a total of ~1.8Kb (according to Fiddler).

The AJAX-driven Page

The page (I’m using Microsoft’s CDN servers for the JQuery file to reduce network traffic to my cloud-based web server):

<%@ Page Title="Home Page" Language="C#" %>

<html>
  <head>    
    <title>DemoApp</title>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script type="text/javascript">
      $(document).ready(function () {
        $("#submitButton").bind("click", function () {
          $.ajax({
            type: "GET",
            contentType: "application/json",
            url: "LoggerService.svc/Log",
            data: { "message": $("#message").val() },
            dataType: "json",
            success: function () {
              $("#message").val('');
              $("#thanks").show();
            }
          });
        });
      });
    </script>
  </head>
  <body>    
    <form>
      <h1>Welcome to Event Logger!</h1>
      <div id="thanks" style="display:none;"><h4>Thank you!</h4></div>
      Your log message:<br />
      <textarea id="message" rows="4" cols="20"></textarea>
      <br />
      <input type="button" id="submitButton" value="Submit" />      
    </form>
  </body>
</html>

The service:

using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;

namespace WebApplication4
{
  [ServiceContract(Namespace = "")]
  [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  public class LoggerService
  {		
    [OperationContract]
    [WebGet]
    public void Log(string message)
    {
      System.Diagnostics.EventLog.WriteEntry("EventLogger", "Logged: " + message);
    }	
  }
}

When I click the submit button, about 550 bytes are sent to the server and about 250 are send back – a total of ~800 bytes (according to Fiddler).

Result

Postback: 1.8Kb <—> AJAX: 800 bytes.
The postback approach took more than twice the network traffic that the AJAX approach took! a 125% addition!!!
Consequently, in the new cloud era, for every dollar you spend on the AJAX approach, you’ll spend 2.25 dollars on the postback approach (for this very simple example)… The situation is even worst actually because outgoing traffic costs more than incoming traffic.
This all might not seem like a big issue at first, but for high traffic sites which would pay $500,000 for the AJAX-based page it would become a huge issue - they’ll have to pay more than $1,000,000 for the same page that uses postbacks. THIS IS C-R-A-Z-Y!!!

Conclusion

This was a very very very very simplified example but it demonstrates my point very well. Postbacks use far more network traffic than AJAX calls; that’s a fact. And this is the reason why, in the future, their usage will be reduced the bare minimum or even disappear entirely.

This was only a single example and I have no doubt that cloud computing will dramatically affect the way we write code. The change won’t be quick, but it will be drastic as we get there. As soon as the big bosses understand that using a different technology/tool/approach within their development teams reduces costs, they will make the needed adjustments to use it.

And if you’re wondering what’s the first tool you need to save money when moving to the cloud then make no mistake – it’s Cloudoscope!

All the best,
Shay.

kick it on DotNetKicks.com Shout it



Catch me next week at TechEd Eilat

Next week I’ll be around at TechEd Eilat and I’m looking forward to meet, talk, discuss, drink, eat and p-a-r-t-y with you people. So catch me, I’ll be the guy with the laptop :-P

And thanks Microsoft for choosing me to be their guest!

 

See you there,
Shay.



The Big View Engine Comparison – Razor vs. Spark vs. NHaml vs. Web Forms View Engine

One of the cool things about ASP.NET MVC (and other MVC web frameworks) is its capability to change the default view engine with a Microsoft or a 3rd-party one. ASP.NET MVC currently has a few options for view engine alternatives:

  • The web forms view engine – this view engine, with the ASP-like syntax, is the default one for ASP.NET MVC 1 and 2 applications.
  • Razor – the new view engine which will be the default one for ASP.NET MVC 3 applications.
  • Spark – an open-source view engine which aims to seamlessly integrate code and HTML.
  • NHaml – a port of the Ruby on Rails successful view engine named Haml. This open-source view engine aims to replace HTML tags with an easier to read and better organized syntax.

Note: Spark and NHaml are currently available for ASP.NET MVC 2. NHaml also doesn’t support .NET 4 at the moment. I believe that they will become available for version 3 as soon as it is out (moreover, they are open-source so you can help getting there!). Razor, on the other end, is not available on ASP.NET MVC 2 and below.

In this post I’ll go through the basic operations we do with our views and show you how to get them done with the different view engines mentioned above.

Displaying Variable Content

Here I’m comparing the way to present the content of ViewData["Message"] as an html-encoded string.

The Web Forms View Engine

<%: ViewData["Message"] %>

Razor

@ViewData["Message"]

Spark

${ViewData["Message"]}

 

NHaml

&= ViewData["Message"]

 

Conditions

Here I’m comparing the way of writing an if condition to display “<p>Party</p>” between 6AM and 9PM and “<p>It’s bed time</p>” between 9PM and 6AM.

The Web Forms View Engine

<% if (DateTime.Now.Hour > 20 || DateTime.Now.Hour < 6)
   { %>
  <p>It's bed time!</p>
<% } else { %>
  <p>Party!</p>
<% } %>

 

Razor

@if (DateTime.Now.Hour > 20 || DateTime.Now.Hour < 6) {   
  <p>It's bed time!</p>
} else {
  <p>Party!</p>
}

 

Spark

<if condition='DateTime.Now.Hour > 20 || DateTime.Now.Hour < 6'>
  <p>It's bed time!</p>
</if>
<else>
  <p>Party!</p>
</else>

Another way of doing that in Spark (writing the condition inside the <p> tag):

<p if='DateTime.Now.Hour > 20 || DateTime.Now.Hour < 6'>
  It's bed time!
</p>
<else>
  <p>Party!</p>
</else>

 

NHaml

- if (DateTime.Now.Hour > 20 || DateTime.Now.Hour < 6)
  %p= "It's bed time!"
- else
  %p= "Party!"

 

Loops

Here I’m comparing the way to declare a list in the view and create an <ul>-<li> HTML list out of it.

The Web Forms View Engine

<% var list = new List<string>() { "WebForms", "Razor", "Spark", "NHaml" }; %>
<ul>
<% foreach (var item in list) { %>
  <li><%: item %></li>
<% } %>
</ul>

 

Razor

@{ var list = new List<string>() { "WebForms", "Razor", "Spark", "NHaml" }; }
<ul>
@foreach (var item in list) {
  <li>@item</li>
}
</ul>

 

Spark

<var list='new List<String>() { "WebForms", "Razor", "Spark", "NHaml" }'/>
<ul>
  <li each='var item in list'>
    ${item}
  </li>
</ul>

 

NHaml

- var list = new List<String>() { "WebForms", "Razor", "Spark", "NHaml" }
%ul
  - foreach (var item in list)
    %li= item

 

Displaying a Form

Here I’m comparing the way to write a login form. I’m using the login form from the default ASP.NET MVC 2 template (located at Views/Account/LogOn.aspx). Notice that it is based on a model of type Demo.Models.LogOnModel (located inside Models/AccountModels.cs).

The Web Forms View Engine

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Demo.Models.LogOnModel>" %>

<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true, "Login was unsuccessful.") %>
    <div>
        <fieldset>
            <legend>Account Information</legend>
                
            <div class="editor-label">
                <%: Html.LabelFor(m => m.UserName) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(m => m.UserName) %>
                <%: Html.ValidationMessageFor(m => m.UserName) %>
            </div>
                
            <div class="editor-label">
                <%: Html.LabelFor(m => m.Password) %>
            </div>
            <div class="editor-field">
                <%: Html.PasswordFor(m => m.Password) %>
                <%: Html.ValidationMessageFor(m => m.Password) %>
            </div>
                
            <div class="editor-label">
                <%: Html.CheckBoxFor(m => m.RememberMe) %>
                <%: Html.LabelFor(m => m.RememberMe) %>
            </div>
                
            <p>
                <input type="submit" value="Log On" />
            </p>
        </fieldset>
    </div>
<% } %>

 

Razor

@model Demo.Models.LogOnModel

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true, "Login was unsuccessful.")
    <div>
        <fieldset>
            <legend>Account Information</legend>
                
            <div class="editor-label">
                @Html.LabelFor(m => m.UserName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.UserName)
                @Html.ValidationMessageFor(m => m.UserName)
            </div>
                
            <div class="editor-label">
                @Html.LabelFor(m => m.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password)
                @Html.ValidationMessageFor(m => m.Password)
            </div>
                
            <div class="editor-label">
                @Html.CheckBoxFor(m => m.RememberMe)
                @Html.LabelFor(m => m.RememberMe)
            </div>
                
            <p>
                <input type="submit" value="Log On" />
            </p>
        </fieldset>
    </div>
}

 

Spark

<viewdata model="MvcApplication1.Models.LogOnModel"/>

# using (Html.BeginForm()) {
    ${Html.ValidationSummary(true, "Login was unsuccessful.")}
    <div>
        <fieldset>
            <legend>Account Information</legend>
                
            <div class="editor-label">
                ${Html.LabelFor(m => m.UserName)}
            </div>
            <div class="editor-field">
                ${Html.TextBoxFor(m => m.UserName)}
                ${Html.ValidationMessageFor(m => m.UserName)}
            </div>
                
            <div class="editor-label">
                ${Html.LabelFor(m => m.Password)}
            </div>
            <div class="editor-field">
                ${Html.PasswordFor(m => m.Password)}
                ${Html.ValidationMessageFor(m => m.Password)}
            </div>
                
            <div class="editor-label">
                ${Html.CheckBoxFor(m => m.RememberMe)}
                ${Html.LabelFor(m => m.RememberMe)}
            </div>
                
            <p>
                <input type="submit" value="Log On" />
            </p>
        </fieldset>
    </div>
# }

 

NHaml

- using (Html.BeginForm())
  =Html.ValidationSummary(true, "Login was unsuccessful.")
    %div
      %fieldset
        %legend Account Information
        %div.editor-label
          =Html.Label("UserName")
        %div.editor-field
          =Html.TextBox("UserName")
          =Html.ValidationMessage("UserName")
        %div.editor-label
          =Html.Label("Password")
        %div.editor-field
          =Html.Password("Password")
          =Html.ValidationMessage("Password")
        %div.editor-label
          =Html.CheckBox("RememberMe")
          =Html.Label("RememberMe")
        %p
          %input{type="submit" value="Log On"}

 

Conclusion

This was a quick comparison of the most basic features of the web forms view engine, Razor, Spark and NHaml. As you could see, they all support the same things but each takes it to its own direction.

Which one did you like the most?

All the best,
Shay.

kick it on DotNetKicks.com Shout it



IronRuby and IronPython are Officially Handed Over to the Community, IronRuby Tools for VS is Out and More!

I’m so happy! finally some good news about IronRuby!

As you might know, IronRuby and IronPython got to a dead-end inside Microsoft a few months ago, a move that set a firestorm within the community which demanded Steve Balmer’s head on a stick (yea, we’re loco here in the DLR land!). Since then we lived in uncertainty regarding the future of these languages, walked among the crowd with tears in our eyes and prayed every night to the God of open-source to help us in these horrible times.

But yesterday evening everything changed! and changed for the better!

When Open-Source becomes Open-Source

I’m thrilled to say that Microsoft announced yesterday that they were handing IronRuby and IronPython over to the community! completely! And not just that, there will be new coordinators of these projects who will lead them to greatness. The coordinators for IronRuby will be Miguel de Icaza and Jimmy Schementi. For IronPython the new coordinators will be Miguel de Icaza, Michael Foord, Jeff Hardy, and Jimmy Schementi. These are incredibly talented people who are capable of taking these languages to great new heights and convert them from “very cool and nice-to-have” to “breath-taking OMFG give it to me give it to me now!!!”.

IronRuby 1.1.1

In addition to the great news from above, IronRuby 1.1.1 has been released yesterday with exciting new and anticipated features.
Pay attention that this version is tagged as alpha, which means that there are still some things that do not work so good or are missing.

Compatible with Ruby 1.9.2

IronRuby is closing the gap with MRI (the official Ruby implementation) and provides compatibility with Ruby 1.9.2. Here, watch:

IronRubu 1.1.1 using Ruby 1.9.2 Features

IronRuby Tools for Visual Studio

So the most voted feature in Microsoft Connect site and one of the main reasons that kept .NET developers away is now a thing of the past. IronRuby can now be developed from within your beloved Visual Studio IDE!
The new tools contain: Ruby colorizer and syntax checker, interactive loop window, directory based project, and templates for common Ruby applications (including Ruby on Rails 3, Sinatra, Gems and Silverlight based browser scripting app). Here, watch:

IronRuby New Project dialog inside Visual Studio

IronRuby Interactive inside Visual Studio

Ruby syntax highlighting and the Interactive console inside Visual Studio

Download NOW!!!!!!!!!!11

Quick! go, download, install and let the awesomeness take over: http://ironruby.codeplex.com/releases/view/49097

Exciting times!

All the best,
Shay.

kick it on DotNetKicks.com Shout it



The Razor View Engine Basics

If you’ve been following me, you probably noticed that I became quite excited with the new view engine of ASP.NET MVC 3 – the razor view engine. If you’re familiar with it then you might agree or disagree with me, but if you don’t then this is a great time for you to make up your mind!

In this post I assume you are familiar with the concept of view engines. If not, please watch this before.

Let’s start.

At Sign (@) Galore

The razor view engine is all about the at sign (@). Unlike the inelegant <% %> signs of the common web forms view engine, here all you need is the at sign.
Basically, starting an expression with the at sign will lead to this expression being evaluated and output the result to the page. For example:

@DateTime.Now

This expression will end up printing the current date and time to the response stream. It is the equivalent of the following web forms view engine code:

<%: DateTime.Now %>
Note
At sign expressions are html encoded!
If you’re sure your output is OK and you don’t want it to be html encoded, you need to provide an IHtmlString object, or simply do:
@MvcHtmlString.Create("<b>BOLD!</b>")

By now some of you might be scratching your heads, moving anxiously in your sits or eating Ben & Jerry's uncontrollably… all of this because something is disturbing you with that line of code… something is missing…

It’s Magic! Magic!!!!!!11

Well, you were right! something is, indeed, missing… we only started the expression with the at sign, but we never told the framework where the expression ended!!! God help us all!!!

Do not worry. This is part of the charm of Razor – if your expression is a single call, there is no need to enclose it in some sort of way, you just write the expression after the at sign (and make sure it’s immediately after the at sign! for example, @ DateTime.Now will raise an exception).

Wait! But what about the times I wanna use blocks of code? or when I want to write out the result of 1 + 1? No problem, I have the solution for you! (how many times have you heard that before, right?)

So for simple expressions like additions (1 + 1, “Shay” + “ “ + “ Friedman”…) you enclose the expression in brackets. For example:

@(1 + 1)
@("Shay" + " " + "Friedman")
A Moment of Truth
What will happen if you write:
@"Shay" + " " + "Friedman"
?
... think for a moment ...
Answer: a "Parser Error" exception. Yes, get used to it.

Now, sometime you need actual code blocks like loops or conditions… and these brackets won’t help you there, son. And look carefully, because this is where it gets a bit… surprising.

Code Blocks and Razor Sitting in a Tree, K-I-S-S-I-N-G

Let’s start with the simplest use case – you want to set a variable within your view. How would you do that? @int a = 1; ? no no no. To do that, you enclose the code block within curly brackets, with an at sign at the beginning of course. For example, the next sample will output 1 to the page:

@{
    int a = 1;
}
@a

This was a very simple sample though… what about conditions for example? I’m glad you asked!

One way to write conditions (or any block of code), is by using the curly brackets solution:

@{
    string s = String.Empty;
    if (DateTime.Now.Year == 1980)
    {
        s = "Man you're so 80's!";
    }
    else
    {
        s = "It's the new millenium dude!";
    }
}
@s

This approach might become handy from time to time, but more commonly we’d want to write something out inside the condition. For these common occasions, you can use the next syntax:

@if (DateTime.Now.Year == 1980) {
    <p>Man, you're so 80's!</p>
} else {
    <p>It's the new millenium dude!</p>
}

Pay attention - it’s code and then html, and then code again, and then html again! Has your brain exploded yet?

So what happened here? in razor, everything blends together elegantly. The idea here is that razor understands when you write code and when you write html and can operate accordingly. This means that the next sample is valid as well:

@if (DateTime.Now.Year == 1983) {
    if (DateTime.Now.Month == 9) {
        <p>Wow, this month Shay is born!</p>
    } 
} else {
    <p>It's the new millenium dude!</p>
}

But this makes you ponder – is the next sample possible:

@if (DateTime.Now.Year == 1980) {
    Man, you're so 80's!
} else {
     It's the new millenium dude!
}

Though one might think it would be a valid razor syntax, it isn’t. This is because razor is smart, but it’s no genius… razor can’t tell if “Man, you’re so 80’s!” is code or html. Think of a sentence like “if pigs could fly” – is this a C# syntax error or plain text? because of this limitation, you have two options to do that – start the html part with html tags (like the previous sample that includes <p> tags) or use a <text> tag as follows:

@if (DateTime.Now.Year == 1980) {
    <text>Man, you're so 80's!</text>
} else {
     <text>It's the new millenium dude!</text>
}

Loops are very similar, too:

@{ var list = new List<string>() {"Razor","Rocks!"}; }
@foreach (var item in list) {
    <b>@item</b>
}

The Twitter Account Catastrophe

My twitter account is @ironshay, what’s yours? WAIT! WAIT!!!!111ONE all hell broke loose!!! TWITTER ACCOUNTS HAVE AN AT SIGN AT THE BEGINNING!!!!

That does it. If someone at Twitter thought about rewriting with ASP.NET MVC, now there’s no chance they’d go for it.

Hold you horses twitter! razor has a solution for you but you will have to write double at signs for that. For example, @@ironshay in a razor file will result in @ironshay in the response stream.

Here you go, Twitter can reconsider.

Read More!

This was a basic introduction to razor. If you liked what you read, I recommend you to read further and become the master of razor!

All the best,
Shay.

kick it on DotNetKicks.com Shout it



5 Reasons to be Excited about ASP.NET MVC 3

It’s already been 6 months since ASP.NET MVC 2 was released and version 3 is already taking shape. I, personally, am thrilled about that because this version seems to put ASP.NET MVC, in terms of maturity and functionality, on the first line along with other MVC frameworks out there like RoR.

I’ve put together 5 main reasons why I’m excited about this upcoming version. What about you?

1. The Razor View Engine

I said it before and I’ll say it again – the razor view engine is so cool!!! I really like the clean code I get when using it. In short, the razor view engine uses at signs (@) to indicate code blocks. For example, these are legit lines of code in razor:

@foreach (var item in Model) {
    <b>@item.FullName</b>
}

 

2. New Helpers

Helpers is an area ASP.NET MVC has been lacking at, compared to other MVC frameworks. MVC 3 will have new helpers that tend to close that gap:

  • Chart – helps creating charts. Very nice!
  • WebGrid – renders a collection of objects as a grid including paging and sorting. Should output a plain HTML table. Hopefully that’s all there is to it…
  • WebImage – helps in creating images. This also contains methods for basic image operations like rotating – cool!
  • WebMail – used to send emails.

The next helpers have been referred to as “task-based helpers”. They should have been a part of the beta version but they’re not there… I hope they’ll make it to the release version because they are just pure awesomeness:

  • Video – contains methods like Video.Flash, Video.Silverlight and Video.MediaPlayer which allow adding their corresponding HTML tags with ease.
  • Twitter – contains basic twitter operations like rendering the twitter stream for a specified user or the results of a given search.
  • ReCapcha – helps using the reCAPTCHA service.
  • Gravatar – helps consuming a user’s avatar from the Gravatar service.
  • Analytics – provides different methods like GetGoogleHtml, GetStatCounterHtml or GetYahooHtml that render the required javascript code for the different analytics services.

3. Support for Unobtrusive jQuery-Based Ajax

In ASP.NET MVC 3, Ajax.ActionLink, Ajax.RouteLink, Ajax.BeginForm and Ajax.BeginRouteForm will use JQuery to connect to the server. In addition, they will not use inline javascript, and instead they will call functions placed within javascript files.

Same thing applies to client-side validation.

4. Better Extensibility with new Dependency Injection Support

ASP.NET MVC 3 will contain numerous extensibility possibilities. Almost anything can be extended using DI, which opens so much opportunities. Just what extensibility means!

Read Brad Wilson’s post for a detailed guide to these new extensibility features.

 

5. NuPack Integration

NuPack is Microsoft’s new packaging system and it is fully integrated with ASP.NET MVC 3. Right click on the References folder in the Solution Explorer and choose “Add Package Reference…”:

The new Add Package Reference option

Now the NuPack UI will open and you can choose from the various different libraries on the online gallery:

NuPack

Pretty cool.

Well, these were my 5 reasons. So browse to http://go.microsoft.com/fwlink/?LinkID=191795, download the beta version and get excited too!

All the best,
Shay.

P.S. I’m not an ASP.NET MVP nor ASP Insider. Everything in this post was taken from various official blog posts and public web sites. Although the sources are as official as they can get (Scott Gu, Phill Haack…) this is only the beta version and as you know, in software – it ain’t over until the very last commit. Therefore, I recommend you check the release notes of every new version to see that no breaking changes were included.

kick it on DotNetKicks.com Shout it



It’s not a Baby Boom, It’s a Microsoft Product Boom!

The last few months were a bit hectic if you stayed tuned to announcements coming from Microsoft regarding new products. It honestly looks like some folks down in Redmond haven’t seen home for a while.

Even though I don’t agree with the need for some of these new products, I think it’s a great thing that the .NET Framework is becoming even bigger than it used to be and we, as a result, get more options. Good!

So what’s new?

May – IIS Developer Express

This is a web server that’s aimed to reduce the amount of unexpected surprises when moving a web application from the ASP.NET Development Server (“Cassini”) to a real IIS Server. It does that by combining features from both servers and giving you a server that’s on the one hand, easy to use and develop on and on the other hand, has a full web server feature set.
Further reading: IIS Developer Express overview, Scott Gu’s blog post

June – SQL Server CE 4

SQL Server CE (Compact Edition) is Microsoft’s free embedded database engine. On version 4 it can, for the first time, work inside an ASP.NET application. This is pretty cool because now you can use it for web sites with a small database instead of messing around with XML files or purchasing an SQL Server hosting.
By the way, this is not a new concept. You could’ve done this before using SQLite, for instance.
Further reading: SQL Server Compact Team’s blog post, Scott Gu’s blog post

July – The Razor View Engine for ASP.NET MVC

For those of you who’re into ASP.NET MVC, Microsoft released a new and cool view engine named Razor. Razor will be a part of ASP.NET MVC 3 and will join to the default web form view engine and the open source view engines – Spark and NHaml.
It provides a minimalistic way of writing views by massively using the at sing (@). I strongly recommend you to check out Scott Gu’s blog post about it to get the feeling of how it’s gonna be.
I believe this view engine will slowly move up to the top of the charts and eventually become the most popular view engine in the ASP.NET MVC world. That’s my take on it at least.
Further reading: Scott Gu’s blog post, Inside Razor Part 1, Inside Razor Part 2, Inside Razor Part 3

July – WebMatrix

This is a web development tool which is targeted mostly to beginners and non-Microsoft developers. By using templates, you’ll be able to create web applications in no-time and without understanding what you’re doing too much.
It’s not really my cup of tea but I guess a lot of people will find it very handy.
Further reading: Official site, Learning materials, Scott Gu’s blog post

August – Visual Studio LightSwitch

LightSwitch is a tool for creating LOB applications without writing any code (unless you need special customization). The result application has a database and uses Silverlight 4 for its UI.
Everything is wizard and designer based in LightSwitch which makes it perfect for beginners (not sure about the others). 
Trying it out took me back about 10-15 years to when MS-Access Forms were prospering. I’ll let you decide.
Further reading: Somasegar’s announcement of LightSwitch, LightSwitch Developer Center, Official Site

August – IronRuby Mess

Well, that’s not a new product actually… But I thought it was worth mentioning here (I’ll let you figure out yourself why I care :-) ). At the beginning of August, the project manager of IronRuby left Microsoft and posted a blog post which kind of set a firestorm on twitter, the blogosphere and I guess internally in Microsoft as well. There were no new news since then, the project is not dead but it is advancing very slow…
Further reading: Jimmy Schementi’s blog post, My take on the situation, Microsoft’s official response

September – Internet Explorer 9 Beta

Microsoft has been slowly losing its dominance in the browser world to FireFox and new kid in the block – Google Chrome. Internet Explorer 9 is Microsoft’s attempt to get back into the game and get these lost percentage back. The beta showcases nice performance improvements, great usage of the computer hardware to display complex graphics and full HTML5 compatibility.
Further reading: Test Drive site, Guide for developers, IE Team blog

September – Web Farm Framework 2.0 Beta

The Web Farm Framework, aka WFF, simplifies the provisioning and deployment of web server infrastructure. The idea here is that you configure everything you need on a single server (called the primary server) and then use WFF to replicate and provision the exact same configuration across all of the other web servers in the farm.
Further reading: Official documentation, Scott Gu’s post

September – Windows Phone 7 Developer Tools

Windows Phone 7 is Microsoft’s try to close the gap with Google Android and Apple’s iPhone mobile platforms. I’ve heard people saying it’s going to fail miserably and heard others saying it’s gonna be a huge success. I honestly have no idea what will happen – on the one hand, it does look like a cool platform but on the other hand, it might be too little too late… time will tell, I guess.
Anyway, this developer tools package includes everything you need to write Windows Phone applications. Even though the actual device is not publicly available at the moment, you will still be able to use the included emulator to write applications.
By the way, the official release date for Windows Phone 7 devices is very soon - October 11th.
Further reading: Windows Phone Development Center, Scott Gu’s blog post, Microsoft Windows Phone 7 Release Date Confirmed

October – ASP.NET MVC 3 Beta

ASP.NET MVC 3 is the next version of ASP.NET MVC. It will include various new features and improvements, making this framework much more mature and ready for mass-usage.
It seems to me that version 3 will finally allow ASP.NET MVC to compete with other popular MVC web frameworks like Ruby on Rails.
Join the party people, MVC is the sane way of writing web applications today (until someone comes up with a better approach).
Further reading: Phil Haack’s blog post, ASP.NET MVC 3 Beta release notes, ASP.NET MVC 3 Road Map

October – NuPack

This one was a total surprise for me… I haven’t seen it coming at all. NuPack is Microsoft’s new packaging system, aimed to ease the process of finding and installing .NET libraries. This is a great addition to the .NET world and something I, personally, have been wishing for. This is very new and I hope it gets adopted by the .NET community. The sooner the better!
This is not a new concept. It has been around for years in the Ruby world (RubyGems) and in the Perl world (CPAN).
I also recommend you to watch the OpenWrap project which is an open-source package manager for .NET currently developed by Sebastien Lambla.
Further reading: Official site, Scott Gu’s blog post, Scott Hanselman’s blog post, Phill Haack’s blog post

I’m sure I missed some products but you get the idea – they’re on fire! 10 new releases in 6 months!

In conclusion, I think it’s good that as .NET developers, we now get more options to choose from and more mature tools to work with.
My wish for the future is that apart from Microsoft making the .NET world better, we will also see the community making the .NET world better with awesome open-source projects.

All the best,
Shay.

Share: kick it on DotNetKicks.com Shout it



The Official Response from Microsoft about the IronRuby Situation

A few days ago someone asked on the IronRuby mailing list if there were news about the future of IronRuby. In return, Tomas Matousek, the last active IronRuby developer inside Microsoft, posted Microsoft’s official position (which apparently was published some time ago):

"At this time, we have no announcements to make beyond what we announced in July 2010 — that we were putting these [IronRuby and IronPython] under the Apache License v2.0. Clearly, there is customer and community interest in these languages. With many organizations running mixed IT environments, we continue to value community feedback on how we can support their interoperability needs, and we remain committed to supporting multiple tools and languages that provide developers with the most choice and flexibility.".

I’m not quite sure what that means but hey, at least we got something :)

Live well and prosper!
Shay.

Related reading: Keep Your Chin Up Child and Wipe the Tears from your Eyes



Upcoming Gig: Ruby on Rails 3 Vs. ASP.NET MVC 2 at AlphaGeeks

On September 19th, which turns out to be the upcoming Sunday, on 18:30 I’m going to give a session at the Israeli AlphaGeeks user group. The topic: Ruby on Rails 3 Vs. ASP.NET MVC 2.

Ruby on Rails 3 Vs. ASP.NET MVC 2

During the presentation I’m going to build two identical web applications with both frameworks and let you, the audience, decide which framework does a better job. It’s a battle till the very end, wouldn’t you wanna be a part of it?

To register to the event, simply email Yuval (the organizer) or register on the dedicated Facebook page.

The event will take place at 10 Haarbaa St. Tel Aviv, 4th floor. Any beverages/food/beer/cute puppies you bring with you will be appreciated.

See you there!
Shay.