Higher level classes 0 ▲ Mark Smith 21 hours ago · Tech · hide · 0 comments I'm just emerging from a bit of a nightmare related to higher level classes, hence this cautionary note. It‘s particularly relevant if you are coding with LLMs. The crux of it is quite simple. I had a need to create some decorators, which is a way of dynamically adding new behaviors or responsibilities to an object or class without altering its underlying code. It is a quintessential example of composition over inheritance: instead of creating a rigid, deep subclass hierarchy to add a feature, you wrap the target with a decorator that intercepts or enhances its functionality. At it's core it's just a function that takes the class, method or property as input and wraps it with extra logic, and returns the enhanced version. They are referred to as higher order function, or loosely as "higher-level" because they are functions that take other functions as arguments or return them. The annoying thing about higher-level functions is that they are tricky to reason about. Taken on their own,… No comments yet. Log in to reply on the Fediverse. Comments will appear here.