The answers are still very helpful and demonstrate the responsible dissemination of practice. I tend to agree that names should not point to an implementation ( Foo may be an abstract class that was later ported to the interface). However, this is useful to me when coding has visual cues that I need to provide methods for derived classes.
As an example, I currently have a hierarchy (don't ask about the rationale for names, but they make sense in context and display the names of XML elements). I use Java, but I think most languages will be similar:
public abstract class Marker {...} public class Template extends Marker {...} public class Regex extends Marker {...}
Now I aim for:
public abstract class Marker {...} public class TemplateMarker extends Marker {...} public class RegexMarker extends Marker {...}
but not
public abstract class AbstractMarker {...} public class Template extends AbstractMarker {...} public class Regex extends AbstractMarker {...}
or
public abstract class AbstractMarker {...} public class TemplateMarker extends AbstractMarker {...} public class RegexMarker extends AbstractMarker {...}
I personally remember that Marker is an abstract functional concept and that subclasses are concrete implementations.
peter.murray.rust
source share