Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 2.7 KB

INFO.md

File metadata and controls

26 lines (21 loc) · 2.7 KB

Notes:

95% of the effort was put into creating scalable, modular coffee machine models with basic functionalities.
The model and view are completely separated, connected only by the controller class.
Most of the PEP 8 coding conventions were applied during development process along with the maxim 'A Foolish Consistency is the Hobgoblin of Little Minds'.

I treat every task as a new challenge, and every new challenge as an opportunity to improve myself. That's why I decided to try TDD for the first time. All of the code in models was developed only after a proper test function had been created. It slowed the development process dramatically, but eventually I was positively surprised. Writing tests first saved loads of time at the end, when combining models with view and controller. Of course, some sacrifices had to be made because of my choice. And so, the Coffee object magically appears out of nowhere, instead of coming out as the result of the (non-existing) Brewer component doing some real brewing.

Among the features, design patterns and frameworks I rejected or postponed, were:

  • Flask - the task did not require neither creating web app, nor storing data in the database; dropped to reduce complexity
  • Django - an absolute overkill
  • asyncio (or some other async lib) - user could change machine settings while waiting for coffee; The task clearly did not indicate this as a requirement, and so I picked simplicity over functionality
  • producer-consumer pattern - so we could order multiple coffees for all our coworkers and go play some table football in the meantime; tempting, but an overkill for now
  • Tkinter (or some other GUI lib) - as clearly stated in the task description, there was absolutely no reason to waste more than 15 minutes for GUI
  • Docker - there was no indication that the code is meant for production; the dependencies are also extremely simple - just pytest and click
  • dataclasses - I actually tried implementing them in here. They are designed for the editable data containers, with no support for private fields, static methods, validators etc.
  • attrs - it could actually work well integrated into the code. However, I believe there is not enough boilerplate code yet, to optimize the codebase size (I may be wrong, though)

The last commit and pull request are dated on Monday. However, the last commit containing code did not exceed the Sunday, 11:59 PM deadline.

My biggest regret: I did not manage to write all the code using TDD. In fact, both view and controller are still untested and undocumented. I decided to meet the deadline to provide a working MVP and fill in the missing parts as soon as possible.