Lies, damn lies and statistics

Entries for tag "python"

Model Driven Generation

Where is the truth of an organisation? Many programmers would say that the truth is in the code as this is what is actually running the organisation. The code is in effect a realization of business demand and therefore the truth of what an organisation actually is can be found within.

I think that while somewhat accurate, it is a little 'ambulance at the bottom of the cliff' thinking and we should rather strive to be declarative in what the organisation is. Also, assuming we buy for commodity then the view is obscured and incomplete. The declaration of a business is best done via modelling as the related views can inform and align everyone from board to developers.

Python decorators and testing interplay

A trick for new players, when using decorators to register functions - E.g. a plug-in system.

Since unit testing automatically imports modules when looking for tests, you must remember to import modules using the decorator. If you don't your tests can pass but execution fails.

Also linters don't like importing without directly using as the act of importing the module registers the function but they are still technically 'unused'