4 ms·
Related to this, it is generally a very good idea to be strict when naming functions, parameters, variables, etc. so that each concept has exactly one name thro
by felipeerias 7y ago
Related to this, it is generally a very good idea to be strict when naming functions, parameters, variables, etc. so that each concept has exactly one name throughout the codebase.
- polytomous_ 7y agoAlso, check your spelling. It's a pain when items don't show up in search because of spelling issues. I've seen function names misspelled, and then every invocation just doubling down on that misspelling.
- yakubin 7y agoI encountered a similar problem in a c++ codebase and the debugging logs it produced. There was an error which was being reported in the logs as "weak ptr expired" or somethings like that. I grepped for it the whole source code (a gigantic project). No results. Going back and forth several times. Feeling stupid beyond imagination. Then I copy-pasted what was actually printed in the logs into my grep query (previously I was typing it in manually). It quickly found a match. Turns out someone wrote "weak ptr" as "week ptr". Everyone in the team had a good laugh.
- jandrese 7y agoAnd it turns out the pointer expired on sunday morning, except in some regions where it expired on some other day.
- xamuel 7y agoAlso, please think twice before using OO classes as a license to give all your methods useless names like "get", "add", "open", etc.!
- splittingTimes 7y agoBut how do you effectively orhanize/enforce this for a code base of several million LOC where geographically distributed teams are working on different ends of the system all the time? The amount of cross team coordination is staggering.
- paulddraper 7y agoDocumentation, I think.
- peterstensmyr 7y agoFail verification in CI if the change doesn’t pass your checks. You can check anything, such as whether it has a duplicate name already in the codebase.
- splittingTimes 7y agoI would be interested to know, which CI tool can check "that each concept has exactly one name throughout the codebase." I thought code reviews are the only way and then you need to have every Dev aligned and on the same page on this topic... Which never happens. :/
- peterstensmyr 7y agoIt wouldn’t be something provided by the CI tool, you’d have to write the test yourself. At the end of the day it’s just another test, albeit a more complex one than a standard unit test.