general

Naming columns ID is evil

2011-06-12 14:34:09

When naming database columns my two pet peeves are fields called ID and field called date.

Renaming ID to _tablename_ID makes it clear when using it in code and SQL. It become obvious what it is the ID of.

Date. What date, yes it may be obvious now but naming it SavedDate or InvoicePostedDate is much more helpful.

Brad Evans — Senior Software Engineer at Right Click
Written by Brad Evans

Need a reliable senior engineer in your corner?

I have 20+ years of experience building production software, leading engineering teams, and shipping mobile & web apps. No middle-men—just direct, pragmatic engineering.