3 ms·
Because then someone else comes along and builds to the implementation and now that simple change becomes a mess of a refactor. An interface isn't just a type
by preommr 4y ago
Because then someone else comes along and builds to the implementation and now that simple change becomes a mess of a refactor.
An interface isn't just a type construct, it communicates the intent of the systems design.
- magicalhippo 4y agoDepending on language, interfaces also places additional constraints as it limits interdependencies. For example, in Delphi classes in the same unit (file) can access each others protected members. This is usually a code smell, which interfaces prevent.