I really hate when dev feels like they are so intelligent and uses super advanced language feature just to avoid writing a little bit of bolderplate code -_-' (and this is not worth the maintainence cost, really.)

Ah yeah, for the context this is dynamically generating a new type of class.

This also makes code harder to read and to make it predictable and straightforward.

And because it's late and I can rant alone: you could have simply create a list of existing class for all your situation (yes really, it's not that hard) and just use a dictionary for handler_class → TheGoodClass.

There, much more understandable and easier to read (and I'm sure you don't have enough different situation to justify this magic and even with that I doubt you can justify it.)


@bram sure, but you’d have to update the list every time you add / remove / rename a class

@sxpert yes and you do it because code is more read than written and this bolderplate is worth it

Sign in to participate in the conversation

mastodon.sxpert.org is one server in the network