
ASP.NET MVC, Web API, Razor and Open Source - johns
http://weblogs.asp.net/scottgu/archive/2012/03/27/asp-net-mvc-web-api-razor-and-open-source.aspx
======
acak
I am a developer who has leaned towards .NET over the last few projects and
one of the things that used to nag me is that the platform is a closed one
(and the licensing fees can be a decent part of the cost). I was fairly
certain I would migrate off it if the project ever took off seriously.

And after seeing the C# love on HN on the poll for favorite programming
languages last week, I realized there must be many enamored .NET programmers
who would use and evangelize it more but only don't due to it being a closed
platform.

Also, a lot of us have great ideas to make the platform we're using better -
and with Microsoft announcing they'd make Json.NET, a third party JSON
library, the default JSON serializer over their home-grown
DataContractJsonSerializer in the next version of ASP.NET MVC, I wondered if
Microsoft was considering the unthinkable: start accepting community developed
features into their platform, and perhaps open source it to make the scope for
community contributions even larger.

There's a long way to go to fully realize this vision (I'd like for .NET itelf
to be open source ;-] ), but this is just incredible news.

For those who want to understand which parts of the ASP.NET stack are open
source, check out this diagram on Hanselman's blog that was very useful to me.

[http://www.hanselman.com/blog/VisualStudio11BetaInContext.as...](http://www.hanselman.com/blog/VisualStudio11BetaInContext.aspx)

~~~
cameronh90
> Microsoft announcing they'd make JSON.NET, a third party JSON library, the
> default JSON serializer over their home-grown DataContractJsonSerializer in
> the next version of ASP.NET MVC

Finally! For those who haven't used it, DataContractJsonSerializer has the
most absurd way of serialising dictionaries into JSON. Rather than producing
{"k1": "v1", "k2": "v2"} it produces [{"Key": "k1", "Value": "v1"},
{"Key":"k2", "Value": "v2"}]

~~~
JamesNK
> DataContractJsonSerializer has the most absurd way of serialising
> dictionaries into JSON.

DataContractJsonSerializer is a hack that is built on top of an XML parser.

For the people who are unfamiliar with .NET there is a comparison of Json.NET
to Microsoft's two JSON serializers here:

<http://json.codeplex.com/> <\- Json.NET homepage

------
stevear
Also worthy to note that Microsoft's BizSpark program provides free production
access to Microsoft tools and products-- not Express editions but versions
like Visual Studio Ultimate, SQL Server Enterprise, Windows Server Enterprise,
etc. You also get a couple thousand free hours on Azure if you want to go that
route. For training you also get three months of Pluralsight which brings you
up to speed on the relevant tools and platforms.

I feel it's a really good time to be a Microsoft developer. The products are
really solid, the skills are in demand and the barrier to entry is pretty much
gone.

I realize after writing the above I come off as a big time evangelist, but
this is only because I have had such a good experience for the last decade
building on their platforms. Never regretted going all in other than sometime
feeling like a black sheep on this site. Good to know there are a lot of other
.Net folk on this site. ;)

~~~
gfodor
Wait until the bill comes.

~~~
lancefisher
After three years, you get to keep some production licenses as well as all the
software you downloaded for free. You get four Windows Servers and two SQL
Servers. This really is a great program. You can read more here:
<https://www.microsoft.com/bizspark/About/Graduation.aspx>

~~~
jongalloway2
Yeah, there's a common misconception that there's a big bill coming at the
end. There isn't - you get to keep the software you used during the 3 years
for no charge and you get discounts if you need to buy more.

~~~
gfodor
Uh, there _is_ a big bill coming at the end. You need to keep your system
running, even though you now have to pay for licenses, don't you?

When building your system during BizSpark, you are unlikely to make
architectural choices with respect to software licenses, because they are
free. Then you graduate, and you're probably looking at a system that uses way
more licenses than it would have if you had to optimize around that parameter
from the get go.

BizSpark is an excellent move by Microsoft, and likely is helpful for folks
starting out who already know the .NET stack. But I'm very skeptical that
working in the Microsoft stack offers such a technical advantage that it is
worth the risk that your business is not going to be in a position to suddenly
have its operational costs bloated by software licenses by some arbitrary date
determined by Microsoft.

~~~
jongalloway2
Yes and no. The point is that you're not retroactively billed for licenses you
got while in the program. Believe it or not, a lot of people seem to think
that it's just a delayed payment program. Yes, if you're designing a system
that's going to require more than 6 servers you might end up paying for a
license. Windows Web Server runs ~$470. But for many businesses, if you're
using >6 servers you're likely going to be deploying to some cloud hosting
solution, or possibly using a shared hosting service (which would include
licenses).

It's a tired example, but StackOverflow really is an example of a startup that
got a lot done with very few devs or servers and launched a very successful
business. Also key is that you can mix and match technologies as you want,
something that the StackOverflow used very intelligently (e.g. Microsoft
server fronted by non-Microsoft reverse proxy, etc.).

~~~
meow
Not to mention, most startups either fail in 3 years or (hopefully) be in a
position to pay for the extra servers.

~~~
rbanffy
It would be interesting to measure if the odds of failure somehow correlate
with chosen technology stack.

~~~
meow
Considering that most startups fail for reasons other than technical (running
out of money, lack of traction, founders moving on) I don't think any
correlation will be that meaningful. It will be interesting see a plot of the
type of the startup (social, b2b, retail etc) versus the stack though :)

~~~
rbanffy
I am not so sure technology stack is entirely unrelated to failure rate. The
stack you pick may influence iteration speed, hosting options, developer
availability, uptime, reliability, security and costs.

Twitter would have failed had their scalability problems persisted.

In fact, I remember "Six Degrees". It was more or less Facebook, but in the
late 90's. IIRC, they ran Cold Fusion on Windows.

~~~
hkarthik
Some say that Friendster failed mainly due to scaling issues.
[http://highscalability.com/blog/2007/11/13/friendster-
lost-l...](http://highscalability.com/blog/2007/11/13/friendster-lost-lead-
because-of-a-failure-to-scale.html)

------
jroseattle
> start accepting community developed features into their platform

Guthrie has done a great job of making developers on the Windows platform feel
included and involved. While Microsoft's product offerings slip, Guthrie
continues to grow the community of developers, maybe not in quantity but most
certainly in quality. Before Guthrie, an offering like today's announcement
never would have seen the light of day.

~~~
jinushaun
I'm not too familiar with what Guthrie has done for the .NET community, but
Hanselman is a famous proponent of open source and making .NET as fun to code
in as ruby and python. His coming to MS has changed the way I look at the .NET
stack.

~~~
Michiel
And let's not forget Phil Haack (<http://haacked.com>), who is now working at
GitHub. He used to be the program manager at Microsoft for ASP.NET MVC, the
first part of the ASP.NET framework to be released under an open source
license.

------
edwinnathaniel
I'm a long time Java developer who recently move to .NET. What I love about
Java when it comes to this particular issue: open source, is how easy it is to
get the source code, documentation, and to navigate around given 2
assumptions:

1) You're using Maven + Eclipse (haven't tried in other IDE)

2) The source code is available (in most cases, they are) in Maven repository

Here's a simple example: I'm using Spring and Guava and occasionally I'd like
to navigate to the method I use. All I have to do is hit F3 on the method call
and Maven will download the source code JAR (and the documentation JAR as
well) and voila: I can easily see the source code and navigate around. Ditto
with the dependency of the dependency.

I have to say that Maven + Eclipse provide massive productivity increase for
me and my team.

Now, I did .NET in the past briefly back when .NET was in 2.0/3.0 era. I
recalled it wasn't obvious how to associate even the core .NET library
(Collections, etc) via VS.NET.

How easy it is to achieve a similar workflow in .NET these days?

~~~
ghiculescu
Resharper can do the same: <http://www.jetbrains.com/resharper/>

~~~
edwinnathaniel
ReSharper can download source code over the internet or do I have to setup
things manually? put them in the right place, etc?

~~~
TeHCrAzY
Its automatic. If it can't get the source, it will use its built in
decompiler, and produce surprisingly readable source anyway (I force it to
this mode by default, due to a flaky internet connection).

~~~
edwinnathaniel
How does ReSharper managed to locate the 3rd-party source code?

Does ReSharper have their own source repository or some sort?

~~~
solutionyogi
As the parent listed, Resharper by default will download MS sources for BCL.
For a third party, it will show the decompiled source.

------
rufugee
I would consider paying for .net if it received first class treatment on
Linux. As someone who has lived through the pain of hosting apps on Windows, I
just refuse to do it in the future. I'd love to see Microsoft bring Mono into
the fold and truly bring it to the level of the Windows .net implementation.

~~~
dos1
What part of hosting apps on Windows was painful to you? I actually prefer to
host my apps in Windows when I'm able and the technology stack supports it. I
don't need to set up new apps often, but when I do, it's many orders of
magnitude faster for me to get an app running on Windows vs. Linux.

Linux works great as a server OS once I get everything set up and configured
correctly. I never need to think about it again. However, I _dread_ having to
set things up on a new Linux machine. There's always some hardware that
doesn't install correctly or some config file that needs twiddling. Sometimes
it takes an odd sequence of commands that needs to be run in just the right
order to get things going. Invariably I waste hours on the internet searching
forums every time I do this, getting more and more frustrated the whole time.

As far as Windows hosting goes, I find IIS 7 to be much easier to set up and
customize than Apache in terms of hosting web applications. I find the uptime
of Windows Server boxes to be functionally equivalent to their Linux
counterparts. I also find it's much easier to administrate large groups of
Windows servers because of the nice tooling. Things like Active Directory, SMS
and SCOM make things pretty easy.

~~~
rufugee
I currently run a company (on the IT side) with 100+ servers...a healthy mix
of both Windows and Linux. To write-up the benefits I see of Linux over
Windows would take a fairly long blog post...perhaps I'll do that soon.
However, I will say that the last time I had a Linux hardware problem which
wasn't related to a display driver issue (and in other words, not on the
server) was in 2006. Our Linux servers are reliable, easily configured
(admittedly....we know what we're doing) and have very high up times. Contrast
that with our Windows servers which at this point we've had to resort to
weekly reboot Windows to keep them performing.

Personally, I also find it much easier to find help online with Linux when
things _do_ go wrong...and that Microsoft (wisely) makes the whole experience
very painful unless you're willing to pony up for their more expensive "tiers"
of software. As an example, even though DFS-R is included in Windows Server,
try managing a real, live deployment given what you're provided with just
Server. Unless you purchase SCOM, your _will_ fail.

~~~
rufugee
That said, Microsoft got one thing very right: active directory. If someone
were to develop a similar solution which could manage both platforms, I'd buy
it tomorrow.

~~~
edwinnathaniel
Identity Management and SSO are two area that once one can install them
successfully, that's pretty much mark the point of no return :D.

Consultants love these kind of projects!

------
tlianza
What will be interesting to see is how well Microsoft acts as a steward of the
project. I can't count how many bugs I've seen on Microsoft Connect sit
untouched for years.

Assuming they're not being fixed due to lack of _development_ resources,
perhaps this will help. If it's any other reason, including test resources,
management resources, or overall project priorities - a move like this is
unlikely to be significant.

If we're just trading a list of ignored bug reports for a list of ignored pull
requests, it'd be difficult to muster much excitement.

------
DrJokepu
This is really great news. Open sourcing Razor means that it can be shipped
with Mono, so the awkward getting-razor-working-with-mono rituals won't be
necessary in the future.

~~~
acak
Indeed - in fact they reached out to Miguel to submit a pull request. :-]

[http://www.hanselman.com/blog/ASPNETMVC4ASPNETWebAPIAndASPNE...](http://www.hanselman.com/blog/ASPNETMVC4ASPNETWebAPIAndASPNETWebPagesV2RazorNowAllOpenSourceWithContributions.aspx)

------
josephcooney
I wish they'd open-source WPF, so at least if they won't fix the performance
issues with it I could fix them myself (or at least coerce someone with enough
skill to fix them for me).

------
notJim
I had a hell of a time trying to actually use the ASP.Net MVC sourcecode on a
project a while ago. The problem was that while my own project compiled fine,
many of the dependencies I was using were built against a signed version of
the ASP.NET MVC DLL. Since the version of the DLL I was using wasn't signed
(with Microsoft's key), those dependencies wouldn't work against the version I
was compiling. If you compile everything from source, this isn't a problem,
but I had a number of dependencies that had been distributed as DLLs, and for
reasons now obscure to me (but likely due to time pressures), I wasn't able to
replace all those dependencies with source.

I guess the moral of the story is that if you're in .Net land and want to take
advantage of this, make sure you do everything with source from the get-go.

------
jackfoxy
I've been strictly in management for a few years now, but I like to lead from
the front, i.e. know the technology. It would be painful to trade in C# for
Java and VS for Eclipse. Today I took a quick look at Scala and Clojure. I
think F# for either of those is also not a good trade. There are a lot of
things MS does right. The more MS opens up their technology, the better.

~~~
edwinnathaniel
That is strange. I'm the other way around: it is painful for me and my team to
switch Java/Eclipse/Maven to C#/VS.NET/NuGET since NuGET isn't even close to
Maven.

Not to mention we have to deal with licensing, buying software tools, etc
while in Java land almost all the high quality tools are free, easy to
download, easy to install.

Setting up a new machine is a breeze with SVN/GIT + Maven. A breeze.

~~~
untog
NuGet vs Maven seems like a small issue when compared to VS vs Eclipse or even
C# vs Java. In the latter two, MS wins hands down. I can cope with NuGet.

~~~
edwinnathaniel
With Eclipse, 99% I don't need a mouse to refactor, navigate, build, run unit-
tests within Eclipse or outside, and packaged a rather large codebase and its
dependencies (3rd-parties or not) and Maven contributes to that significant
productivity gain as well.

Eclipse recently also introduced an App-Store clone to download plugins and so
far I haven't had the need to hunt down plugins from the world wide web
(except for the exotic ones).

Granted I'm new with VS.NET, I'm guessing that will not be the case. Somehow
I'm probably still a long way to learn how to utilize VS.NET to the same level
of productivity with Eclipse... and even longer time requires to surpass it...

~~~
lusr
If your entire complaint is that you want short-cut keys then look into the
Tools | Options | Keyboard configuration. I find raw VS.NET pretty lame in
terms of Intellisense, no "jump to file" shortcut, etc. so installing
Resharper is a necessity for productivity. But at that point everything is
indeed keyboard driven.

~~~
henrikschroder
VS2010 has "Navigate to" on ctrl-, which is better than jump to file. It's
jump to anything, type a class name, a method, a filename, a partial filename,
partial anything, and it will match what you write against everything in your
solution. It's really powerful and I don't click around in the source tree at
all anymore.

~~~
lusr
While a vast improvement on the past, "Navigate to" doesn't find stuff
intelligently like Resharper's jump... e.g. if I have a file "LabListView", I
can type "llv" in the "go to" window and it'll be highlighted (I could type
any combination of characters but I tend to use the capitalised letters).
VS2010 just shows an empty list when I do that -- I have to type a complete
partial name.

I could also be imagining this, but I have the feeling Resharper remembers
which files are related when I select them from this list because if there's
more than 1 match it almost always seems to have the right one at the top of
the list based on my current context.

~~~
edwinnathaniel
FYI, Eclipse also does partial the way Resharper does out-of-the-box: semi-
partial and abbreviation.

I believe Eclipse also does "best match based on previously opened files"
(sort of heuristic/guessing) just like you guessed the way Resharper does it.

I wouldn't be surprised if Resharper added Eclipse's features that are missing
from VS.NET being that JetBrain makes IntelliJ that competes with Eclipse.

Of course the best part of Eclipse is that it's free and you get everything :)

------
prezjordan
Looking for some HN insight here. I'm still a college student interested in
startups. However, microsoft products really don't excite me. Can someone
explain the benefits of C# to a Ruby on Rails coder?

~~~
gecko
Good parts: C#, and the entire .NET stack, completely skewers Ruby from a
performance perspective, while not putting your coding in a straight jacket
like Java does. You'll also find what in my opinion are vastly more powerful
debugging and profiling tools, awesome threading support (be sure to check out
both C# 4.5's async/await keywords and the existing Rx library at
<http://msdn.microsoft.com/en-us/data/gg577609>), better versioning, better
IDEs if you're into that kind of thing, and more.

Downsides: While this is gradually changing, I don't consider _server-side
Mono_ production-ready, so you'll be both developing and deploying on Windows.
Deploying on Windows may prove expensive, but BizSpark
(<http://www.crunchbase.com/product/bizspark>) will let you avoid that _well_
past the point where you should either be successful or have VC, making it a
non-issue. The community isn't as library-happy as the Ruby community,
although that's definitely changing; one side-effect of that is that, where
Microsoft anticipated your needs, life is beautiful, but where they haven't,
things can get painful.

I'd see my previous answer to this question at
<http://news.ycombinator.com/item?id=3405362> too.

~~~
MatthewPhillips
> better IDEs if you're into that kind of thing, and more.

With the caveat being you have to be into that kind of thing. Coding C# not-in
VS (or MonoDevelop) is not fun.

~~~
gecko
It depends, actually. For stuff I write in my spare time, it's actually
perfectly easy to write C# in Emacs and drive the compile with a short waf
script instead of a solution. You'll pick up at least some csproj files if you
grab packages from NuGet, but it's not horrible to manipulate them in nxml-
mode, and again, it's easy to keep all of your own stuff in simple waf files.

The downside of going this route, of course, is that using VS.NET or
MonoDevelop can be a bit of a pain. When working on Kiln, I instead do most of
the actual _editing_ in Emacs, and use VS.NET as a solution
manager/debugger/decompiler. Not ideal, but functional. You'd also have to go
that route if you wanted to use Azure, I believe, since I seem to recall they
want the solution file, not the assemblies.

------
chazandchaz
I can't believe all the .net love lately.

------
tathagatadg
I've not written code on windows for years now, but today for started off with
a .NET project - for an course assignment (.NET mandatory). I wasn't that bad
- looks things can be completed fast enough here, however kept feeling itchy
all the time that finally saying yes to closed source platform ... Came back
home and now its open source. Thank you!

------
eblackburn
I wonder if Phil Haack's exodus was the straw that broke the camels back?
Perhaps this was just the leverage Scott Guthurie required to finally get what
that team has craved for some time?

------
obtino
It's good to see that it's been released under the Apache License:
<http://aspnetwebstack.codeplex.com/license>

~~~
noveltyaccount
Also they're using Git, which is HN approved :)

------
zinssmeister
this is awesome news for the .Net community.

------
ittan
This is a good sign of things to come. Changes at Microsoft?

------
ksajadi
Meh.

------
zentechen
Way too many Microsoft haters. BE OPEN MINDED. C# is a tool, like computer, as
long as used to solve real world problems, who cares who's behind it? It's
like how Apple fanboys are saying Object-C is the most awesome programming
language in the world, totally biased.

~~~
zentechen
Down voted as expected. Hater, identify yourself or be a coward.

------
zentechen
> I am a developer who has leaned towards .NET over the last few projects and
> one of the things that used to nag me is that the platform is a closed one
> (and the licensing fees can be a decent part of the cost). I was fairly
> certain I would migrate off it if the project ever took off seriously.

Can you explain why? Is it because the only reason it's closed? You just hate
MS.

~~~
zentechen
So all people who use Oracle database would also abandon Oracle since it's
close source?

