Opinion: Avoid Unneces Abbrevs

Many database developers (and other developers) seem to regard the endless use of abbreviations as some badge of honor. Don't be one of these people.

Avoid abbreviations almost all the time.

I've written before about my dislike for the EOMONTH T-SQL statement. Given the same version introduced names like DATETIMEOFFSETFROMPARTS, surely we didn't have to save 3 characters and could have had ENDOFMONTH. (I heard it was named this way to match the Excel function but matching something from another language that was created a long time ago isn't the right answer here).

I'd also note that I'd rather have seen it as END_OF_MONTH. It's a real pity that T-SQL has names like DATETIMEFROMPARTS but also names like NODE_FROM_PARTS all introduced in recent years. Again, I think there's a need for more cranky old dudes in the development team.

Now we can't change the language directly, but we can make better decisions when using the language.

For example, when using the DATEADD function, we have two choices for parameters. One is a set of (sometimes fairly obscure) abbreviated values. The other is a set of actual English words.

Please choose to use words not abbreviations.

Don't write this code like this:

Are you confident about what each of those means? Instead write this:

The same applies to column names. Don't write Mbr when you could have written Member.


One thought on “Opinion: Avoid Unneces Abbrevs”

Leave a Reply

Your email address will not be published. Required fields are marked *