A depressing amount of my professional life has revolved around XBRL. For those too lazy to follow the link I’ll summarize by saying it’s an XML based way of describing and providing financial information. Something that’s been commented on by many but actioned by few is that XBRL can represent multi-dimensional information, so OLAP is a natural storage mechanism. For those who aren’t aware I currently work at IBM, and since IBM owns an OLAP engine called TM1, I thought I’d play around with whether or not storage of a complete XBRL instance and taxonomy in TM1 is possible.
In order to get started I needed an XBRL processor to load sample documents and attempt to create and populate corresponding concpets in TM1. This is as far as I’ve gotten. The most popular XBRL processor seems to be Arelle which is an open source implementation written in Python. This was my first exposure to Python, and though I’m sure this has been said before, my initial impression is:
- It would be really easy to bang out a small project in Python.
- Attempting to work with someone else’s project, particularly in the context of a complex object model seems much more difficult.
The reason is that Python uses dynamic types meaning that auto-complete within an IDE is not available for anything other than static members. For serious programming neophytes the distinction looks like this, a Python IDE will auto-complete a statement like this (note this is not actual Python, just an example):
File.ReadContents("test.txt")
since ReadContents is a static method of the File class. However, the second line of this code will be a problem:
myFile = File.Open("test.txt")
myFile.Append("blah")
Since myFile is a dynamic type, it doesn’t have any “methods” until run-time.
This thread on stackoverflow is rife with people claiming support for auto-complete, but as far as I can tell they are referring to base or imported modules, which are well known so an IDE can come pre-loaded with some kind of knowledge of the “types” they provide. Auto-complete on your own code (or someone else’s .py files, which is the critical thing here) seems to be missing. So again we come back to:
- Fast to write your own code, because you know your own types.
- When working with someone else’s code directly it becomes much tougher because you have to actually inspect the .py files or read through an API reference.
This makes me wonder why Arelle went with Python. I suspect it’s because they wanted to create XBRL tools first (quickly), and only after thought about exposing an object model. Maybe I’m way off here, but it seems something like Java or C# would have been better tools for creating a complex object model that is meant for others to use.
Apparently others think the same thing: http://arstechnica.com/information-technology/2014/06/why-do-dynamic-languages-make-it-difficult-to-maintain-large-codebases/