What could be improved in Python
I have used Python for some projects, and I love the language. It's great for hacking something fast, but I have learned that for large projects or frameworks it's lacking interfaces! It's simply pretty damn hard to get some kind of contracts (and some kind of contract checking).
I have just had Software Architecture CS course. One thing I learned was the first principle of good software design: Program to an interface, not an implementation. Interfaces are also used in almost all design patterns - i.e. they are essential for good software design! An example where I would use an interface: For my skeletonz CMS framework I would really like to say that a template has to have getHeader, getContent and getFooter. I would like to say that the return value of those should be an object of a specific type. I would love if Python could check and see if an interface is really implemented. For the users of the framework it would make it easier to implement and understand a template. This is just one example out of many where interfaces would be a GREAT way to specify a contract. Guido van Rossum, the creator of Python, has written about this: Adding Optional Static Typing to Python. Let's hope this comes soon - because interfaces are essential! |
|