>
> The wording “spicy”, “heretical”, “literally unusable”, “vibe”, the use
> of ChatGPT, and the current calendar date requires me to ask:
>

Actually, if we put aside all of this, and think about it more seriously,
personally I myself find it somewhat tedious to have every class have
interface for the sake of being able to decorate it.

Everything we expose as api for the client code normally should have an
interface, and usually it ends up with superficial name: either suffixed
with Interface (I know it is in PHP), or prefixed with I (C#), or just a
normal name, while the actual class is suffixed with Impl (Java), or any
other naming that only shows the problem of superficial separation.

In my opinion, it could be a good thing to consider if we could do it more
easily.

It reminds me of C++, where every class has .h file with headers without
actual implementation (IOW, interface, client code uses it), and the actual
implementation in .cpp file. Though the two are still physically separated,
they still logically make the same unit.

Having the ability to implement the class, we'd not need to suffix
interfaces with Interface all around where there's only one implementation
of it. On the other hand, it still makes sense to keep normal full fledged
interfaces, since these are usable when there are multiple different
implementations (say, we have BankTransactionsGateway as the interface, and
PrivatBankTransactionsGateway, MonoBankTransactionsGateway as
implementations), since in this case interface is a normal expected
abstraction, that should be kept separate.

Thank you

>

Reply via email to