|
|
|
|
|
by notdonspaulding
1246 days ago
|
|
In fact, I'm so fanatical about naming things, I'd probably give the two magic numbers and the return value names as well: function bakeCake() {
const bakeTemperature = 450;
const bakeTime = 45; // minutes
// ...
const bakedCake = bake(batterInPan, bakeTemperature, bakeTime);
// ...
const finishedCake = separateFromPan(cooledCake);
return finishedCake;
}
And I'd not look at a code review which quibbled about the particular names I chose as being a waste of time either. Time spent in naming things well is the opposite of technical debt, it's technical investment. It pays dividends down the road. It increases velocity. It makes refactoring easier. It improves debuggability. It makes unit tests easier to see. |
|