Code Smell 278 – DirName and File | HackerNoon
Avoid Ambiguous Naming for Path Variables Problems Unclear variable purpose Bijection Fault Misleading context Repetitive code Harder maintenance Reduced readability Abbreviations Increased cognitive load Solutions Honor the Bijection Use precise names Avoid ambiguity Keep context clear Extract reusable code Follow naming conventions Reify names with their rules Context When handling a single fileName or directoryPath, vague names like file or dirName create confusion. A file should represent a File A fileName should represent the name