3 ms·
> Unfortunately, no one can help you with the other hard problem: naming. I have a guiding principle here: If, a few minutes after naming something, you want t
by MauranKilom 5y ago
> Unfortunately, no one can help you with the other hard problem: naming.
I have a guiding principle here: If, a few minutes after naming something, you want to use the thing and (without looking it up) your first attempt at writing the name is correct, it's a decent name.
If you name a function processFoos and then later in your code your first intuition for what it was called is createBars, then there is some disconnect (and possibly some missing conceptual clarity) in what this function is supposed to accomplish. Is it more about accepting foos or is it more about creating bars? I find it very productive to, in such a case, dive a bit deeper into these differences (which may often also reveal something about different perspectives between caller and callee).
So TL;DR: If you don't have to look up the name of what you wrote minutes ago, it's probably a good name.