3 ms·
I’ve looked at this code a bit and.... seems relatively straightforward to me. Am I too much used to enterprise code? Do you just mean the verbose naming?
by m_mueller 8y ago
I’ve looked at this code a bit and.... seems relatively straightforward to me. Am I too much used to enterprise code? Do you just mean the verbose naming?
- amluto 8y agoI mean the sheer amount of abstraction. On a brief inspection, this code essentially does: when temp > upper_threshold: turn fan on until temp < lower_threshold For a vendor-provided set of tuples (temperature, fan, upper_threshold, lower_threshold). And it’s not really clear whether the code is intended to handle the same temperature or fan occurring more than once. This logic could be written in maybe 100 lines of code if all the abstraction were removed, and that’s if full support for repeats is needed. Instead there are layers and layers of abstraction. Also, this code doesn’t belong in a user program or even on the main CPU at all. It belongs in the embedded controller.