3 ms·
At my last job, there was a frontend developer who added a linter rule that variable names must be at least 2 characters long. The project already had 20,000 li
by NAHWheatCracker 2y ago
At my last job, there was a frontend developer who added a linter rule that variable names must be at least 2 characters long. The project already had 20,000 lines of code. Every time anyone made a change to a file, they would have to rename all the one letter variables. Usually, this meant all the for loops in the file. I tried to explain how pointless this rule was, but he wasn't having any of it.
Most people just renamed variables like i > ii, which was worse.
- deleted 2y ago[deleted]
- morkalork 2y agoWhat is even the point of digging in deeper, did they not see everyone around them doing the i>ii workaround? You've lost, call it a failed experiment and move on.
- tomrod 2y agoEye and Jay are go to as well
- johnny22 2y agoa good linter rule would have exceptions for loop variables by context by just by name like i, j, k. Often just by name is good enough at least for a solo dev or small team. I require them to be at least 3 chars EXCEPT those. For example: https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html#cmdoption-arg-IgnoredLoopCounterNames https://clang.llvm.org/extra/clang-tidy/checks/readability/i...