Freedom to assert

Just a quickie…

In British politics there’s an idea of collective responsibility: once a policy is agreed in cabinet, members of the government are required to defend it even if they don’t agree with it personally[^1].

In Django we have similar. We try to reach decisions via consensus. Once that’s done, there’s a convention that you’ll support that, even if it didn’t quite go your way.

That applies all the more to the Fellows. It is quite literally their job to defend the consensus reached on discussions, and the outward manifestations of those, in things like the API stability and supported versions policy. Even if in a particular case they may not really agree.

And all of this is to the strength of Django.

There’s a consensus to favour exceptions over assertions, as per the discussion on #32508: raise a (e.g.) ValueError rather than use assert. If you’re ever going to catch it then sure but, just as a matter of (probably lackadaisical) style I’m a big fan of assertions. Make it blow up! 💥 I like the syntax.

I’ve chaffed a little at this.

Only a little, mind. It’s not really a biggie.

This morning though, I threw an assert ... into some code I was playing with, without even a niggle of Will I be able to justify that?.

That was quite refreshing. I’m enjoying my new found freedom to assert.

[^1]: I’m not sure this is still really a thing, if it ever really was, but it was definitely talked up a lot in the past.