User:Average/LeaveItNaked

From HackerspaceWiki
Jump to: navigation, search

A companion rule to ClotheYourData, that says don't put your data in a (new) struct or class if you don't have a meaningful categorization for it. If you know, that a bunch of data is going to travel around with other data, put a NAME on it ("EmployeeRecord").

If your iterator is a character, call it "ch". If it's a integer (for [semantic-level] arithmetic), call it "n". If it's an index, call it "i".

In other words: expose yourself, lest you lead other programmers on that you know more about what you're doing than you actually do.