Vision on Django/Python
I have relatively recently begun to work with django and python, because heard many good things about them from different people. After this six month, I have already looked enough at the possibility of these tools (since worked on a real application rather than the application of the examples), and therefore decided to describe my vision. However, I do not pretend to be experts in these technologies and I understand that many things I do not know, and perhaps because of that I have and have the same impression.
So, what I like and dislike in django (considered a version which works on google appengine).
- a dynamic of python and that I do not need to restart the server to look on result of resent changes
- handy mechanism for parsing the URL and retrieving parameters from it
- mechanism for working with JSON
- impossible to compile whole application and thus:
- during testing and debugging we are finding and fixing errors, which could be found during compilation
- hard to make refactoring, because after renaming method or property it is hard to find all places, on which is affected by this changes
- impossible to validate html, which contains django markers
- there is not good IDE, which provides all necessary functionality, e.g. navigation via methods, “find usage” feature, suggestion mechanism for fields and methods, etc.
- howes, because code is not structured:
- there are a lot of things, which are implemented as functions. So modules looks like as container for huge amount of functions and therefore a lot of files contains huge amount of code lines. It makes harder reading and analysis of code.
- there are not service term. There are functions for handling URLs, which contains application’s business logic, but there is not services.
- there are not data access objects. It is possible to call find_by_id(..) or all(..) methods in entities, but there are not custom finders and it makes duplicate parts of code.
- poor support of transactions – in google appengine you should manually collect all entities, which should be updated or deleted, and after that call method for making these changes in transaction. In other words django does not support “Unit of work” pattern, which is realized in Hibernate or other similar frameworks.
- poor caching mechanism – you should manually put/get/remove objects in/from cache. For example in Hibernate or TopLink you need to configure cache for objects and it covers a lot of variants.
- for writing good application you should write good structured code (language does not require it) and it required good self-organization from developers. Moreover if you code is not good organized then it will be hard to fix it, because impossible to make good refactoring.
- not convenient to work with localization – you should make a lot of steps for translate you application on other language: you need to grab strings, compile messages and put in specific place. And in addition configuring all required things takes some time especially on windows where you don’t have various utilities needed.
So I think that django/python is suitable for small-medium application or prototypes. I think that all advantages of dynamic language will be slaughtered complexity of support for medium-big application.
Am I wrong?