Hacker News new | ask | show | jobs
by Kaali 2695 days 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.
1 comments

Agreed. 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()