And we can see why imperative programming is much more simpler than OOP or functional programming.
- That that data!
- Transform the data!
- Take result of transformation and transform further!
- Display the result!
Not:
- Think about an abstraction of the problem
- Define a class which is vaguely near to the problem domain.
- Take the data and press into the object using a constructor.
- Write some methods which fits the object abstraction but not related to the actual problem
- Write a couple of methods to administrate the data inside the object
- Do the same for a second class because after doing the first transformation step you have a different kind of object
- Use a mixin to combine the two classes
- Refactor the code to adhere to Clean Code
- Write a helper class which is actually not an abstraction of anything
- Write test classes to test quality into your code because your codebase became to messy.
- Explain everybody why this approach is superior than just pipelining the data between functions.
- Complain about why the state of the industry is so bad.