7 ms·
Abstractions need proper names and meaning. In this example the "abstracted" version would be a lot simpler if the names of the functions would be 'doB()', 'doC
by Kaali 8y ago
Abstractions need proper names and meaning. In this example the "abstracted" version would be a lot simpler if the names of the functions would be 'doB()', 'doC()' etc. and it is still hard to make sense of as A, B, C, D, E as an example doesn't really have an obvious meaning. Just an order. But if the main function describes a process that must happen in a specific order, then by all means keep the code in the single function if it makes it more clear.
- hliyan 8y agoAgreed. I personally find it very difficult when abstractions are named after the design pattern rather than the purpose. E.g class B import com.acme.b.BRepository class BImpl extends B BFactory.getInstance(STANDARD_B) b.process(); // this is all we want, doB()