Lessons learned from web development with Django
By andre
Django is a web development framework for Python. I used it for a few web sites, including a relatively large one. I must say, my overall impression is rather ambivalent.
First of all, Django is definitely excels when you need stuff done, quickly. A lot of stuff simply works out of the box or with minimum effort, including DB access and ORM, caching, templating and so on. And there are so many extensions available! Probably only some PHP frameworks have more plugins and extensions, but who wants to write in PHP for a living?
On the other hand, writing large projects in Python, or any scripting and dynamically typed language is hard. Of course, it is hard no matter what technology you use. But with Python, heavy refactoring might be a serious nightmare. Which brings is to an important point - you must have lots of tests! Of course, any sane programmer will have a lot of tests no matter what is the language for the project. However, in case of Django/Python your tests will pick up some of the burden which with the statically typed languages is handled by the compiler. Also, despite the reasonably good documentation, it is not always clear how a certain thing works or, more often than not, why something doesn’t work. The main remedy is examining the source code of Django or third party extension, which I have been doing rather often. This can, naturally, happen with a framework written in any other language, of course.
That said, what are the alternatives? Play Framework sounds like a great option. I am a fan of Scala (not so much of pure Java), and it seems to have reasonable design guidelines. Alternatively, ASP.NET Core is a solid offering with a promising future. However, there are considerably fewer extensions available for either of them! So if you want to create a shopping web site with an CMS and a forum, you can whip something working up in a matter of days, if not hours. You will be using rather solid extensions, fully open source, and with large user bases, meaning support and stability. With Play! or ASP.NET you will have to write more custom code, or rely on half baked coding summer projects, or pay for commercial products.
So, for the time being I’ll continue working with Django and wait for other frameworks to mature.