It seems to me that it'd be useful to be able to tell at a glance that a class is abstract and not meant to be directly instantiated just like it's useful to be able to easily identify an interface.
My question is, why didn't "AFourLeggedAnimal : IAnimal" catch on? Is it simply because of the possible confusion (which I just noticed while writing that) for example confusing it as "A four legged animal" instead of "abstract class FourLeggedAnimal"? Or is it something more?
Coming from Java in school to C# at work, I found the "I" prefix naming convention extremely useful when glancing through a list of classes and it seems to me that it'd be convenient to be able to distinguish between concrete and non-concrete classes at a glance without needing to look at the code.
Use the suffix "Base" as Joel mentions. Once you have a lot in your project, it's pretty easy to tell apart:
public abstract AnimalBase
{
public AnimalType AnimalType { get; set; }
}
public abstract HorseBase : AnimalBase
{
public HoovesManufacturer HoovesManufacturer { get; set; }
}
public class Pony : HorseBase
{
public Pony()
{
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With