An example with abstraction

If you saw a call to the following function call, you would probably have a fair chance at guessing what the function did, even without any proper comments:

bufferX[i] = adcX->ReadAdcValue();
bufferY[i] = adcY->ReadAdcValue();
bufferZ[i] = adcZ->ReadAdcValue();

The preceding code is fairly self-explanatory—we're reading ADC values and storing them in 3 different buffers. If all of our calls to get ADC readings use the same ReadAdcValue() calling convention and descriptively name the ADC channel, understanding the code is fast and easy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.105.137