34 ms·
The article could do without any references to C++. Surely writing long, imperative lists of register writes makes the reader's mind boggle. C has more than eno
by yason 8y ago
The article could do without any references to C++. Surely writing long, imperative lists of register writes makes the reader's mind boggle. C has more than enough tools to encode all that into something that is maintainable and readable. Because if you just take C++ to implement some handy, convenient constructs you also invite the closet full of demons that come with the language.
And quite frankly the abstractions given in the article are quite trivial. Any decent programmer would create similar abstractions as a part of normal course of work because decent programmers know they are forgetful and they want to spend their modest number of brain cycles on the higher levels of thinking instead.
- billforsternz 8y agoSuperb comment. Good programming is about building effective layers of abstraction. Bit twiddling is fine, but encapsulate it. Mass setting of registers should be presented as a readable table (possibly an instantiated structure) with no special executable code in sight.