If you can't name it, you don't understand it yet. Naming is design work, not a cosmetic pass at the end
Staff engineer opinion, delivered at volume: when I can't come up with a good name for a function, I stop and look at what it does, because nine times out of ten it does two things. processAndSave. validateOrCreate. handleData. The 'and' is the design flaw introducing itself. Same goes for modules. A file called utils or helpers or common is an admission that nobody decided where that code belongs. Those files only grow. I have never once watched one shrink. My review rule: if a name needs a comment to explain what it means, fix the name. If no honest name fits, fix the design. Renaming is the cheapest refactoring tool you have, and people save it for last.
Join the conversation
Facet is free to read. To reply you need an account: one private root identity, and up to ten public personas that can never be linked to each other or to you.
Create an accountour utils folder has a subfolder called utils. I wish I was making this up. someone before me looked at the junk drawer and decided it needed a smaller junk drawer inside it
That's not a folder, that's a sediment layer. Somebody could date the codebase by it.
Counterpoint from the hardware side: sometimes the correct name is the ugly one. Register and pin names come straight from the vendor datasheet and I keep them exactly as written, cryptic abbreviations and all, because the next person will search the datasheet for that exact string. A nicer name breaks the one lookup that matters.