3 ms·
Corollary: Write code such that it's easy to use grep to find where things are used. One of my pet peeves is when OO programmers take class's separate namespac
by xamuel 11y ago
Corollary: Write code such that it's easy to use grep to find where things are used.
One of my pet peeves is when OO programmers take class's separate namespaces as a license to use super-generic method names. Method names like "add", "update", etc. Makes it near impossible to figure out where those methods are used!
- pm215 11y agoC preprocessor macros can also be a great tool for making things ungreppable -- building families of functions using preprocessor token pasting to put together the function names certainly avoids repetition in all those function bodies but it also makes it really hard to find the definition later...
- Too 11y agoThat's why you should use an IDE with proper "find all references" instead of coding in notepad.
- falsedan 11y agoBit trollish, but: IDEs which let you ignore the complexity of the code let you write complicated code. Writing in less-fully-featured environments forces you to consider simplicity as a desirable feature (so you can, y'know, work out what's going on when using a 80x24 terminal).