There probably isn't a surefire way to get better at this and something that must be worked on and cultivated. But any advise pointing the way is appreciated.
Ask HN: How to learn to give clear, descriptive names to class, methods etc
1–5 of 5 posts
Re: Ask HN: How to learn to give clear, descriptive names to class, methods etc
#2My personal approach is to copy shamelessly. Whenever I come accross a very readable piece of code, I add it to my bookmarks. When I am stuck with naming something I go through my bookmarks and somethin inspiring always comes up.
Re: Ask HN: How to learn to give clear, descriptive names to class, methods etc
#3The strategy I use is to iterate naming, just as I would any other aspect of code. You are unlikely to want to do this as often, but if you find your current names are no longer working for you, it might be time for a change.
Re: Ask HN: How to learn to give clear, descriptive names to class, methods etc
#4Re: Ask HN: How to learn to give clear, descriptive names to class, methods etc
#5Much of the problem of naming things is that the name you give them now, is unlikely to be the most appropriate name in the future. For example, your code may change, you may make other similar classes that would be more appropriate with that name, etc. The strategy I use is to iterate naming, just as I would any other aspect of code. You are unlikely to want to do this as often, but if you find your current names ar…