First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

August 2010 Blog Posts

Is the Web really dead? No way!

Last week Wired published a long article stating that the Web (as in the thing you get through the browser) is dead, while the Internet is evolving.

I think they are totally wrong for a few reasons:

  1. They prove their statement reading in the stats what they wanted to read: they compare the proportion of traffic instead of the total amount and this leads to the wrong conclusions
  2. They say the web is being taken over by peer-to-peer and video, based, again, on the bandwidth used
  3. Most our time is spent on web sites

Proportion of traffic instead of total traffic

Let’s start from the first reason I think they are wrong: they want to prove their statement with a chart that compares the proportion of the traffic instead of the total traffic.

As the title of the chart says, this is the proportion of the traffic (measured in bandwidth) of all internet traffic. What this means is just that now 23% of the traffic is used by the Web, while in 2000, it was around 50%. According to Cisco, the source used by Wired for its “proportion” chart, the total traffic in the same period grew from nearly half a exabyte (500.000 terabytes) to 7 exabytes. And 50% of 0,5 is lower than 23% of 7.

BoingBoing had an excellent post commenting the chart (Is the web really dead?) and they came up with the following chart.


And as you can seem, the traffic of the “Web” is still growing. Just it’s being joined by other way of using the pipes, video and file-sharing.

Video and peer-to-peer are taking over the web

This page, including images and layout has a size of probably 200-300Kb, and the mere post is probably less than 100Kb. How much do you think the size of this post would have been if I had delivered it via a video? I think it would have been around 5-10Mb: at least 50 times more. If the chart was on the amount of information provided instead of the bandwidth used to deliver it, the statement of Wired would have been even less true.

We spend most of our time on the web

The “Web is dead” is probably true if we evaluate how we use the mobile: most of the web sites don’t work on the tiny display of smartphones. So we are forced to use Apps: there is Facebook for iPhone, Twitter for iPhone, there are dozens of newsfeed readers. But on our desktop computer, we are using the browser: all the social network are standard web sites, we buy books and electronics using web sites, we collaborate on opensource projects using web sites, we book flight using web sites, we read most of the blog post on a web site (either the original one or via google reader).

Sure thing, the web is evolving: it’s not just Geocities pages about kittens. It’s more structured information, it’s more e-commerce, it’s more about interaction between people, it’s more about web applications. Well, isn’t this what we used to call Web2.0?

I don’t think Web3.0 will be the dead of the web. Still not sure what it will be, but definitely not its dead.

Looking ahead

This post has grown longer than I originally thought. So thank you for reaching the end, and I’d be pleased if you could comment writing your ideas on the matter.

And last thought of the post: this article clearly shows that Wired is not unlike the other “internet” magazines. Just sensationalism and half-told truths.

Only parameterless constructors and initializers are supported in LINQ to Entities

Back from the holiday an nice surprise was awaiting for me: I’ve to “finalize” (as in make it work) an application that someone that left the company developed more than one year ago. Among the other problems one real surprised me: the project is built with .NET 3.5 and uses Entity Framework v1 and in some the queries failed with the following strange error:

Only parameterless constructors and initializers are supported in LINQ to Entities.

Just to be clear, it was a runtime error, not a build failure.

The queries that were failing were all, more or less, like the following one:

var photo = (from p in context.PhotoSet
        where p.num == new Guid(id) && p.LangId == langId
        select p).FirstOrDefault();

The code seemed perfect to me: I’m looking for a Photo whose id (a Guid) is like the one provided.

Looking around the web I found a blog post by Muhammad Mosa, “LINQ to Entities, what is not supported?”, which explains that you cannot instantiate new objects through a constructor with parameters (just as the exception says pretty clearly).  Also Julie “Ms. EF” Lerman treated this problem in a blog post titled “A few things you can't do with EF queries which you won't find out until runtime”. But all the samples were about custom objects or complex objects like collections being instantiated with values coming from the query, but in my case I was creating a simple .NET core object with a string coming from outside of the query. So I was still not understanding why my query was failing. But it turned out that also creating the Guid inside the LINQ query is not allowed. So the solution for my problem is:

Guid guid = new Guid(id);
var photo = (from p in context.PhotoSet
        where p.num == guid && p.LangId == langId
        select p).FirstOrDefault();

What I did is just instantiating the Guid outside of the LINQ query and use the variable inside LINQ.

I had this problem with EF1, but given the explanation provided by the team, I guess you will encounter this issue (which is not a bug but is “by design”) in EF4 as well. Which might make sense if you use parameters coming from inside the query, but not if you are creating an object with variables that have nothing to do with LINQ query itself. Can anyone comment on this?

This experience gave me another good reason to continue using NHibernate :)

13 books for a .NET Summer reading list

As last year, before going on holiday I’m list some of the books that are in my reading list. It’s not entirely about .NET book, but will also cover other languages not related with .NET development at all, like Scala or Arduino.

JavaScript and jQuery

I think JavaScript is still the most unknown language among all the ones used to write web applications: mostly due to the fact that it lives in the limbo between developer and designer.

JavaScript: The Good Parts

It seems incredible, but I never read this “must have” book about the man that invented JavaScript. And if a guilty of the same error, you have to do it: you will learn that JavaScript, even when not abstracted away by jQuery, is fun language to work with.

jQuery in Action, second edition

The first edition was in last year edition of this same list, and now the new edition is out: the same goodness of the previous edition, but talking about jQuery 1.4. Another must read book if you are into jQuery.

jQuery UI 1.7: The User Interface Library for jQuery

Another book that I have in my reading list is about jQuery UI. The online documentation is already pretty comprehensive, but having all the samples and explanations of all the options available is still very valuable. One little problem of this book is that it’s still about jQuery UI 1.7.

Web development on .NET

ASP.NET MVC 2 is out since a few months already and almost all the books that came out last year have a second edition treating ASP.NET MVC 2.

ASP.NET MVC 2 in Action

As last year, my ASP.NET MVC book of choice is ASP.NET MVC 2 in Action. The reason is that with this book not only you learn about the framework itself, but also about how to develop a real-world web application, with NHibernate, IoC and all the best practices.
If you are looking at learning “just” ASP.NET MVC probably you might want to have a look at Professional ASP.NET MVC 2 or Pro ASP.NET MVC 2 Framework: even if they lack the ALT.NET feeling of the “in Action” book, they cover the details of framework pretty well.

What’s new in ASP.NET MVC 2

Shameless plug: unfortunately there was no “Beginning ASP.NET MVC v2”, but I still wrote this short eBook to condensate all the new features of MVC 2 for the developers that already knew all the concepts behind the framework.

Beginning ASP.NET Security

If you are developing web applications and don’t take security seriously you should not be doing this job, seriously. This book contains all the information needed to get up to speed quickly on web security: XSS, CSRF, validation and more. It all boils to down to “Trust None”.


One of the reason I decided to organize the NHDay is because I don’t know NHibernate as much as I would like. And here are two books that I really recommend.

NHibernate in Action

It was in the list also last year, but I think I’ll keep it in my reading list again: this is the real Bible of NHibernate and if it refers to an old version of NHibernate (1.2 if I’m not mistaken) most of the concepts are still the same. And if you come to the NHDay you might win a copy of this book, or an hard discount to buy it, since Manning is going to be one of the sponsors of the event.

NHibernate 2.x Beginner's Guide

The “bible” is still about version 1.2, but this book covers the latest version of NHibernate, and has a very nice approach explaining what an ORM is about and how to use the more advanced features of NH like caching and validators.

Other .NET related books

Brownfield Application Development in .Net

Most of us are not lucky enough to always develop green-field applications, and even those who do it, find themselves into brownfield development soon. This is about all the processes you have to do when you enter as an external into a development team and you want to take it out of the “pain” zone: how to setup the source control properly, how to setup CI, how introduce testing, and so on. I really loved reading this book, and I think it’s a must read book for everyone that is interested in working better.

IronRuby in Action

Despite having been unfunded by Microsoft, IronRuby is a very good mean to start learning Ruby while staying in the comfort zone of the .NET environment. Ivan started writing the book almost 3 years ago, and he was also involved in the development of the language itself. And furthermore, this is the only book about IronRuby you can get.As Steve Bohlen points out in the comment, there is also another book about IronRuby around: IronRuby Unleashed

iPhone/iPad development

Professional iPhone Programming with MonoTouch and .NET/C#

I haven’t started reading it yet, but this is probably the next book I’m going to open, and probably taking with me on holiday. iPhone/iPad development is definitely something I want to do more, and Objective-C seems a bit too much for me, even if I already developed a small app last year. And now that MonoTouch is officially allowed by the iOS SDK agreement, this is a really great way to start developing on the iPhone/iPad.

Even more ALT

Programming in Scala: A Comprehensive Step-by-step Guide

Everybody talks about Scala, Keyvan felt in love with it, Ivan stopped doing .NET to work with it: there must be something good in it. So I’d better find it out with a good book.

Getting Started with Arduino

I bought an Arduino kit at the beginning of the summer, but haven’t played with it yet. Hopefully when I finally completely settled up in my new home I can try hacking something up, and maybe build some cool twittering basil watering system for my addiction for pesto.

Will I really read them all?

Will I really be able to read all these books? Hopefully there will be no other changing jobs and moving countries in the next years. I hope you found my recommendations useful.

Announcing NHDay final Agenda

During the month of July we ran the public voting for the agenda of the second track of the NHDay that will happen in October in Bologna.

So, without further ado, here is the agenda of the second track as selected by the attendees:

The agenda for the main track features Ayende and will be all about NHibernate.

Don’t miss the opportunity to attend to a free event on NHibernate with Ayende: if you haven’t already registered, you can still register: there are around 20 seats left.

Is IronRuby being un-funded just the tip of an iceberg?

Today when I woke up and started skimming my twitter feed, I was stuck by a flood of comments about IronRuby being somehow discontinued. Not really killed, but, as Jimmy Schementi says in his post that announces his change of job, moved out of the pool of opensource projects that Microsoft is directly funding. Justin Etheredge already commented on what it means for IronRuby itself, but I want to analyze the fact from an another angle.

Maybe I'm just paranoid, and unfunding IronRuby is just... unfunding IronRuby, but the facts are leading me to think (and might lead also other people to think the same) that Microsoft is going back 2-3 years in time, back investing in tools for Morts and undoing all the good they did to push OpenSource as a viable option.

In the next lines I'm going to tell you what led me to these conclusions.

Back to Morts

In the last month Microsoft released the WebMatrix, a new platform for building web applications, targeted to junior/hobbyist developers. Then they announced Visual Studio 2010 LightSwitch edition, something similar to WebMatrix but to produce Silverlight applications with extensive use of drag&drop and wizards (you can read more about this on Introducing LightSwitch). And finally they also announced Microsoft.Data.dll, a PHP-like data access layer, with lots of sql statements strings mixed with the code, still targeted to the so-called "Morts" (or even pre-morts).

And together with the silent unfunding of IronRuby, this leads me to think that after a few years of trying to make people developer better software, they are back in the business of building tools to help people that have no/little background build applications "quick and dirty".

I hope this is not their new strategy because, while this is good for Microsoft because more developers using .NET means more income, helping Morts build "enterprise" applications is just going to harm the IT market at whole: "good" developers that build well-crafted, easy to maintain and evolve applications will have to compete with these hobbyists that charge 1/4th of the price to build crap. And since most of the clients care only about the cost, we will end up with the IT marked collapsing, even more than now.

OSS is something you cannot trust

But even worse, people might think that OpenSource projects, even the ones developed inside the big corporations like Microsoft, cannot be trusted because they suffer the same problems of the "normal" opensource projects: the main developer can loose interest in it, and the project will slowly die.

What will happen now to people that heavily depend on IronRuby and that fully embraced it because it was "supported" by Microsoft? But a bigger question is: what if Microsoft will start removing resources out from ASP.NET MVC, Ajax Library, MEF, and the still to be released Orchard? Can developers and companies invest in the other opensource projects from Microsoft?

Microsoft made many good steps in the right direction, but with this I think they went back to their original position about OSS.

What do you think? Am I just paranoid? Or do you also think this more than just un-funding IronRuby? I'd love to be proven wrong and to hear your opinions.