Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

16
  • 2
    public interface of any class is an abstraction over its implementation. Commented Jul 14 at 18:05
  • @Basilevs: yes... and? Why are you saying that? Have I written the opposite? Commented Jul 14 at 19:06
  • 1
    They are also abstractions, because they have public interface, isolating clients from implementation details. Commented Jul 14 at 21:19
  • 1
    While I disagree with Basilevs on their advice for the OP, I think there's a confusion here in this comment thread between interface (the language construct) and the fact that classes inherently have a public interface. Basilevs is not wrong that classes do indeed have a public interface (even without being backed by an interface). The part I disagree with is the underlying assertion that this is clean enough by clean coding standards - which it is not. Commented Jul 15 at 0:36
  • 1
    In code bases that don't prefix all their interfaces with the letter (I) its trivial to copy a class change the original class to an interface and implement that interface from the new class - the only thing that typically changes in a well structured code base is the construction of the object. TL;DR - I introduce "language" interfaces when I need them. Commented Jul 15 at 10:36