views:

5979

answers:

8

I am starting a new web project where using MVC framework seems appropriate.

My background is mostly with .Net / ASP.NET, so using ASP.NET MVC looks like the easiest way. I read that django is very powerful and easy to use, but I only have little experience with python.

Can anyone with experience in both frameworks tell me their perspective regarding how the two frameworks stand out?

+4  A: 

I have a very little experience in ASP.NET, but I am active Django developer. To start working with django, you don't have to be experienced Python programmer. If you are generally oriented in web development, you will find yourself working with django in no time. Personally, I find ASP.NET much less new-user friendly and generally more complicated and harder to start using it without any knowledge.

Open some Python tutorials, use django book - it is a best start you can get.

Oko
Traditional ASP.net is often more difficult to get started with, but ASP.net MVC is a very different beast. I find the MVC model to be very elegant, and the ASP.net version is very good.
Eric Haskins
Stay away from djangobook.com for now. It is extremely out of date. Instead, look at http://docs.djangoproject.com.
Ryan Duffield
+6  A: 

I use Django and ASP.NET quite a lot (but not ASP.NET MVC) -- for me the decision comes down to how I plan to host the final site and what other parts of the framework I need.

If you don't know python, but do know .NET, it will be quite a drag to learn it all for this project if you want to make quick progress -- you will simultaneously need to learn a language, a web framework and the rest of the framework -- with ASP.NET MVC, you only need to learn the new framework. For Django, you also need to learn how to deploy, host and keep the site running (which means learning Apache and tools for dealing with it).

If you want to learn python, then I highly recommend using it with Django -- that's how I learned python.

Lou Franco
I agree, the decision is how you want to host the site. I am very familiar with asp.net and know C# extremely well. However, I have a number of web apps I want to work on and using asp.net with mssql is just too expensive. So, I've decided to use django. Learning apache and python has been great.
rksprst
A: 

ASP .Net allows -- but doesn't require -- MVC design. A design pattern like MVC is easy to slip away from.

First, MVC requires a proper object-oriented Model. Something that VB isn't very good at. Often, the first short-cut is to use a relational model and SQL queries and leave it at that. In an OO world, class methods that are part of the model are sometimes put into stored procedures in the database, other times their part of ASP pages, and some model-level features wind up in separate VB modules.

Python is OO. Django separates the model completely as stand-alone Python modules. You can easily be absolutely sure you have all the right method functions in your model. You never need to resort to stored procedures.

Second, MVC requires a clear distinction between View (as in HTML) and Control (as in the the application processing and navigation.) Sadly, ASP allows you to put anything in an ASP page; too many people start to put everything into their ASP code. Eventually, there's no real distinction between View and Control.

Django separates View and Control. The web site's view (or presentation) is via templates. The rest of the control is "view functions".

The worst case scenario is an ASP site where the essential processing is scattered randomly through ASP pages, VB modules, stored procedures.

The fundamental Django model is URL maps to a view function. The view function returns a template with some values to be displayed in the template. Two very simple things that lead to very clean separation between model, view and control.

Some people complain that Python's template language is "brain dead". Partly this is just their frustration at the absolute separation between presentation via templates and processing in view functions. You are absolutely forbidden from doing anything that even smells like processing in a template -- just present the data in HTML.

Good design work can be done in ASP -- you just have to impose the discipline on your own. I find it easier to do good MVC-oriented design in Django because the framework encourages and supports it.

S.Lott
Keep in mind that they are specifically addressing ASP.net MVC, which, while still using the ASP.net view engine, allows you to do MVC in ASP.net as easily as any other framework.
Eric Haskins
The question is one of "allows" vs. "encourages". I'm not 100% convinced that that ASP .Net framework is strict enough.
S.Lott
umm... ASP.NET is not the same as ASP.NET MVC. The MVC framework addresses a lot of the issues that you talk about.
Adhip Gupta
+1  A: 

If you know .net, use ASP.net MVC. If you know Python use Django.

The only possible issue is that ASP.net MVC is still in beta, so you run the risk of finding bugs, but I think this site proves it is an effective and functional framework.

Eric Haskins
+14  A: 

Both Django and ASP.NET MVC allow you to create MVC applications, however those frameworks differs in many places.

Django is more mature and there are a lot of available components you can use. There is ORM so using database is very easy. Testing is simple and community is very responsive.

ASP.NET MVC and ASP.NET are completely different things. ASP.NET MVC is in a very first stage of development, it is not even in beta.

Although it is now just preview 5 this framework is quite good. However there are a lot of unsolved issues, for example it is not stated how you can reuse parts of applications. In Django there are plugins, in KohanaPHP there are modules.

Unit tests in ASP.NET MVC are very easy and you can use NUnit. From .NET 3.5 there is ORM for .NET framework called LinQ, which is very different to ORM in Django.

I think that Django is great, very mature and well designed. ASP.NET MVC is very young project and not all features available in Django you can find there.

If I were in your place I would check plugins for Django and see how they can simplify my project, if not much, I would choose ASP.NET MVC because I'm better ASP.NET programmer.

saner
Linq itself is not an ORM, to be precise, but indeed you have Linq To Sql and Linq To Entities available with ASP.NET MVC
deadbeef
A: 

Have checked out MonoRail from the Castle Project? It's one of the first MVC implementations for ASP.NET that provides a very nice set of features.

As for ASP.NET MVC, right now it's in a pretty good state to do development with. I'm currently using it for a couple production websites (and yes, even stackoverflow is built with it) and had minor issues (mostly upgrading between previews).

Javier Lozano
+1  A: 

I wholeheartedly agree with Lou Franco (but don't have the Reputation to leave a comment).

If you have the choice to do either I might go with django. I recently finished my first ASP.NET app and it was not a fun experience. However, I'm still naive as to django's ability to scale for larger applications.

For what it's worth, I think Python is just more enjoyable to code.

beardog
+2  A: 

Django is eccellent and I do love python, but what really keeps getting me away from it is its ORM.

The fact that basically it is designed to create your DB and not to adapt to it cn lead to serious problems if you are not starting an application from scratch. Plus, still they haven't solved a major issue, that is keeping your model synched with the DB and dropping - modifying fields, altering tables etc can be a pain. Those are essential steps in easrly stages of delepements, expecially if you are just "experimenting" and you don't have detailed specifics.

I'm finding working with Linq + Entity models easy, fast and funny, on the other side.

pistacchio