Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Port ASP to Django or ASP.NET

We use Asp Classic with VBScript and SQL Server 2005. Websites are hosted on Windows Server.

I have managed to replace VBScript with Python and this has been a great improvement.

I'm wondering what the next step might be. The original developer is a fan of Microsoft products, however he is impressed by Python. I on the other hand am more biased towards open-source.

If we wish to move towards .NET or Django in an incremental fashion, which platform would you recommend? In this regard, what might these incremental steps be? For example, I currently have my model at the start of my asp files where I create a set of python objects. I then use these objects throughout the rest of the file, the view. Maybe the next step is to use HTML templates to represent the view if this is compatible with asp.

It would be nice to be able to add new pages entirely for the new platform. However, the client session will need to be shared between asp and the new platform. Perhaps I can wrap asp-classic's Session object.

Any other advice?

Thanks,

Barry

like image 976
Baz Avatar asked Dec 27 '22 04:12

Baz


1 Answers

Wow, this is exactly what we (as a company) have been through.

We actually still have a big classic ASP web application running. We have circumvented the fact that plain classic ASP code can be spaghetti code by using WSCs (Windows script components, or scriptlets) to get separation of concern, which actually works great in classic ASP. We now have debugging component, internationalisation, a 3-tier architecture and no performance problems.

However; as developers we wanted to 'move on' so to speak. The first thing we tried was implementing parts of our vbscript code to Python, to at least work in a modern language, but after a lot of troubles implementing Python in WSC's it was clear that WSC's and Python didn't get along well.
My findings regarding Python and WSCs

The next logical step to try for us was moving to ASP.NET, as this is the roadmap suggested by Microsoft. We took up a C#/ASP.NET MVC course, hired a seasoned .NET developer and started implementing new projects and porting existing code to .NET. MVC is the way to go coming from classic ASP, the "webforms" abstraction Microsoft used before ASP.NET MVC is geared towards application developers and is a terrible abstraction of the stateless web.

We found out that, contrary to popular belief, there is no easy way migrating from classic ASP to ASP.NET (at least not if you want to do things "right"). The language is different (VB.NET vs vbscript), there is the fact that it is completely Object Oriented, which takes a lot of understanding of you've never done OO stuff before, the framework is different (MVC), you will have to pick up on things like lambda expressions, even talking to the database is different (LINQ). There is just too much stuff you will have to pick up to be able to pull off a successful project within a year. Also, the developer we hired was an application developer and a mismatch for guiding us into ASP.NET. He knew C# syntax, but had no idea about developing a big web-project.

Talking to peers in the industry it became appearant that there are a lot of people that claim to be .NET developers, but in reality they are very inexperienced. .NET is taught in schools, but people just out of school know only basic stuff and need to be trained by seasoned developers and do at least a couple of projects to become useful. Also a lot of people pick up .NET themselves because it is a popular framework, and after working through a book or two can create a simple website or application. There are loads of those on every job site as well. In truth, it turned out there are very few really good (or even moderately good) .NET developers available. We have looked for an experienced one for over a year.

About the same time we found out the project wasn't going anywhere in .NET we also found a python developer by accident (whilst looking for more .NET developers). We decided to drop what we were doing and research Python again.

We are currently implementing different projects in Django, and we have made more progress in the last 4 months than we did in a year of programming .NET. The main difference is that in .NET/Visual Studio there were a lot of things you "just had to know", locations of certain files, tools to do certain stuff, where to use lambda expressions in code, I can't give you exact examples because I've luckily already forgotten most of it.

In Python there will be a lot of new stuff as well, but you will love:

  • The fact that it's dynamically typed, which is a lot like vbscript.
  • I found that programming Python I can often code for half an hour without running my code, and when I DO run it in the end it works immediately. It is very intuitive.
  • It is cross platform; you can experiment using linux as a server if need be, but IIS works as well (using Helicon Zoo).
  • Python developers seem to be more serious about their profession. .NET is commonly taught in schools, learning Python is a conscious choice.
  • You can pick and choose webframeworks and technologies like ORMs, session layers or other layers. Django is quite rigid in this regard, but a framework like pyramid is very flexible.
  • Python is OO, but doesn't have to be. The language in general is (maybe not syntactically, but certainly conceptually) a better match for vbscript.
  • If or when Microsoft decides that asp.net is to be abandoned, like they did with classic ASP and (for example) Silverlight, you won't have a problem using Python.

Don't get me wrong, you will still have to learn a lot of new stuff coming from classic ASP, but in our experience the learning curve is less steep migrating to Python than to ASP.NET, and programming is a lot more fun.

EDIT: I have another tip for you; we can currently exchange information between the ASP and DJANGO sites using a memcached COM component. Using this you can access a memcached server from classic ASP.
Django can use memcached as a backend, so exchanging information is possible and lightning fast between classic ASP and Django.

Erik

EDIT:
After our initial project in Django, we are currently developing in Flask. Flask is an even better match for classic ASP developers than Django. Django imposes a lot of conventions and we found it restricted us in the type of user-interfaces we wanted to develop.
Django is nice if you want something up and running fast, but we were already used to building our own forms/datagrids/wizards in classic asp, and Flask gives you much more freedom in that regard.
The transition from vbscript/IIS to Python/Flask is IMHO the easiest to grasp.

like image 120
Erik Oosterwaal Avatar answered Dec 31 '22 13:12

Erik Oosterwaal