Saturday 31 March 2012

The way we think.

Just because we can do something does not mean that we should. Just because our chosen technology allows us to solve a problem in a particular way does not mean that it is a good way to solve the problem. When you have a hammer in your hand, and you can see nails all around, standing back and getting some perspective is really rather difficult.

Friday 30 March 2012

When to use OOP, when to use FP

As Python supports both OOP and FP styles, sometimes I find myself deciding which to use in various situations. OOP seems attractive when I have some sort of state (that cannot be avoided and must be managed) - this seems to occur mostly when dealing with stateful third-party APIs. In many other cases, a more FP oriented approach seems more attractive:- I am finding generators particularly handy & useful