Discussion about this post

User's avatar
Makoto's avatar

When you said:

>This is what we call a "magic boolean"—and >it’s bad for readability, maintainability, and >scalability.

It applies for every hardcoded value that write without any meaning 1, 0 "magic" is very hard to understand

And inside Public apis enums are better to extend than simple boolean without breaking retrocompatiblity.

Expand full comment
Abelardo's avatar

I would fix it by using an abstract class (called ProcessTransaction) where this method, processTransaction, would be abstract (not implemented). Then, I would create two classes: InternationalProcessTransaction and DomesticProcessTransaction. So, both classes extend from ProcessTransaction and they would override the mentioned method at their own.

Expand full comment

No posts