Share via


Object Calisthenics: Rule 5: Don't abbreviate

This rule has a weird name I think. What it means is that whenever you abbreviate in a class or method name you should think about why you do that. The assumption is that if you feel you need to abbreviate something it means you're using it too much. Also that a long method name typically means there is another class that could be created. A simple example would be an order object with a method "CreateInvoice". Maybe a better solution is to have an invoice object with a "Create" method.

The confusing part however is that don't abbreviate to me means writing everything out. But the explanation for this rule is that you should not abbreviate anything and each class and method name should be one or two words only. This is a fairly easy rule to conform to when practicing object calisthenics.