Grant Edwards wrote: > On 2018-11-07, Peter Otten <__pete...@web.de> wrote: >> lampahome wrote: >> >>> Above is I thought to make code clear, and this pattern is called simple >>> factory? > > [...] > >>> *Is there better design pattern for me?* > >> Generally speaking you get better solutions when you ask yourself > >> "How can I solve this problem efficiently?" >> rather than >> "What fancy design patterns can I use while solving this problem?" > > I'd rather start with "how can I solve this problem simply and > clearly". By "clearly" I mean that the source code is easy to > understand and reason about. > > I don't worry about "efficiency" unless testing shows that the simple, > clear solution isn't efficient enough to meet requirements.
You are absolutely right. -- https://mail.python.org/mailman/listinfo/python-list