Why I Moved Away From Microsoft ASP.NET
ryanbennett.com
ryanbennett.com
That said, the conclusions the author came to may very well be true for classic "Web Forms" projects, and though he noted MVC... i don't feel like he gave it the proper time it deserves. In fact, I find almost the opposite of his sentiments to be true. MVC is a refined platform, and the .NET framework is a joy to work with (personal opinion). Poorly written frameworks exist in any language, but there's also a lot of GREAT code written in .net too.
The platform is expensive, and that sucks... but we sell the product for 100k a pop... so frankly neither our customers or ourselves care about the cost. Developing quickly, and with the best quality possible is more important.
I don't think that Enterprise customers are the problem- they already use MS all the time. It's the small to medium size companies that aren't using it - and as they become larger companies it will become a problem for MS.
Exactly, we've been the bread and butter for Microsoft for a long time. Yet with Windows 8, we're starting to feel like that's just not true... at least that's the sentiment when I talk to some of my colleagues. For instance We built our main product using WPF, today WPF is all but discontinued. XAML is bigger then ever, but only if you want to make a windows store app.
If I leave .NET it's not going to be because some hipster writes an article about python, and how .NET is written by children writing kludge. I know that's not true. It'll be because Microsoft stopped doing the things that made me keep using them.
This is an interesting claim - WPF is still the main UI framework for writing Desktop apps, right? I don't know of any replacement framework that is preferred by MS for authoring desktop apps (I never use any WinStore apps on my Windows 8 devices).
So, not a flurry of cutting-edge development, but very much not deprecated either.
EDIT: Was finally able to get the page to load... I see the author alluded to this: "Yes, BizSpark is a great program for giving free Microsoft stuff to startups. It’s like a drug dealer giving free samples to get you hooked on their expensive and now compulsory wares."
My gut feel is that it was made to allow application developers to build intranet sites without having to worry about the stateless nature of HTTP. The result was a woeful viewstate that got slugged between the server and client, plus all the woeful bloated libraries that came along with it.
I moved to MVC as soon as it was released and have never looked back. My new project ( www.entomic.com ) is in MVC4 with AngularJS, Coffeescript and Scss and it's absolute gravy. Need to expose some DB objects to the client? Two clicks and I have a full set of REST apis for it. Add to that the LINQ javascript library and the whole thing's a cinch.
I also made the switch to ASP.NET MVC and can't imagine ever going back to ASP.NET. The unbelievable clean HTML you get, full control over rendering and rapid development is just phenomenal.
Most of the anti-Microsoft comments I see on HN are of the "but VB6 is terrible!" and "ASP.NET stinks!" variety from people that stopped looking at Microsoft development tools over a decade ago and are still comparing those old tools to their modern competitors.
Because it is still overwhelmingly used today. MS themselves admit that MVC is a tiny proportion of ASP.NET deployments.
The only reason ASP.Net MVC looks good is because you were a WebForms user before. If you've come from other tech, it's still a stinking pile of crap.
1. The API is totally broken and consists of tonnes of barely testable wrappers (HttpResponseWrapper etc).
2. The attribute model is a pain in the arse. How do you test filters based on attributes effectively?
3. Razor is horrible. I mean really horrible. The semantic difference between inline C# code and JS/HTML is so weak that you end up having to hint the view engine as to what is what. Not only that, the Layout system it uses basically stuffs RAM full of string buffers. If you have a complicated page and thousands of users (like we do), memory goes sky high. Please give me something like Jinja2.
4. The ASP.Net pipeline isn't thread safe at all. It's scary actually. You can't guarantee one module won't set global thread state on another thread. This only happens under heavy load. That is one absolute fucker to debug.
5. MS11-100 broke absolutely fucking everything from downloading Excel files in IE8 and below over SSL, knackering caching etc. This is the norm. Stuff just does this all the time. One day it works, next it doesn't.
Now I could spend all day writing this list but I'll surmise it as the whole .Net (web stack) is a stinking shit crock which pains me every day I have to use it.
I LONG for the days someone will hire me based on other skillsets but the market is saturated with people who thought it was a great idea and are stuck with it now.
(For ref the .net desktop / WPF stuff is wonderful in comparison, apart from Visual Studio which crashes on me so often it's just ugh..).
We have 34 projects loaded in the solution so it hits VS's limited 32-bit process restrictions pretty quickly causing the debugger to break miserably. When this fails it's a restart job.
some of our application silos are more complicated than other companies entire businesses are. One subsystem has 450,000 LOC in just c# alone and the domain model has 122 classes.
Stuff gets complicated in some sectors...
I don't think you can fault Visual Studio for not handling that many projects well.
Visual Studio would do fine if it was a 64-bit binary. The memory ceiling of 32-bit processes is the problem. People have been calling for 64-bit Visual Studio for a long time.
That is their fault.
It's possible, just a ton of work, and everyone will have to come along. This was a huge issue with Vista. MS introduces a new way of doing thing, and all the software vendors don't update their drivers to work with it, and now it's MS's fault for having a crappy OS. They will need to make the transition at some point, and the sooner the better IMO.
So I agree with you, but someone on your project should have started refactoring before it got out of hand. Yeah, hindsight is 20/20, and this happens to most projects at corporations. The business doesn't want to pay for something that doesn't make them money. What they never realize is how much money it will save them down the road. One team I was on built in 1/4 of our sprint time dedicated to refactoring things. It was just a part of the business cost so they didn't have to know or worry about it. It worked pretty well for the most part.
@{
/* A bunch of repetitive object creation and casting */
}
Which has happened in every razor project I've seen anyways.As for 1, I haven't really had to write tests around these wrappers yet.
I can't really comment on 2 as we don't use but a couple of pretty simple ones that ARE easily testable.
I'm also really not sure what you mean with 3. If by "hint" you mean use @ as your denotation for C# code, then yeah, I guess you do. I also don't see how it's much different from Rails templates, and in fact I think the syntax is far more readable than rails templates (disclosure: I've not used Rails extensively or professionally) and a marked improvement over JSP/ASP Classic.
4. We've got >20k users who access the site multiple times a day and we've not seen anything indicating thread corruption. Not saying you're wrong, but I'm really not entirely sure what you're talking about, perhaps you could elaborate?
5. I can't really comment on this one either, but I can say for a fact that we currently have users downloading excel files over SSL in IE8 and greater.
I've ben going back and forth between Java and C# in the not-so-distant past and I felt that C# ecosystem is just too limited.
I believe any Spring view plumbering can process several java-based templating languages (Velocity, JSP, JSF, etc).
You did mentioned Spring but in the same breadth with Servlet+JSP which makes me wonder if you're just using Spring-core and not the more modern stuff.
Keep in mind that there's now "flow" based solution in .NET world. "Flow", while it is not the best choice for the whole presentation stack, has it values for developing wizard-like/shopping cart section of your app.
I'm not a fan a Razor either. It's code-centric instead of html-centric. Again, use an alternative view engine like Spark. I think a better recommendation is DON'T PUT LOGIC INTO YOUR VIEWS. You will rarely run into issues if you follow that.
Any issues I've found I have also found fixes for relatively easily. If you run into something that is a framework bug that you can't fix, call up MS and they will issue you a patch that fixes the problem you're having. MS has great support, so don't be afraid to use it.
We both know it's not right to load 34 projects into a solution. It's not something I'd ever do, but it's done by many. I saw it commonly in my clients. My last .NET project I took on about 18 months ago, my client had a Classic ASP/2.0/3.5 chimaera with 50+ solutions, each with up to 40 projects in each. DataSets calling SQL Server stored procs for a data layer. The build process took almost an hour.
It's common unfortunately. Big enterprise, old platform, cluster of code. I stopped using .NET because those enterprises have no desire to fix it.
This is actually the debugger failing to load all the symbols into the vshost process because of the memory ceiling being 3.5Gb for 32-bit processes rather than the IDE failing itself. Unfortunately due to poor isolation in VS, it takes out IIS Express and VS IDE.
Release binaries don't blow it but debug ones with pdbs do. This is a shit when your project is large with long dependency chains.
1. I am not sure why you have problems testing the wrapper classes. I can't say I've encountered issues unit testing my controllers or other MVC specific components.
2. You test the attributes themselves as you would test any other class. Eg you test that OnActionExecuting etc yield the correct results. On your controller, you just need to test for the presence of the attribute, since you already know that it works as advertised.
3. I cannot comment on your claim about the Layout system, but I have absolutely no idea what you mean with the 'having to hint the view engine'. You need to tell it which parts are inline code, and those parts should be C#. Razor has no interest in your JavaScript code.
4 and 5, again, can't comment on these since I haven't encountered them, even though I worked on a number of sites that had moments of extreme high load. In addition, I have found that the number of 'stuff that just breaks' is minor compared to what I've seen in other frameworks. Sometimes things go wrong, but it really is not as dire as you portray it.
My 2 cents, YMMV.
I googled the title and grabbed Google's cache (in text-only form, the real deal wouldn't load for me).
http://webcache.googleusercontent.com/search?q=cache:U8pNBnR...
Why combine a server-side MVC with a client-side MVC?
Honestly the ASP.NET MVC advocacy doesn't make sense to me. It is a solution that half brings .NET developers into the modern era. Using it purely as a service layer is that project essentially trying to maintain relevance in the face of irrelevance.
Also the routing is not RESTful at all and doesn't handle nesting very well, so you have to find a 3rd party routing library or role your own.
If you're developing an API or service, use WebAPI instead. It solves most of the issues people have with MVC. MVC is still simple and easy to use to create services with, and I'd still recommend it to people.
To be fair this can be said for pretty much any project written in pretty much any language or framework.
I work for clients and while I'm tempted to offer new technologies, I'm aware that this client will be using this tool for years, most likely as-is. Stability, maintainability and long term investment is many time more important than gee-whiz tech.
So the business owner relies on the tech provider who hopefully isn't in a full on romance with the newest framework/language just because it's new.
Ruby (the language) and rails (the web-framework) are not the latest fads to come out. Rails hit 1.0 in 2005, a.k.a. almost 8 years ago, ruby is much older.
Although there can be good reasons to choose something new, I agree with your overall sentiment. But we seem to have extremely different views on what constitutes "new"(node might qualify :)
I'll add one more: Googlibility. I don't like to use bleeding edge technology because when I google error messages I get nothing back.
People should focus on integration between components - the argument between language and frameworks died many years ago.
I am a .NET developer like the poster, also been with the framework since the first beta (doing not just web, but also windows development), and I've had my share of frustrations with ASP.NET WebForms as well, but I quickly noticed that I could use Generic handlers (.ashx) to have a stateless experience, unlike the normal pages, which allowed me to add AJAX Handlers that did not suffer all the drawbacks. I just made simple HTML, added my own Ajax Requests (before jQuery) and had a blazing fast web app without all the fake 'state' that ASP.NET WebForms added.
Once MVC came around the corner, you basically get the Generic Hander + a way to properly structure your code. Once the Razor view engine came to be, there was also a way to maintain proper templates.
All in all, ASP.NET MVC has been great; you get all your .NET code for the back end, just HTML5, CSS3 and JavaScript on the front end, and no more fake 'state'.
[1] http://msdn.microsoft.com/en-us/library/w8h3skw9(v=vs.85).as...
We rewrote the entire thing in php (nice php!!) in three days and it's still used to this day without modification (even managed to get through a couple of security audits unmodified).
Sure, big companies still uses WebForms, but what should they to after investing years and years into developing application? Rewrite everything every few years when some new shinny toy comes out?
Companies on the Microsoft stack tend to be extremely conservative. I hardly ever see anyone using these ORMs - I see LINQ-to-SQL or EF, or just as often, inline SQL using DataSets in codebehinds.
I don't think that companies should immediately jump on the next great technology, however there are plenty of companies sitting around on WebForms based on .NET 2.0 (2005) and .NET 3.5 (2007), and a few still on .NET 1.1 (2003). The only reason these companies have not moved onto ASP.NET MVC (or anything else) is because of the sheer cost of doing so. With that comes all of the negatives discussed in the post.
That's why you play around on the side with all the new stuff. Using ASP.NET MVC lets you write much leaner html, without the need for all those controls, et al. They're releasing a lot of cool tools if you follow the blogs, and you can now just as easily create a clean bootstrapped page as you would in other offerings.
http://wordpress.org/plugins/w3-total-cache/
The simplest thing in the world.
That said, I bought a license for MonoTouch, and I'm hoping that I'll be able to use C# for cool stuff in the future. Just with as little of the ASP.NET stuff as possible.
There's nothing wrong with this though. Not everyone has spare time in their lives to dedicate to open source.
The VS MVC templates in vs 2013, come with bootstrap preinstalled which shows the general direction they're going in now.
In all seriousness, it really depends on a lot of things. We've pretty much crossed Oracle from the list because it's just way too expensive, but it's mainly the availability of experts and the ecosystem around SQL Server that makes it an 'easy' choice for most shops in my area.
IMHO - Your article should read more like your customer base has changed, thus your tools have changed.
More importantly I feel like this story has been told already a hundred times.
Im more compelled by the reasons people either stick with or move to ASP.NET. I would agree that for a great many use cases there are potentially better and less costly tools than this stack, and as a .Net contractor by trade I'm (privately) one of its biggest critics. But big (non-tech) businesses love Microsoft (rightly or wrongly), and as a result, in my local market i can provide for my family a lot better by staying put.
I appreciate the benefits of being at the cutting edge, but I feel there are hidden costs for some that aren't obvious.
Only later when I did some WPF project, when Web Forms made some sense. I think the whole toolset is basically trying to lure / accommodate the old Win Forms developer to switch to the web (and in this sense, it's a great success).
These days, I'm trying to run even leaner by using ServiceStack.Razor, as most of the stuff I do is service-oriented SPAs.
Correct, that was the driver behind webforms. Don't forget that the first version of ASP came out in 1996. Bill Gates' "Internet Tidal Wave" memo was in May 1995.
At the time, Microsoft wanted a way to VB programmers onto the web, and still using familiar, easy tools. And staying inside the Microsoft mothership, of course. ASP grew into ASP.NET Webforms. (.Net 1.0 launched in 2002)
If one was familiar with VB or .Net and winforms, ASP and webforms wasn't too much of a leap. But the abstraction was slow and leaky to work with, and the rendered html contained huge hidden state fields and other oddities. So a new generation of devs who grew up with the web generally greeted it with "WTF!". That's where ASP MVC comes in.
IMHO the wheel has turned far since then; On windows 8, JavaScript is a language for developing desktop apps, so that web developers can try their hand at desktop - the reverse of the situation that Webforms set out to address.
That being said, I consciously made a decision a few years ago to force myself to develop with different tools for personal projets. While I think ASP.NET is a great platform, I've worked in enough .NET shops to see that many .NET devs tend to "just" write C#. They're more than happy to dedicate their entire career to Microsoft, and to disregard any progress made on other platforms.
The biggest blocker for me is using Windows to develop applications. I'm also a big fan of Python, but I'd be lying if I said that I haven't struggled with the transition to using Linux to develop. The terminal is just so powerful, and even though Powershell has made Windows a much better platform to script on, I really don't think it can ever match the terminal. Perhaps I'm alone in this, but I would like to be comfortable with the knowledge that if I lost my job, .NET were to stagnate/fall apart, or if I were offered a great job using Python, that I'd be fully capable of putting my .NET hat down and moving into a mid-level role writing Python on a Linux-based environment.
My problem with .NET isn't really a problem. It's a worry that the the Windows platform could alienate me from progress made elsewhere.
I had an introductory course of one hour on Microsoft MVC and the next day I created and deployed a small website from scratch with it. I always basically tell people that are still on WebForms that they don't need to learn something new when they switch to MVC, they just need to forget a lot of the crap they needed to know to work on WebForms. Every day still on WebForms is a wasted day.
The writer seems to have moved from strong typed languages to loosely typed languages. It's pretty unclear to me why he quit using Django and went for JavaScript instead, but the path is pretty clear. I used and use a lot of programming languages and frameworks and I pick whatever seems the most appropriate for the job.
- WordPress for dead easy websites only doing basic stuff - PHP/SLIM/MySQL for very simple webservices - Django whenever I want to do a lot of custom views - Microsoft MVC for larger web projects with a lot of business rules
Statically typed code works better in an IDE as it is easier to predict what code will do (this is one of the reasons Visual Studio with ReSharper is so effective in compile time and pre compile time error checking and refactoring).
I am not sure if I want to maintain all those Node.JS / Ruby / flavor of the month frameworks in eight years either.....probably we will curse it by then too.
http://www.codinghorror.com/blog/2013/03/why-ruby.html
Boiled down to the licensing of the requirements to run the stack, and the whole open-sourceness of it all.
The simple fact is that server is not a priority for xamarin; mobile is. And this is probably a valid optimization.
BizSpark helps though, as far as licensing issues goes.
Is that the general opinion? I've never seen a consensus on mono for MVC.
Like many people, I was also looking to get rid of all the bloat, fortunately now ASP.NET MVC and WebAPI are proper development solutions that play nicely with the web.
In fact there's alot to admire about the new ASP.NET and how it embraces the web.
My web latest app stack is now a Single Page App of HTML/CSS/JS talking to Restful Services (ASP.NET Web API), just beautiful to work with!
JavaScript frees me up, where as with C# I feel like I am in a straightjacket where I am forced to write a lot of boilerplate code just to do something quick (a simple Main requires a class to exist!)
now there are lots of alternatives.. this is equivalent to writing a post about "why i got off windows 98"..
http://www.hanselman.com/blog/VisualStudio2013RCForWebDevelo...
I was going to disagree with the entirety of his post but seems there is no need.
Click bait, glory hunting.
Because its almost 2014?
* under 25