This post was migrated from Justin’s personal blog, 'Codethinked.com.' Views, opinions, and colorful expressions should be taken in context, and do not necessarily represent those of Simple Thread (and were written under the influence of dangerous levels of caffeination).

Most developers that are interested in bettering themselves really do want to hear both sides of the story. They want to understand the strengths of other platforms, not so they can move, but so that they can understand how to make their own framework/platform better. When you read this post, I hope you will read it with that in mind. I hope you will see this not as me criticizing your platform, or someone else’s work, but instead as me saying “here is what I think is cool about this other platform, how can your platform get in on that?”

A Tale Of Two Frameworks

There was a time when Ruby on Rails was the hottest thing on the block, and many ASP.NET developers pined for the day when we could leave behind controls and viewstate and move into the glorious world of web development. Cause what we were doing wasn’t web development, don’t kid yourself. Then ASP.NET MVC came out, and a lot of people (myself included) jumped on that bandwagon and have never looked back.

I have been very happy with ASP.NET MVC for a long time. It gives me a simple to use framework that gets out of my way and lets me write real web applications. And I love it! But there is just one problem, websites are quite often complex beasts and ASP.NET MVC only solves a small part of the puzzle. Every project I start I have to pull in a membership system, migrations, an ORM, an IOC container, logging, testing framework, etc… I have to find and plugin all of these tools every time I want to do build another site. (Nuget has helped with the finding and integrating part immensely!)

I guess this is to be expected though, ASP.NET MVC wasn’t really meant to be an opinionated framework. They wanted to produce a framework which would have broad appeal across the hundreds of thousands of .NET developers out there. Not an easy task! They also wanted a smaller framework that they could release in short cycles. Based on their goals, I’d say that they have done a great job.

But because of this they couldn’t just pick different frameworks and include them as defaults. First of all, there were few choices that would not have been controversial. Secondly, if they had made controversial decisions, the framework would have been rejected by early adopters and not seen the adoption that it has now.

Creating a generic framework is fine, as long as you understand what you are giving up to get there. The power of frameworks like Ruby on Rails, Django, or CakePHP is that they span the whole stack. While this might lock you down to doing things in a certain way, in the end the benefit derived from the tight integration is very often worth it.

Walking Through The Problem

In order to demonstrate this, let’s take the example of authentication in a web application. In ASP.NET MVC we have the normal ASP.NET authentication mechanism which we can leverage in order to have users and roles, but as most of us know, a lot of people end up rolling their own or looking for an outside solution. Why? Because the user is part of our domain, and the ASP.NET authentication system forces us to use their tables, stored procs, db deployment tools, etc… It is clunky and not extensible at all. So let’s say we want to build an alternative, what would we have to do?

The first we need is a model that represents a user, we can either include this in the framework, or maybe just let the user define the class that they need, and then implement an interface for us to interact with. Okay, so how do we get the tables in the database? Well, we could create some scripts and put them in the project, then the developer can run those to create the user tables. That doesn’t seem very awesome, what if they aren’t running SQL Server? Yes, some of us do use .NET without SQL Server. What if they need to automate creating the database for testing? Also, how much does it suck to have to manually run the scripts on every machine you need to deploy to?

Well, we could write code to connect to the database and run the DDL to create a table. That would be more automatic. But again, what database are they running, which connection do we use, how do we let the user modify their user object to fit their needs if we need to create the table? Arrrrgh! Okay, let’s just punt on that and say that we will just create scripts for a few databases, and let the user modify and then run them manually, or integrate the scripts into their build process. That sucks.

Now how do we get the user model in and out of the database? We don’t really know how the developer is going to be doing data access, so we can’t pull the user from the database within the framework, we will have to force the user to implement a class that we can call and get users, in the same way that the provider model is currently implemented in .NET. This isn’t terrible, just inconvenient.

So now we are at the point where we have a database table, and we can pull users from the database. The only problem is that the developer has had to implement an interface on his user object, manually edit and run scripts, implement a persistence mechanism (most likely an ORM), and implement a provider to allow us to perform CRUD operations on users. And we are just getting started! What about creating a controller, views, adding routes, validation, sending e-mails, etc…? There are a lot of pieces that go into a successful authentication mechanism, this isn’t easy stuff.

In the ASP.NET MVC world, all of these problems may seem overwhelming. Sure, we could implement a full solution, but we’d have to make a lot of assumptions and force the user into tools that they might not be using. Or we include our own tools, and bypass their stack in the same way that the ASP.NET providers work. This disconnect is what frameworks like Sharp Architecture try to solve, but third party libraries could never depend on frameworks like this until their adoption reached a critical mass. Otherwise they would be spending a lot of effort, for every little return.

How Would You Do This In Rails?

In Rails there are a few different frameworks available to do authentication. The one that I have used is Devise. In order to use Devise, the first thing we would do is to add the gem to our Gemfile (a gem is like a NuGet package, if you don’t know what a NuGet package is, go here) with a line like this:

gem 'devise', '~> 1.3.4'

Then we just run “bundle install” and the gem is installed into our project. Now we have to configure devise. We can run this command (you can type out ‘generate’ instead of ‘g’ if you want):

rails g

And it will show you all of the generators available to you. You will see a section for Devise. Devise is able to hook into these generators and do some really powerful stuff. We can see from this list that there is a generator for devise called “devise:install”. We can run that:

rails g devise:install

Now Devise has installed its configuration file into your app, and you are almost ready to go. You’ll notice there is another generator just called “devise”, if we run that it tells us to give it a model name so it can generate a User model for you. Because everything in Rails has a place, you simply run this command:

rails g devise User

And it drops User model into your /app/models folder, generates a migration for you, and puts routes into your routes.rb file. Now all I have to do is run my migrations (I can edit the migration or create another migration to edit my user table, allowing me to completely customize my user):

rake db:migrate

And now my database tables are created and everything is ready to go. I can put this on my controller:

before_filter :authenticate_user!

And now that controller will redirect me to a login/signup page, allow me to create an account, send confirmation e-mails (if I want), etc… I also have a number of helper methods that I can run like “user_signed_in?” or “current_user” in order to interact with users on a more fine grained level.

What Happened There?

Well, you saw the power and productivity of a full stack framework. Devise knows what tools you are using (or how to integrate with them), and where everything goes. Because of this we don’t need to tell it how to create a model, create database tables, save/retrieve users from the database, how to connect to the database, how to send e-mail, etc… These are all configuration and sensible defaults that have already been setup in your application.

And for anything that isn’t automated, there are Rails generators that we can hook into to create config files, add routes, views, and any other assets. We are able to do this because most everything has a place in a Rails app. Rails is a very opinionated framework, and it shows. If you follow the “Rails Way” then things will be smooth and super productive.

How Do We Make ASP.NET MVC Better?

That is a very difficult question. You see, the Rails community long ago agreed to go along with the “Rails Way” in exchange for increased productivity and integration. I’m not sure that the .NET developer community would respond favorably to the kinds of changes which would be required to bring ASP.NET MVC up to the level of integration that Rails enjoys.

This doesn’t mean that they can’t come close though. One thing they could do is start to favor certain tools more in the framework. Start to setup conventions and tools that developers are expected to use, and let them know that if they stray, they are on their own. However, the problems here are obvious. The tools that are going to be made the defaults will be Microsoft’s own tools, like Entity Framework or MEF. This could create some serious friction with the developer community if they start to integrate too tightly with these tools.

An MVC Uber-Framework?

Another interesting path would be to see some full stack frameworks spring up on top of ASP.NET MVC. Maybe Microsoft could implement another framework on top of ASP.NET MVC which would be fully integrated, but could be tossed out if you just wanted just the underlying web framework. As long as this framework was simple and powerful enough, you would probably see a large number of developers jump on board, which would give OSS creators a reason to integrate with it. On the MS platform, a tool like this usually has to come from within Microsoft itself, otherwise it has an extremely hard time gaining any momentum.

I can see a lot of eyes rolling and hands shooting up after that last paragraph, but hear me out. If Microsoft continues down the path they are now, and they start integrating things like Entity Framework and MEF as defaults, but not truly integrated, then all we are going to get is a bunch of code generation when we start a project. This isn’t going to help OSS developers extend the framework. But, if they could instead tease out the web layer from the rest, and build a more integrated application stack on top of it, that would go a lot further. I’d love to hear people’s feedback on this.

Will It Change?

I don’t know! ASP.NET MVC is a fine framework. I just don’t feel like it is as productive as it could be. Good, solid, testable web development just doesn’t have to be as hard as it currently is with ASP.NET MVC. ASP.NET MVC has given us a good start on the web layer, but hooking up our applications to this front end is often repetitive, clumsy, and cumbersome. All I want is for my whole stack to play nicely together, is that really too much to ask?

87 Comments

A'braham Barakhyahu

Good article. This also shows what would be needed for client side MVC to be adopted widely.

Reply
Steve Hebert

I love the comparison with the authentication bits – that’s a whole pile of horrible that Msft desperately needs to refactor. We dealt with a couple refactors over the web authentication scheme in our own project- very little has changed since .net 1.1 or 2.0 and it’s very rusty and neglected.

I like the approach the mvc team took with IOC- asked for ideas, even posed the notion of using the CommonServiceLocator and thankfully threw it out.

I’m confused by “build an uber framework” – msft is fully capable of throwing bodies at a problem until it’s a 4 headed monster and we really don’t need that. That’s when we get things like Wcf 1.0.

If things like authentication and other pain points are addressed similar to IOC (implement if you want it), then doesn’t that address the problem equally well? I like the configuration options of ruby, i think it would be interesting if mvc had a congruent internal dsl for wire up with these sort of “core components”.

If this stuff bleeds back into asp.net, then that’s great, but I just can’t see myself doing another standard asp.net web app for the same reasons you list.

Reply
Justin Etheredge

@Steve To me the problem is that a website is a web front end, an application domain, and a data store. Rails gets a huge productivity advantage by implementing all three layers. This allows OSS developers to develop tools which work across the entire stack. The ease of integration, as I showed in my post, doesn’t just stop with membership, but with any number of other gems available. Now, I know that a lot of it comes from the flexibility of Ruby, but being able to count on the ORM, Migrations, etc… would go a long way.

Now I know that there is a huge fear of “throwing bodies at a framework until it is a four headed monster”, but I think the MVC team has shown that this doesn’t have to be the way that MS runs projects. I think they could do it, and do it will, they just need the right people and the right goals.

Reply
Justin Etheredge

@Sampath Yep, I even mentioned it in the post. My problem is that the problem isn’t solely limited to how productive you are when writing code from scratch. A large part of the problem comes from other developers being able to write plugins or add-ons that can fully integrate into your application.

Reply
Cyril Gupa

Hey Justin,

Nice article. I am one of those guys who doesn’t use SQL Server with .Net. I use MySQL. And yes, migrating to mysql was tough in the beginning but I made some shortcut classes and tools of my own which eased the pain later on.

And I have never used forms authentication and many of the custom built ‘shortcuts’ provided by ASP.Net for exactly the same reason as you specified — they’re not so customizable. I roll my own, and frankly I’ve had to write different code for almost every web app I’ve made.

Although I haven’t any experience with Rails cause I work on Windows, and my server is also Windows, and I haven’t been able to find good Rails based tools for Windows… On my limited education I think ASP.net MVC is not entirely bad anymore.

Talking about that authentication example specifically; I use a SigninRequiredFilter in my own apps, which I made myself. I decorate my controller methods with this filter if a Signign is required to visit that page, and it does exactly the same thing as the filter for Rails.

Frankly I hated it when I had to write ASP.Net Webforms code, and I was gravitating more towards PHP every day, but ever since I went to ASP.Net MVC 1 (after a lot of hesitation), I can’t code webforms again. I migrated couple of my webforms apps to MVC cause I couldn’t bear to look at that code.

ASP.Net MVC 3 look good, and the razor viewengine is nice…

In my code I don’t use helper methods opting instead to write pure HTML.

My experiments with ORM like Entity Framework (with MySQL) failed, and I never went the Nhibernate way. I don’t unit test, and I fix when it breaks.

I don’t write apps for enterprise so this works for me because my apps are 100% in my control.

ASP.Net MVC gets a big thumb-up from me.

Any suggestions if I want to use Rails on Windows?

Reply
Steve Hebert

I agree, if any group has demonstrated the ability to maintain focus it’s the mvc team. And i was glad to see them go along with Scott Gu in the reorg for that very reason.

I see the point of ruby having it’s fingers in each of those areas, but I wonder about the extent to take asp.net mvc in that direction and then how to go about doing it. It’s a super-fun conversation to have.

More ponderings than concrete suggestions really:

– I would worry about the “supported technologies” like EF. I work in a non-Msft db environement due to a lack of driver support for our ‘nix platforms. EF could leave us stranded.
– I worry about things like MEF being supported for the same reasons as you (I think): MEF integration should be seen as a part of a larger strategy, and not an end unto itself. The latter creates more concepts to wrap your head around before being productive while the former could provide quickly understood extension points without (hopefully) denying access to more advanced functionality.
– How would nuget have to change to support the kind of integration required?
– If a common internal configuration dsl could be built out, the configurability points with extension methods could be pretty powerful.

Reply
Jesper Blad Jensen aka. deldy

Well I’m sorry, but I don’t really think that this will ever happen ind the .NET space. We are simply to locked on, as you said, Microsoft delivering the ground pieces for stuff.
One of the differences that makes Rails great as a full stack, and what would make ASP.NET MVC horrible, if MS made it full stack. It’s that every little feature in Rails is created because there was a need for it, in a real project.
Then he same person that needed the thing, helps implementing and designing it.
In the MS realm, then the MVC team is just making MVC, maybe some small sample apps, but they are not making a whole company’s apps on it, like 37signals do. If there is a real app being build at the same time, then it will properly be build somewhere else in MS, and they can’t properly mess with the milestones, other that request a feature, and hope that it will get implemented.

I like ASP.NET MVC as well. But if you like a full stack of love, then .NET is simply the wrong platform based on it’s democratic dictatureship (that MS does all) and its culture (I need finished, tested, and used-by-all stuff + I don’t contribute to projects, I just whine).

Even the way that MS is treating Backwards compatibility is a threat. I wrote a little post about it here: http://deldy.dk/post/reversed-backward-compatibility

Reply
Maarten Balliauw

So what you’re saying: if someone created a NuGet package that contains a PowerShell script which, on install, creates a DB table, includes a User model and creates an authenticationfilter (which, by default, is applied on all action methods), ASP.NET MVC is equal to rails? Seems feasible 🙂

More: if you base yourself on the T4Scaffolding and EF code first, creating this package should almot be a no-brainer…

Reply
David Madden

You have totally hit the nail on the head. I had played with rails a couple of years ago, but since working for a Microsoft software house I have been more focussed on their offering.

I have been kicking the tires of ASP.MVC for a while and convincing myself that they had finally done it and produced an offering similar to rails.

Then last weekend I picked up a copy of the newest rails book and it hit me in the face how different the experience was.

With ASP.MVC I spent a lot of time and I mean a lot of time learning about IoC, decoupling and various different methods of talking to databases and had found it difficult to know where to go. Do I use Ninject or Unity or some other library that I have not heard of yet, but someone on stackoverflow thinks is the second coming. If I make any of these decisions is it going to cause me problems later on. By this time I had forgotten the problem I was trying to solve.

With rails the most difficult bit was making sure all my gems were up to date and I was using the latest version of ruby and that was not really that difficult.

I did not have to think about any of the issues faced with ASP.MVC because someone smarter than me has already made the decision and I can live with that. If I cant I can always change it. This allows you to figure out the best way of solving a problem rather than spending all your time building an environment.

Still I do like ASP.MVC. I also feel that NuGet could, and is providing the solution to this issue in the ability to quickly add things to a project.

Reply
Mihai

I would urge you to have a look at orchardproject.net, and then come back to this article 😉

I mostly just browsed through the article, since I feel most of what you claim has been solved using the modularity Orchard offers.

Reply
Simon

The problem is yours isn’t a like for like comparison. You compare an out of the box framework for authentication that someone has put a LOT of time into (Devise), to writing your own.

Your article should compare out of the box in both Ruby and MVC, and then writing a custom mechanism from scratch in both.

I don’t disagree with the point of the post necessarily, just think the example is flawed.

Reply
Justin Etheredge

@Maarten I think you missed the biggest point in my argument. The power of Rails comes from its open source community. The open source community can create the amazing gems that it does in large part due to the tight integration with all of the different pieces. Sure a NuGet package which generated some stuff for me might help me be a bit more productive, but that is kinda missing the point.

Reply
Justin Etheredge

@Simon I wasn’t trying to show an apples to apples comparison. I was trying to show the issues with creating a package like authentication when working against ASP.NET MVC. Then I was trying to show that in Ruby, because of the integration, this kind of thing exists and is super easy. The whole point is that if the integration points were there, you would have to be writing this code! There would already be a “Devise” for ASP.NET MVC.

Sure, I could have shown how to build something similar to Devise for Ruby, and the end result would have been the same. On one platform it is very doable, on the other, not so much.

Reply
Maarten Balliauw

@Justin “The open source community can create the amazing gems that it does in large part due to the tight integration with all of the different pieces.”

Replace “gems” with NuGet packages and you’re at the same level? Seriously: if MS offers ASP.NET MVC 3 and the NuGet feed (or a different feed) contains a series of “NuGems” that, for example, provide security out of the box, it’s identical, no? Nothing is currently blocking the .NET community to jump on that bandwagon?

This is currenty the case already. Need IoC? Install-Package Autofac.Mvc3 or Install-Package MefContrib.MVC3. Need jQuery? Install-Package jQuery. Need X? Install-Package X.

Some of these packages are just simple things that dump a binary in the project, while others really add classes, modify configuration, …

Reply
Justin Etheredge

@Maarten Okay, I think we are misunderstanding. Just providing a package system on top of a web framework does not make it a full stack framework. Did you see in my example how Devise was able to fully integrate itself without hardly any work because all of the pieces are there? It can generate a model (knowing what my ORM is and knowing where my models go), it can generate migrations (since Rails has a migration framework built in), etc… it can do all of these things because all of the pieces are there.

So yes, I can pull in package X and Y, but most likely package X and Y are not going to play well together, and they are only going to provide integration at the web layer, because that is the only thing that they can reasonably know about.

Reply
Maarten Balliauw

@Justin Clear now. Well, I do feel that something like that is possible currently, it’ll only require someone to step up and create some glue work (much like Devise is the glue work in RoR, like Simon said above.

Reply
Justin Etheredge

@Maarten Okay, but how? If I want to create assets in the database, how do I get them in there in a testable, deployable way? How do I create a model? How do I do database access? How do I add routes? This is my whole point. Since ASP.NET MVC stops at the web layer, packages can only integrate so far.

Yes, it would be possible to do all of this in ASP.NET MVC, but we would need a framework built on top of it that included all of these tools, and provided standard places for pieces to go, and provided apis for creating some of these assets. We would also need something akin to generators which would allow us to create assets after the package has been pulled into the application. All of these things are possible, but they need help from the framework.

Reply
Hadi Hariri

@Maarten, @Justin

Forgive my intrusion. I think you both have your points, but if I may:

I’m not an expert on Devise or Rails so please forgive my ignorance. From your post, I’m assuming that Devise only knows how to *integrate* with certain other frameworks, be these the core Rails framework or other Gems. I assume that it knows about your ORM if you’re using ActiveRecord. But tomorrow if I use something else it won’t know. It knows about Migrations because as you point out, Migrations are inherent to Rails.

The point is that, yes, there’s a open source community behind Rails that do provide these Gems. In .NET this has been quite limited for many factors, some of which include Corporate policies, entry to OSS frameworks and lack of experience by many 9-5 “enterprise” developers. NuGet (and when I say NuGet I also mean OpenWrap) have quite a lot of potential to change that and I think it will open up more interaction with MVC and the ecosystem around it.

Up to now MVC was not so opinionated in regard to Models. Some of us like that, others didn’t. Now in MVC 3, that has changed. You want a Model, you have Entity Framework out of the box. Whether in 6 months there will or will not be a Migrations story and how NuGet will interact with it, time will tell. NuGet packages are already taking advantage of this Model story. And I’m sure when and if a Migration story appears, they’ll integrate with that also.

The key here however is that before NuGet/OpenWrap, I’d agree with you wholeheartedly that there was a lot of friction in getting infrastructure code up and running (and I’ve blogged and complained about this myself on numerous occasions). However, now I think things are changing.

Of course, Rails will always have certain privileges being based on a dynamic language, but in terms of packages and interaction, I think we’re not doing so bad in .NET.

Reply
Justin Etheredge

@Hadi I agree completely. Devise is able to do the things it does because these are things built into Rails. Only a certain part of that is due to Ruby and its flexibility. And yes, if I were to move off of ActiveRecord it wouldn’t know how to interact with another framework, except for Mongoid, which it was written to use as well. And it knows where to put things and how to create things for this same reason.

But the point is that 99% of Rails apps use ActiveRecord and migrations. Because they were in the framework and all of the tools out there are built around them. This streamlined approach affords this ability.

And as you said, they are including EF 4 out of the box, but they have to do more than just include the assembly and do a bit of codegen. Cause the problems still exist from the packages, where do I put things? How do I get a connection setup? etc…

The MVC community is making huge strides, and NuGet is a big step. I just think that there is a bigger opportunity out there to make ASP.NET MVC developers much more productive than they are now.

Reply
Justin A

Hi Justin,

# couldn’t agree more #

Every site i start, I explicitly turn off membership/profile/roles in the web.config.

It’s so frustrating how those features were invented in the initial ASP.NET framework and have been kept alive (WHY!?) till today.

The .NET team really really REALLY need to break backwards compatibility and release vNext with some much needed improvements -> very similar to your suggestions. Seriously – who the hell uses windows authentication? (if u dare suggest sharepoint, please go kill yourself). We need to make the framework a bit more plugable AND get some of the basics right .. just like how RoR have some of there basics done pretty damn good.

ASP.NET MVC has been a lifesaver for us MS dev peeps .. and it couldn’t have come sooner because i reakon there would have been so many who were so close to jumping ship. Some already have but lots are staying.

If only we can get some basics fixed up. Try-in point: Create a new ASP.NET MVC3 web site. Now try and handle a custom 404 page. Does that work? No 🙁 (eg. http://bit.ly/lbaqZO ) That’s pretty embarrassing .. if that SO question is accurate.

I just wish MS would think about (the massive number of) start ups/small/mediums instead of just large companies / F500’s. Then we would get some much needed love. Smaller release cycles. More fixes more quickly. etc. etc. U know the spin.

For me, I’m looking to do ASP.NET MVC3 with RavenDb. EF has just killed me .. and this has been after using RDBMS’ for .. well .. since 94.

We all need to be more agile and follow some of the smarts from RoR .. and allow the .NET community to decide what works best .. instead of MS always having to have a solution (which doesn’t always equal the best in the industry .. ie EF, etc). Have some faith in us MS and stick to real core stuff.

Reply
Maarten Balliauw

@Justin, check my talk at http://channel9.msdn.com/Events/MIX/MIX11/OPN07. Forget the point I’m making about enterprise feeds, but do have a look at how I standardized things like authentication into “contracts” shipped in NuGet and how their implementations also come in via NuGet. The only thing it takes is for the ASP.NET MVC community to build stuff similar to my very trivial example and the ball is rolling.
Also look at the scaffolding functions Steve Sanderson is spreading through NuGet. Treating Models like they should be treated, generating data access code (either through EF directly or by generating a repository in between). He’s even generating unit tests for that code. Bottom line: Steve is setting a standard that I see a lot of people are following in the NuGet space.

We’re not there yet, but we’re getting there. And I think it’ll be sooner than people can imagine.

Reply
Justin Etheredge

@Maarten I’ll definitely check it out. And believe me, I want to see ASP.NET MVC get there. I hope that more discussions like this will bring the change around faster.

Reply
Nick Portelli

Well first off if Microsoft made a full stack framework people would be screaming how it sucked and blah blah blah, just because it was Microsoft. Even if the said stack was near perfect. I’m not sure how the Ruby or Rails community is, but the .NET community seems to hate Microsoft and that is the problem. You get people building separate frameworks just because they don’t like how Microsoft did something. I don’t think this is bad in anyway. But personally I get sick of people saying how much Microsoft sucks while still using Microsoft products. Justin, I think you suggestion of building a framework like MVC to be agnostic, THEN building a more opinionated full stack framework is a real good solution. Things are changing at Microsoft, look at Nuget, maybe real community collaboration for other things isn’t far off.

I have a feeling any such effort would be met with disdain and anger though. Look at the reception LightSwitch got.

Reply
Paul

It’s crazy how many intelligent capable devs I see making these same arguments/points. In the end though, I still don’t see any new projects popping up (excluding FuBu MVC). Seems like it is just time to create a new GitHub repo and get to work on a solution, no?

I bet the response from the .NET community, especially the .NET devs now doing Rails work as well would be huge.

Great article and I agree, but I think it is about time to take action and make things happen!

Reply
Rob Conery

@Maarten the notion that “NuGet is there – all we need is the community to step up” has been the response of DevDiv forever. It’s not a bad one – they don’t want to tell the community what to do, which makes sense. They are the music makers – we do the dance.

However that lack of prescription leaves people to wave their arms continually – whereas the Rails guys come right out and say “do it this way dude”.

Many people have tried over the years to change this – namely me – and to drop the pieces in to help things along. For instance – I sent some prototype code to the team to implement and ActiveRecord interface that *any* ORM could plug into.

But an ActiveRecord pattern doesn’t coincide with existing ORM offerings (EF, LinqToSQL which use Unit of Work) – so that doesn’t make sense to them.

You could setup an IQueryable Repository Pattern to build on top of – indeed I did just that (http://mvcstarter.codeplex.com) and I kicked out a free video to show how to build on top of/use the opinionated stack I built.

I don’t want to grumble and say “ho hum no one cares” but really – that *is* the truth. If it doesn’t come from DevDiv, it doesn’t exist. I know it sounds grumbly and negative – but consider that this Full Stack thing is something I’ve been trying to create for years.

It just doesn’t take hold unless Phil and team do it. And they won’t. They build the Frameowork and that’s where their mandate ends.

Reply
Nick Portelli

@Rob that might be where Phil and team leave off but it doesn’t have to mean where Microsoft leaves off. Doesn’t Patterns and Practices already kind of do this? Create the “Do it this way” things? Also a lot of what to use tech wise comes from top down in organizations, from people who don’t necessarily understand that the Microsoft way may not be the best way for a given situation.

For me the real problem is knowing about other solutions. And which one to use when, ASP.NET MVC? FubuMVC? OpenRasta? Or WCF? ServiceStack? etc etc.

Reply
Joe Wilson

This is why Sharp Architecture is appealing to me for green field projects. Sure, it doesn’t cover all infrastructure concerns, but it gets you much further than File > New Project.

Several people have made the point that if Microsoft came out with a full stack, there would be all kinds of screaming.

Instead, would it work for Microsoft to provide common interfaces and registration hooks for these needs (repository, authorization, logging, emailing, caching, etc.) and a default Microsoft implementation, but let developers swap out open source implementations with NuGet that went beyond that default implementation? Maybe something like IDependencyResolver or the EF repository-style scaffolding.

There is still the risk the interfaces become lowest-common-denominator, but it would be a start.

Reply
Aaron Jensen

What if .NET developers stopped identifying themselves as .NET developers? What if they just considered themselves to be developers? I think we’d see a lot less, “how do we get Microsoft X to catch up with Y?” and a lot more “Let’s just use Y because it already does what we want.”

Seriously, the amount of energy being poured into playing catch up is saddening. Imagine if all of that effort was poured into the tool that’s already better at this.

There are no .NET Developers. There are only developers who have been brainwashed into thinking they can only write code in .NET.

Reply
rebootd

It’s difference in MS monolithic thinking, and the Unix-like thinking of small programs that work together.

Reply
Steve

How many projects are build via the RAD Rails methodology ? All your views, domain logic, database access ORM – all thrown into one Rails project? What if you want to separate out and your rails is just a thin layer and you want a service approach – do you create two rails apps and one calls the other ?

I’m trying to imagine create a large application base for a company like I am in .net – where asp.net mvc is but the view layer calling back to many services.

If we want to just to just throw all our data access into one project and use folders then we have MvcScaffolding, EF Code first is doing migrations soon, is you just want some rad scaffolding, look at MvcScaffolding.

You can take the T4Scaffolding and generate EF code first based generation of a complete authentication layer.

I think MS tends to create the framework for the community to build up their own implementations. Nothing is stopping us from building on top of this, just in the same manner dhh wrote rails on top of ruby, I don’t know if he asks ruby to implement rails, no, he took ruby and built rails on it.

There is so much out there, so many opinions on how things should be built. ie. above I heard Sharp Architecture that is everything + the kitchen sink, and then I hear someone like ‘xyz’ (not going to say names) say it’s way overdone.

I do see progress, it took MS over 10 years of me using Hibernate/NHibernate for them to see a ‘poco’ based ORM was a right decision – they went the wrong way with EF1 and now they are making the right progress going the right way.

There was an open source community (still is), called Castle – they built a front controller mvc, called MonoRail – they provide an ActiveRecord implementation that sat on top of NHibernate, and provided the DI glue with Castle Windsor. That has been around for awhile. It is hard to ‘compete’ when everyone was stuck using Webforms and no one would risk moving to MonoRail prior to asp.net mvc. Now asp.net mvc comes out and it’s the greatest thing since sliced bread, and yet I have to laugh that this has been going on long before this new fangled shiny toy 🙂

Microsoft provides the dev tool (only one), the server environment, the entire stack – so people tend to stick to that stack, as they know this big company is committed to it with a ton of developers pushing it.

Where are you running your rails apps – you have a large corporate environment with Linux machines running it ?

This is the same ‘LAMP’ vs. Webform dialog repeat going on again with just some new players at the table 🙂

Reply
Steve

Aaron,

I should add, I can write .net, rails, django/python, java, objective-C, etc… so it’s not really that ‘.net devs can’t write anything else’ – that is a joke.

I think what happens is, we get work that uses a certain technology, we get on projects with those technologies, and we use what those technologies provide. Right?

It’s not very often , especially in larger environments, where I can go in and say ‘hey let’s use Rails’. It’s so much more complex than that unless this is just some startup or smaller shop where you have guys there with some great knowledge of that technology.

But back on topic, MS provides the framework, it’s up to the community to build more on top of it.

Reply
Justin A

Quote @Steve

“But back on topic, MS provides the framework, it’s up to the community to build more on top of it.”

… which is the frustrating thing about it. All the developers I know that work (primarily/only with) .NET .. don’t do _anything_ OSS related. Wait -> i’m not saying 100%/all are like that. Hell no. But (what I feel like) is a far majority. I really feel that developers that (primarily/only work with) .NET just use the spoon fed stuff out of MS. I know for so long I was one of them. Like, if it came out of MS’s quality control and into the RTM, it must pass all the ticks, right? Including ‘best practice’, blah blah blah.

Wrong, IMO.

Which is why I agree with many here and that is that MS needs to provide a much more open framework. Where all the important interfaces are exposed so we can swap out the defaults. MVC is doing this. Want Spark Views – go for it, etc..

To do that, we need to break backward compatibility with the current ASP.NET framework and drop lots of wrappers and cruft to clean stuff up. Simplify lots of shit.

Do we really need ASP.NET to create 404’s AND IIS (7 or express .. forget the others) to ALSO have the ability to create 404’s. (sigh…)

I love working with MVC but i’ve come to loath EF and certain parts of ASP.NET (authentication / membership / 404/500’s …) so i would love it if the parts we want to substitute could be done with zero friction. I will still be paying for my Windows Server license. I just will be using a 3rd party for XXX. Remember, .NET is really only there so people will be renting/buying server licenses, msdn licensees, software licenses, etc. I’ll still be doing that .. just make me want to do that EVEN MORE. Cause right now .. i’m starting to feel very tired about banging my head against so many barriers for simple tasks. I need to create some lovely art – websites and apps. Not figure out why sometimes my custom 404 page shows but with other routes, it doesn’t. Or why i have to step outside of EF to do some serious stored procedure calls or why trying to get my OO domain modelled into a RDBMS makes me want to shoot myself in the head, these days. I’m spending time doing crap i shouldn’t.

I want to paint a nice website. Not fix-up and fight with my paintbrushes. My problems should be what colours or techniques i painted with. What textures I should be using. Not dealing with inferior or complex brushes.

Reply
The Morning Brew - Chris Alcock » The Morning Brew #863

[…] What ASP.NET MVC Could Learn From Rails – Justin Etheredge has been looking at the other side of the MVC fence, exploring Ruby on Rails, and in this post feeds back some of the good things from the Rail platform which he would like to see brought into ASP.NET MVC. Be sure to check out the discussion in the comments of this one. […]

Reply
Paul Cowan

As you pointed out, the fact that ASP.NET MVC is not opinionated is the problem here.

The developer has a blank slate. The fact that rails has a dedicated folder structure means you can easily find all the bits. Contrast this to ASP.NET MVC where everything could be anywhere.

Everything juncture has several choices or more. ORM/Authentication etc, even where I put my files.

Without these sort of guarantees, there is little that can be done. Any movement to unify will be hindered due to backward compatibility.

Reply
brady gaster

Awesome post.

I think the answer to why these things don’t work – or haven’t yet worked – with .NET is that a lot of .NET developers are spoiled. The control thing you mentioned can be used as a metaphor for how .NET began to suck – if it isn’t quick-and-easy a lot of .NET developers will bail out and blame the stack, not their willingness to put forth effort to learn how it works under-the-hood and make it better. “If I don’t have a control that does what I want I will bash Microsoft for releasing an incomplete framework and if they give me a control that does what I want in a way that isn’t commensurate with how I want it to be done I will bitch then, too.”

That’s the reason .NET folks (some of us) have a difficult time adopting opinionated frameworks – we think we are owed precisely what we want, and if we have to code to make it work or to learn how it works well enough to actually DO something, we freak out.

All around insightful post, sir. Find me at #CodeStock for you have earned a brew on me. Or 10.

Reply
Chris Marisic

Justin, I came here after seeing Scott… Hanslemen? Or was it Gu? yesterday that tweeted in response to this blog post that isn’t this all summed in Nuget?

“@Maarten Okay, but how? If I want to create assets in the database, how do I get them in there in a testable, deployable way? How do I create a model? How do I do database access? How do I add routes? This is my whole point. Since ASP.NET MVC stops at the web layer, packages can only integrate so far.

Yes, it would be possible to do all of this in ASP.NET MVC, but we would need a framework built on top of it that included all of these tools, and provided standard places for pieces to go, and provided apis for creating some of these assets. We would also need something akin to generators which would allow us to create assets after the package has been pulled into the application. All of these things are possible, but they need help from the framework.”

I think you’re missing out on some of the aspects of nuget.

Those generators already exist. That is the MVC Scaffholding project.

The MVC Scaffholding project isn’t merely about doing what it does (which is alright, but not great) but it’s about giving you a working project that lets you create your own custom generators to DO ANYTHING.

On your comments about migrations, there’s a nuget package for Fluent Migrator.

So to answer your question “HOW?” would you create a full stack support package. It would probably go along these lines:

Modify MVC Scaffholding to be able to generate the classes you want, when you generate a Model class have it generate a FluentMigrator class also. Make the package dependent on FluentMigrator.

Now I would agree that MVC could use some additional opinionated structure since it’s almost a free for all of where you’re going to drop the generated files into a project etc.

Reply
Craig

I liked the opening paragraph of the article, because I’m all about learning new stuff in an objective manner. Unfortunately I feel like the article pretty quickly devolved into a “isn’t Ruby great” article. You spend a great deal of verbiage showing how difficult it is to set up a custom membership in .NET, then tell us how simple it is in ruby, you just need to type.

gem ‘devise’, ‘~> 1.3.4’
rails g
rails g devise:install
rails g devise User
rake db:migrate
before_filter :authenticate_user!

Why yes, how blindingly obvious that that is all I need to do. Perhaps once you’ve done it a dozen times it’ll become second nature, but please don’t try to sell those incantations and simple and easy.

As others have said (or at least implied), if Microsoft came out and said, “here’s the stack, do it this way” everyone would scream about how “arrogant” they were and how they want freedom to pick best of breed and not have Microsoft shove it down their throats.

I guess I’m just an old curmudgeon (been in this field since the early 80s) but I’m having less and less patience for the entitlement and self-important attitudes I see from (mostly younger) developers.

P.S. Although I’ve pretty much switched to using ASP.NET MVC whenver I can, I still get sick and tired of the WebForm-bashing I constantly see. I know all the “cool kids” have moved on to MVC or Ruby, but please note there are a lot of sites out there built on WebForms that are wildly successful. Once you’re built a buy.com or godaddy.com you can start bragging. Until then please stop telling me how much better you are then the rest of us.

Reply
Justin Etheredge

@Craig I never said those “incantations” are easy to remember, but for what it’s worth they are common commands when dealing with Rails. The ones that aren’t common are documented, but that is going to be dependent on the project you are using.

Sorry you feel that my post is slanted in some way. Yes, I think Ruby and Rails are great tools. But they are also very focused tools. They do one thing, and they do that one thing very well. So I don’t think MVC sucks, on the contrary, I think that for what it does, it also is an excellent framework. All I was trying to say is, it doesn’t go far enough for my tastes.

But hey, all I’m trying to do is point out some gaps that I think MVC has, and what I think it needs. If you, or others, take that as I am bashing MVC then I don’t think that anything will ever get better.

P.S. I’m not a full time Rails developer. Almost all of my work is in ASP.NET MVC.

Reply
Rick Strahl

I think a lot of this is totally overreacting to a problem most people don’t really have. Sure you may have to build custom authentication and logging and configuration etc…. but if you built this stuff correctly the first time you ‘ll be reusing it on your next project. I take that any day over some half-assed implementation that comes ‘in the box’.

While you might ‘waste’ a couple hours setting things up for the first time in a project, what does that really translate to in the lifetime of a typical project? Not much I’d argue unless it’s a trivial project in which case the built-in stuff is probably fine.

We’re software developers – we’re supposed to build stuff that interfaces with our customer’s business problems and not make their business problems fit around the framework we’re using.

Reply
Chris Marisic

@Rick Strahl I agree alot with you. Microsoft especially this past year has given us some of the best tools ever, even if some of the old parts we all replace with lots of good community and MSDN resources.

I also know there is alot of merit to what @Justin Etheredge had to say. I do feel that most of what he said has finally been delivered in a readily feasible and open manner to us with ASP.NET 4, MVC3, Nuget and the MVC Scaffholding package (really as a reference template).

I’m looking forward to see what people come up with and publish with Nuget. I see that we will get alot of the benefits the rails community has, but maybe even with more choices. Especially since people have for years built their notions of how to best work with the ASP.NET pieces they replace, like Membership. Nuget is a brand new day in the ability to create easily accessible software with .NET that wants to be shared and used.

I’ve also seen what people like Rob Conery have done, something as simple as packaging Massive as just a raw .cs file. This blends in more of the advantages of dynamic languages so easily into .NET by making a project implicit to extend. I guess also ironically it showcases more of what power .NET has in being able to work with dynamics in sane fashions to lower lines of code, especially boiler plate code usage.

Reply
Travis

I think Josh’s post here on Microsoft working “with” the OSS community to create those defaults is possibly a way forward.

http://lostechies.com/joshuaflanagan/2011/05/27/an-opportunity-for-a-viable-net-open-source-ecosystem/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+JoshuaFlanagan+%28Joshua+Flanagan%29

I think one of the biggest frustrations of the .NET community as a whole is it is fragmented into 2 groups. The 9-5 “enterprise” developers and everyone else. Microsoft tries to build frameworks for both camps an inevitably ends up disappointing both.

If Microsoft allowed community involvement into the frameworks they build everyone could benefit.

Reply
Justin A

Quote Travis

“I think one of the biggest frustrations of the .NET community as a whole is it is fragmented into 2 groups. The 9-5 “enterprise” developers and everyone else. Microsoft tries to build frameworks for both camps an inevitably ends up disappointing both.”

Well said 🙂 I’m sure this is gross generalizing .. but I too feel the same way.

Reply
Paul Cowan

This is not a binary choice or an evaluation of one framework is better than another.

Both have strength and weaknesses and to actually know both frameworks and others will serve you better in the long run.

ASP.NET MVC has borrowed heavily from rails. It is always beneficial to step outside your comfort zone and explore new languages and frameworks.

Trying to prove one is better than the other is futile.

Reply
Tyler Mercier

@Rick Strahl You see nothing wrong with developers everywhere, solving the same problems over and over? That sounds like a major waste of effort to me. Why not take a solution someone else spent a lot of time coming up with?

@Justin, great post. Really like the discussion this stirred up. Keep up the good work and getting us MS devs to challenge what we have taken for granted. Perhaps a few blinders will come off 🙂

Reply
Adrian Edwards

Don’t you think that WebMatrix is a step towards an opinionated full-stack solution like the one you describe?

Reply
xaverine

I am a long time web form (/w 3rd party ajax) developer. Recently I wanted to learn MVC framework, having played around with it (not long) and also tried Rails… it really amazed me how rails can be so intuitive. Now I really want to pick up on Rails but most applications in my firm are .net based. It would be difficult to convince anyone to jump onto the Rails bandwagon. Its a shame though, I am now reluctant to go further with .net MVC.

Reply
Alex

The comments on this post make me sad about .net future. You guys are just like aquarium fishs, and there is a hole ocean out there.

Our industry is about innovation, and sometimes it happens on the neighbours door. Rails guys got it right. But don’t believe me, or Rob Conery or Justin, go try yourself, if you love to develop, you’ll be amazed, it just works.

Remember when firefox ( firebird at the time ) came and took us out of web ignorance of IE6? It’s the same with Rails.

And @justin, I believe that it’s possible to get close to what Rails have with mvc3, nuget and friends, but Rails magic only exists because of Ruby and that can’t be neglected.

Reply
Chris Marisic

@Justin A

My deployment process is

1. Change build configuration mode to release
2. click publish
3. ftp files up

I specifically make it 3 steps, I could skip the ftp files but I always want manual intervention when it comes to uploading files to my production servers. Soon the binaries will just come straight from the CI server that hasn’t had enough time to be fully configured yet.

Reply
Chris

Picking on the oldest, most unchanged part of the asp.net framework seems like a cheat Justin. So, you have to build an authentication module you like one time. Big deal.

Reply
Justin A

@ChrisM – what about minification/compression of jss and css? bundling them into a single / a few files?

Reply
Justin Etheredge

@Chris I don’t think I’m really “picking” on any part of ASP.NET. The issue I have spans the ASP.NET MVC stack. I could have just as easily used any framework which needs to integrate with models, validation, persistence, etc…. I’m merely asking, “how would you do this?” And the answer is that you can’t. My argument is about a full stack framework versus a framework that only focuses on the web.

And again, I’m not saying that ASP.NET MVC is bad, I’m just saying that their focus is different. In my opinion, ASP.NET MVC loses a lot because it lacks an integrated stack.

Reply
Chris Marisic

@Justin Etheredge “I’m merely asking, “how would you do this?” And the answer is that you can’t.”

What are you asking how would you, and you claim you can’t? I really don’t accept that answer at all.

With MVC3, Nuget, and MVC Scaffholding you can do just about anything you talked about rails doing here in the blog post.

Reply
henk

>The power of frameworks like Ruby on Rails, Django, or CakePHP is that they span the whole stack.

Just like to add Java EE to this list, which is a very powerful framework that spans the whole stack as well.

Reply
0x4a6f4672

It is true, the large number of good gems and easy to use plugins make Ruby on Rails so powerful. There is nearly for every problem a nice gem or plugin in the Rails world: authentication, authorization, pagination, HTML parsing, image processing, file uploading, deployment automation, testing, etc.

Reply
Paul Cowan

Somebody has already mentioned this. What Ruby On Rails has that .NET does not is a vibrant community full of devs willing to put the hours into OSS.

It is pointless arguing over the nuts and bolts of each language or each framework when this is the differentiating factor.

There is gem for every situation because passionate developers have created these gems to a high and professional standard.

There is not as much OSS although there is some great stuff in .NET because the devs are not prepared to put the hours in to do this.

To me it is that simple.

Reply
Russ Cam

I think there’s a lot of good influence coming from Rails into MVC; MVC Scaffolding and Nuget packages to name a couple. Let’s hope it continues.

I feel you’re pain somewhat with Authentication, but it does happen to be one of the older parts of the framework (IIRC, was revamped in ASP.NET 2.0) and can worked with to make a little less painful.

Reply
Chris Marisic

@Paul Cowan, I don’t accept your remarks. My organization makes use many pieces of open source software. We also use commercial products when it makes sense. Then build everything else ourselves.

Whether open source is as deep as the ROR community /shrug I don’t dev on ROR and don’t have any desire to.

Reply
Paul Cowan

@Chris Marisic whats not to accept? RoR does produce more OSS. That is my point and it is an obvious one. The fact that there is less OSS in .NET indicates that less developers are developing it.

I am interested to know why my comment annoyed you so much.

As for whether you have developed on ROR or have any desire to, I don’t care. You can develop in PERL for all I care.

Reply
Paul Cowan

@Chris Marisic in this case yes, much better and a wider spectrum of choice.

I am a .NET developer mainly so I have no gain from saying this. it is just my interpretation.

Reply
Chad

@Justin A – “what about minification/compression of jss and css? bundling them into a single / a few files?”

nuget -> Combres.

RE: Blog author –

“Yes, some of us do use .NET without SQL Server”, you then go on to say how good Rails is because its owns the entire stack!

Anyway, yes a very opinionated framework on top of MVC that bundles in everything would be ideal. Having a complete VS/.Net/SQL/IIS combo all wrapped up would be amazing for the guys running MS top to bottom. For anyone else though I think it would be a detriment.

Or I guess I could just start using Rails…

Reply
Ben Taitelbaum

Kudos for putting out a potentially controversial piece, while trying to maintain objective and evidence-based. It makes me happy to read posts where we can discuss the merits of different frameworks / stacks with an eye towards improving quality all around, rather than simply debating which is better (I mean, of course the one I use/know/love is better — let me make pull out my google + confirmation bias…).

We need more forums like this where we can discuss different platforms without devolving into a flamewar.

Reply
Emile

Hi,

I completely agree with you. I’ve accepted rails/padrino as superior when i started to do startup weekends. In these weekends the idea is to build a working, deployed product from scratch and present it on sundays.

I do like rails but its a bit much, i usually go to padrino, which is slimmer but the principles are the same.

Its absolutely stunning how FULL STACK it is compared to mvc.

Let me elaborate on some of the details of this ful stack:

– At the httplayer, there is something which is called RACK. That converts http requests to ruby calls. It is layered and acts as middleware. It is the defacto standard in ruby when it comes to building web framewors. Because its middleware you can easily at gzip, caching, mutexes, fileserving and what not. Also the community embraced it and now its still being improved. Padrino, Sinatra, Rails, Camping they all run on rack. This pattern is so successful it has been ported to node.js as well under the name of connect.

– At the routes level.

Routes in rails, are very powerfull, they have the resources tag, that defines the standard REST methods, and also nested routes. Meaning, you can nest posts/comments in eachother.

– At the controller level

Controllers can have before filters, just like in mvc, and they can respond to js,xml etc in the same controller call.

– At the view level

The variables you define in your controller are past over to your view, no need for a magic @model variabele.

Then we have the template engines:

– Haml, well isjust haml we have nhaml which is nice.
– SLIM template engine, a better easier to use template engine. Like haml, but better. Been cloned to node.js under the name Jade.
– Liquid, Erb, Markup, Textile/redcloth.

Even sexier, is that all the template engines, are abstracted in to a gem called tilt.

which means (in pseudo):

Tilt.Render “bla” searches for a template with the name bla, it doesnt matter if its haml, lquid, whatever it just compiles depending on the extension.

Also some of the engines use an template to ruby compiler/abstraction layer called TEMPLE. Which makes, making your own template engine a lot easier.

– Asset bundeling/minifcation.

It has sprockets , minification and compiling of SASS/LESS.

– Testing

The defacto is rspec for testing, but even more powerfull is capybara for testing. It is a super pragmatic request spec driver. Which allows you to fast test the code with Visit “/home” click “my button” kind of style.

On top of this, there is cucumber, with hydra.

– Deployment

For deployment there is the excelent capistrano that allows you to deploy your code via git, to multiple server via one command control app.

– Database

For databases there is activerecord/datamapper and another ton of tools. Its superior with its named scopes, and simplicity of use.

It has seed, rebuild db, rake tasks and what nots. Also it runs on my many database types.

– Community tools /services

There is the excellent github, the for everyone accesible buildserver called travis ci.

Well i can go on for hours but the most important thing is. All of this is super pragmatic, its easy to use and its easy to build apps with.

I am building a clone of these important gems, to see if i can get the same productivity in .NET.

Who’s helping me out ?

Cheers,
Emile

Reply
Emile

Even more:

Forms:

– Formbuilder/simpleform/formtastic. Make nested forms super easy.

Deployment:

With Heroku its super easy to deploy with absolutely no effort. (we have app harbor now, which is a sort of heroku clone)
With Chef its easy to build new server and install software remotely.

Cheers,

Emile

Reply
Chris Marisic

Emile,

Alot of those things already exist for .NET, the majority of them can all be installed directly with Nuget.

– At the routes level.

Look at RestMVC https://github.com/bbyars/restmvc

– At the view level

The variables you define in your controller are past over to your view, no need for a magic @model variabele. — The model is not magic, you specifically pass the model to the view. This is why the view is decoupled from the controller, this is a feature of MVC.

Then we have the template engines:

Razor is just the bomb. Honestly it’s the best view engine ever made, and Razor 2.0 raises the bar.

– Asset bundeling/minifcation.

Look at Cassette, Request Reduce, Squishit

– Testing

The defacto is rspec for testing, but even more powerfull is capybara for testing.

MSpec + Machine.Fakes

It is a super pragmatic request spec driver. Which allows you to fast test the code with Visit “/home” click “my button” kind of style.

On top of this, there is cucumber, with hydra.

Specflow + Selenium WebDriver

– Deployment

There’s app harbor and octopus deploy, along with built in web deploy

– Database

EntityFramework and EF Migrations are a strong choice here, Fluent Migrations is an alternative for EF migrations, however at this point EF migrations has become very robust and is likely the best choice.

However I’ve found RDBMS to be entirely terrible for transactional system design, I do all primary development now targeting RavenDB which is just godly.

– Community tools /services

Team City, Hudson for CI, i can’t remember the 3rd option off hand, all are free or have no cost options. Codeplex, Bitbucket and GitHub all work great for .NET

Reply
Paul Cowan

As someone who has developed on windows for 10 years before moving, I can safely say that windows an inferior development platform on just about every level.

There is no focus on the shell. You only need to compare zsh to powershell to know the difference.

I think the crudeness of the add view dialogue for ASP.NET MVC is a perfect analogy to how broken the platform is.

It hurts every time I go back to windows and have to leave all that amazing tooling behind me.

The visual metaphors that exist on windows are just not developer friendly.

MS never really cultivated OSS and that might lead to the end of the story.

Reply
Chris Marisic

@Paul Cowan you’re speaking of Microsoft that doesn’t exist any more, you need to get out from under your shell.

Server 8 will ship with factor 10x as many powershell commandlets along with intellisense for powershell. Regardless if you want to state that powershell as a language isn’t perfect that’s fine because in Server 8 system admins will be able to ridiculous amounts of high powered server configuration and activities in single lines.

The add view dialog is a joke, it’s not really needed. Views are just text files. However you can use the MVC Scaffholding nuget to create very powerful usages of create views/controllers. The end goal is to make dialogs like the add view window to be entirely extensible, not sure if that’s finalized for vs11 or not currently.

I’m not sure where you pull “The visual metaphors that exist on windows are just not developer friendly.” out from. Visual Studio is by far the most powerful developer tooling ever created, especially coupled with Nuget now.

“MS never really cultivated OSS and that might lead to the end of the story.” That story has been changing over the past decade substantially. Look ASP.NET it’s being developed truly as OSS, you can go clone it, fork it and even submit patches. The experience they’ve created with Nuget is a dream for .NET and OSS/FOSS. There’s nothing like nuget install RavenDB and you’re ready to rock and roll.

Yes Nuget might just be the .NET version of Gems but the integration with VS is the huge difference, especially now how you can use nuget even with a build server or crazy things like build an entire project deployment organization around it: Octopus Deploy.

Reply
Paul Cowan

@Chris Marisic

I have to laugh every time a .NET developer mentions intellisense like it is an essential need to developl.

Nuget is inferior, I know because I have used it and it is not just me who thinks this.

I love VIM now, I love that it starts in a millisecond. I love all the vast array of plugins, bundles and dot files on github I fan use.

VS is a big prehistoric, monolithic disaster. I smile every day that I don’t have to use it.

I feel I am entitled to make these statements after so many years on the platform.

Reply
Chris Marisic

@Paul Cowan

You can think inaccurately as much as you want, but I guarantee you that I can code more productively using Visual Studio + C# + R# + ASP.NET + Nuget than you could ever hope to in VIM.

Reply
Paul Cowan

@Chris Marisic How can you possibly prove that? What evidence do you have to back up that statement?

I can say that I can fly to the moon.

Does not mean that I can.

Reply
Chris Marisic

I can say that because it’s just not humanly possible to navigate text files faster/more efficiently using a pure text editor only when modern software projects will generally have dozens and hundreds of files to structure and partition code and responsibilities.

With R# I can jump and navigate to any place i need to be effectively instantly. Gems is nice, but it’s like nuget where install-package actually can install the package AND setup everything for your project to consume said package. With Gems you need to know where its installed, how to call it etc. The integration of nuget into VS is just superior.

Reply
Paul Cowan

@chris marisic, I am laughing at your last post because you have obviously never used vim or at least vim properly.

The cmd-p, ctags and buffergator give the same functionality with much better performance and less likely to hang.

After using both VS and vim, I know what I prefer.

There is no point debating when you are comparing your point of view to something you have never used.

Reply
Paul Cowan

@Chris Marisic

It is like me arguing that Vim is better than Emacs when I have never used Emacs and I have not so I have no idea which is better.

I would not be arguing against Visual Studio if I had not used it but I have used it most of my professional career….more is the pity.

Reply
Chris Marisic

I just don’t accept your statements as valid. Unless they built VIM versions or modules that actually UNDERSTAND code. There is absolutely no way it can do better than VS + R#.

Another big factor with VS is the tight test integration I get.

Reply
Paul Cowan

Have you used VIM + cmd p?

Can you honestly say that you have. If not then it is pointless arguing against something you have not used.

These dotfiles create a vimrc of pure goodness:

https://github.com/skwp/dotfiles

Waiting for the test suite to start up in R# is something I am glad I do not experience any more.

As I said previously

Reply
Chris Marisic

R# test settings, on the test runner build settings: build files never. Tools options unit testing, shadowcopy assemblies: false. Test up to 4 assemblies in parallel

My tests start instantly.

I used tools that would run my tests on every save, but that got ridiculous so now I can build to flush all changes to disk, and test immediately with 2 hotkeys. Also can do it with the mouse if desired.

Reply
Lelala

In the long run its all about your personal taste & oppinion. If you build a big application, there is usually a app-specific framework, so you do not need to operate on that low level as described.

Reply
FIrat

I like MVC 3 and 4 much better than other frameworks such as php ones, rails, django.

One common problem to all is there will be things that you will have to spend time to get them done, doesnt matter which framework you use.

Moreover you get great tools, and microsoft support, with community behind you with Microsoft tools. I dont feel the same for ruby or open source tools.

http://hasanatagun.com

Reply
Pritchard

Is there a reason that people have to resist competitive technologies so vehemently? Anyone who is good with -any- decent tool can do anything anyone else can do. Each tool does some things in a more user-friendly, nimble or reliable manner than others.

I say learn as much as you can and see what you can do with it. My company may use ASP.NET / C#, but I have plenty of interest in F#, Java, Ruby, Python, client-side MVC Frameworks, Node.JS, etc.

RoR and Java aren’t used by the companies who choose not to use ASP.NET MVC “just because”. They’re mammoth and have impressive communities behind them.

Word on the street is that the best programmers hate all technology – because they can list the pros and the cons of each. (And boy, can they list cons.)

I don’t think my expertise is quite that high yet.

The idea of integrating Ruby/RoR with HAML, Handlebars/Mustache, SASS, LESS, Bootstrap, knockout, backbone, angular, ember, etc. makes me tingle. Everything from the raw HTTP requests to the highest levels of server and client-side abstractions are in your control. I think my pet peeve with – and also what I like about – RoR/OSS is that it moves so fast. You have to be pretty smart just to keep up.

Enterprise Java/Oracle/BigData has an elite corp of developers with immense expertise in architecture and patterns. A ton of the patterns now seen in ASP.NET MVC were first popularized by the Java community. I can’t say I’m a huge fan of Java as a language in and of itself, but from what I hear and have seen, as an enterprise/server platform, it is top-notch.

ASP.NET MVC is okay. Maybe I’m a bit pessimistic about it because I use it. Visual Studio 2012 is great. Integration with other MS products is great. I can’t say a ton of 3rd party products are amazing, but that situation has improved. Having only some pieces of my toolkit OSS is bothersome at times – you only have so much flexibility with the built-in tools and if you switch over to a 3rd party server, for example, there goes your customer support. There isn’t much incentive to create new OSS tools for MS products due to the fact that it’s not a full OSS technology stack. However, ASP.NET MVC, C#, Visual Studio, Entity Framework and whatever other utilities you use are generally really easy to use and pick up on. MS products are nice if you want a suite that you know will fit your needs for years to come, so long as your needs to change too much or too quickly.

There are ways around all of the cons I could list, and there are alternatives to all of the pros. The truth is that skilled developers can make just about any tech work, although I do honestly think the RoR and Java communities have a 1-up on us MS developers at this time. Probably why they’re paid so much 🙂

Oh well. Ce la vi!

Reply
airtonix

eh chris, I’ve seen you trolling around before…

just face it … rails, django and some of the nodejs frameworks are superior for modern workflows.

basically because they are deployable very easily onto a linux server (which starts up faster than windows servers), they are better structured than any .net stuff, aren’y polluted with xml configuration files.

But none of this matters to you, because your intention isn’t really about discussing why dot net sucks, you’re only interested in taking a contrary stance.

You need to understand most developers hate using windows, hate deploying to windows, hate having to deal with a framework (or lack thereof) which neglects all modern solved patterns.

The “Not Invented Here” syndrome needs to die in a fire.

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *