2 Comments

I like your examples using design patterns in general but I'm looking for your opinion on something.

Considering we are working with a dynamic language like Python, should we embrace duck typing or try to structure code/classes more akin to statically typed languages?

For instance, in your example I've noticed you don't define a common interface (defined as an abstract class in python, as interface classes don't exist) that the concrete algorithms must implement.

I've noticed that examples in python on websites such as https://refactoring.guru/ generally include abstract interfaces and the likes.

What is your take on this? Just keep it simple and take advantage of duck typing?

Thank you Laszlo!

Expand full comment