an obession with first principles

Managing Dependancy

Posted: Wednesday Aug 18th | Author: JohnO | Filed under: Programming | View Comments

Huzzah, a post about programming! I am consistently miffed, nay pissed off, when more dependencies are introduced. I do not mean using libraries to Get Things Done. I mean writing what amounts to pseudo-code. Writing structs* (in whatever language) that get parsed and turned into objects and executable code. Unless you’re writing in a language where code is data do not do this. Pseudo-code will never be flexible enough to do what you will need it to. Unless you are purposefully handcuffing the developer – don’t do it.

This is why I love python and django. You can actually execute statements in the class-space. In many other languages you cannot. Hallelujah! I can instantiate objects right there, instead of having to do it later on in another function while a struct* sits in its place. The only dependancy in django is the python language itself. You may, or may not, use the other django libraries. And it is often beneficial to do so. But when it comes down to needing to alter how something gets done you are not dependent on the ordering of the framework itself. Since it can always be overridden at the python level.

*I don’t mean a C-struct, I mean any semantically ordered piece of meta-data that you code relies upon. Generally these take the form of arrays, maps, and hashes.

blog comments powered by Disqus