Now with More Python

by Matt Cholick

I finished converting my site from php (shudder) to Python (yay) with Django today. I haven't formed a strong opinion of the language itself yet, because the framework did all the heavy lifting. From something as simple as a blog there really is very little actual Python code. As for the framework, though, I am a big fan. It does a great job doing exactly what a framework should do: it keeps the code clean and organized and removes much of the repetition. It does this better than many other frameworks that I've used.

That said, there is one thing that I really have issues with: the constraints on the template language. I feel like my hands are tied when I'm working on the page itself. I realize their reasoning is to better separate business and presentation logic. A noble goal, but they took it too far. For example, the 'if' tag doesn't even let me mix 'and' with 'or' in the same tag.

I am much happier about the end result. Whenever I write php, I always feel a little bit dirty. I know that with each line of code things are getting uglier. Even with frameworks in place, it's hard to write clean php code. Say what you will of Java, at least it doesn't encourage messiness the way php seems to. I know it's possible to write nice, clean, maintainable php code; I've just never done it and can't work out how.