top | item 41932365

(no title)

sbergot | 1 year ago

Except it is biased in its conclusion:

> However, unlike our OOP example, existing code that uses the Logger type and log function cannot work with this new type. There needs to be some refactoring, and how the user code will need to be refactored depends on how we want to expose this new type to the users.

It is super simple to create a Logger from a FileLogger an pass that to old code. In OOP you also need to refactor code when you are changing base types, and you need to think about what to expose to client code.

To me option 1 is the correct simple approach, but the author dissmisses it for unclear reasons.

discuss

order

No comments yet.