• @Konkery, thank your for clarifying the input about version as well as board and build. I apologize for jumping to conclusions with assumptions I did not verify with you before. The main assumption were the version and that you had updated to it after failing with outdated ones. Version 2+ brought really substantial enhancement and extensions. Even though ES6 is mainly syntax sugar, it make code really much more readable when going down the class based oo programming path.

    You can get there too by some poly filling or by using some frameworks - such as dojo @ dojotoolkit.org did quite consistently and successfully more than a decade ago (from which, btw, dynamic modularization w/ requireJS comes from) - but it is always stays a bit messy. You can RYO by implementing only simple inheritance things using mixins - extensively used by dojo and described, for example, in this Medium.com article from Eric Elliot about Composing Software, hinting relation to software as art.

    On the other hand, inheritance is quite overrated... because the things in the world do inherit, but not in the narrow sense of class based modeling, but more in the prototype based way. Interestingly this term is use in modeling in scale... model trains, etc. To me this prototype based inheritance means: looks like, but is its very own thing with its very own knowledge and behavior. So in most cases you choose composition over inheritance, because this gives you way more freedom to do things.

    Another issue with inheritanc vs. mixin/composition in micro controller context is the resources: from a maintenance point of view of supporting a library, class based / prototype based inheritance comes in handy... but at runtime, you rarely have multiple versions of a sensor or alike at that would asks for software to support inheritance for a gain.

About

Avatar for allObjects @allObjects started