News for hackers. Stuff that matters.
Re:Taming names in software development by js8 on Sunday December 11, 2022 @02:52AM (#33941148)
Personally, I found there are two important aspects of things being named that are hard to express in names:

1. How important the thing is when it comes to big picture. Is this function where the meat of the program is, or it's just a technicality? Is this the main data structure or just something temporary? Good names should tell me what to focus on when reading the code.

2. Whether the name describes only the thing as it is, or actually prescribes what its use is. For example, LinkedList is descriptive because it tells only that the thing is a data structure, but it's up to you how to use it. On the other hand, CustomerRecord is prescriptive - it might be just a bunch of strings, but it also tells me what the intended use is, which is not necessarily contained in the code itself - it might be just some boilerplate to manage it in the database.

There are no comments on this comment yet.