ASP.NET MVC, Web API, Razor and Open Source
weblogs.asp.net
weblogs.asp.net
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...
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"}]
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
Does anybody have insight on this topic? I'm currently building something that would benefit greatly from user contributions of code, but I'm wary about the legal implications (the project will be a commercial site, and while I have no problem publishing their code if I choose to integrate it into my site to enhance the user experience, I have no interest in publishing the core code for the rest of the site).
Can you further elaborate on that one? Because that's exactly what I would like to do.
1. The GC was poor. There's actually a couple of pieces to this one: it's non-compacting, so your app gradually slows down; and (because it's Boehm) it has to guess at what's a pointer, and sadly just doesn't do a good job, so you gradually leak RAM through no fault of your own. The new GC, which I think is called SGen, is a precise collector, so I assume that it fixes the memory leaks, but it's still non-compacting, meaning you're probably going to want to restart the process every once and awhile to prevent serious heap fragmentation.
2. Mono gradually became unstable the longer it ran. This grew exponentially worse as you added threads.
Both of these issues can be circumvented by having multiple processes in a load-balanced configuration and simply restarting them every once and awhile. Heck, IIS does that with App Pool recycling anyway, and it doesn't have these issues.
The FogBugz team still uses Mono to host FogBugz on Unix systems, I believe by going the reboot-every-so-often route, so I assume they've found ways of living with the above two constraints.
Bug reports also help!
In the meantime, we're working hard to constantly be improving Mono, but the best way to improve free/open source software is to get involved.
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. ;)
Edit - May I ask why the downvote? Would you like more information on my experience or something? I only attempted to validate that this is a real program with real companies going through it.
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.
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.).
Even if you don't have to pay for the first licenses, you'll pay for subsequent upgrades. And designing for the Microsoft makes it harder to migrate to anything else - that's probably why Microsoft invented BizSpark in the first place.
Stackoverflow shows you can get a very significant audience on a half-Microsoft stack, but they have a lot of interesting (as in "different from the ones I have") server management problems because of that. That makes their podcasts much more worth listening.
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.
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.
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?
If you want to step into the source code of other projects however, I don't think that scenario is handled yet. Perhaps a feature to be added to NuGet.
Does ReSharper have their own source repository or some sort?
The open source community isn't very strong so there aren't as many options for a lot of things, and the community has relied on Microsoft to provide most of the tools and libraries.
Also, while C# is a nice language, I don't find it that different that it compels me to use it over other options available elsewhere. Personally, I find F# to be a much more compelling product.
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.
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.
Consultants love these kind of projects!
That's what Puppet, Chef, package management and a host of other tools such as virtual machine images and unattended installs are for.
> There's always some hardware that doesn't install correctly
Most server-grade hardware you buy from reputable sources is exquisitely Linux-compatible. I never had any problem with that.
> it takes an odd sequence of commands that needs to be run in just the right order to get things going
This indicates you are deploying servers without really understanding what you are doing. Your phrase evokes a series of spells that have to be cast in order to conjure the proper demons. Unix machines simply don't work like that - there is no magic.
> Invariably I waste hours on the internet searching forums every time I do this
Buy a good book, read and understand the documentation of the software you use. Hire an experienced consultant to teach you and your team, if needed.
When you understand what you are doing, it is really easy. Every piece is open to inspection and all you need to do is look inside.
> I find IIS 7 to be much easier to set up and customize than Apache in terms of hosting web applications.
Until you need to do something the GUI doesn't allow you to do.
> I also find it's much easier to administrate large groups of Windows servers because of the nice tooling
The tooling is there - you just need to learn it. We use Puppet where I work and we use it to manage our server fleet. Works as intended.
Some test cycles here involve the automated deployment of VMs based on machine templates that are then configured using Puppet. If we were to do that with Windows, those tests would never run.
I imagine a combination of Buildbot and Microsoft's VM container could do it and be automated with a PowerShell script, but I'm not very sure how. Has anyone done something similar to this?
I have found this to be the case for any system that I've had to deal with for a decent amount of time. Simply change odd sequence of commands to odd registry changes (or xml files in IIS), or click these random guis and see if it works. One thing I like about the linux CLI though is that generally once I find the command it really does work.
Usually, it's obvious once you understand what you are doing.
Usually, it's easy to understand what you are doing.
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.
http://www.hanselman.com/blog/ASPNETMVC4ASPNETWebAPIAndASPNE...
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.
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.
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...
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.
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 :)
Eclipse OOB XML editor also has great navigation features such as jump to definition of complex type, jump to class file, jump to xsd, handy if you need to navigate WSDL or web.xml (similar to web.config).
I don't have a lot of experience with ReSharper in VS, but I would assume it brings over a lot of the IDEA features to VS?
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.
With the caveat being you have to be into that kind of thing. Coding C# not-in VS (or MonoDevelop) is not fun.
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.
* Being compiled also means theres a lower overhead to running C# code - there's no interpreter overhead.
* Anecdotally, many large sites (e.g. Twitter) that used the Rails stack have complained that the technology behind the site caused problems when they grew. Conversely, Stack Overflow, a large site using the ASP.net stack has never complained that C# was a problem in their growth. Correlation not causation, maybe, or perhaps the "Rails doesn't scale" mantra came about for a reason.
* Visual Studio is probably hand down the best IDE out there with good reason - Microsoft is heavily incentivised to keep developers using the Microsoft stack so making it hard or undesirable to abandon their development environment is important for it.
Can you explain why? Is it because the only reason it's closed? You just hate MS.