|
|
|
|
|
by PaulHoule
1614 days ago
|
|
There is a balance between two good things: (1) understandable names and (2) compact code that fits on the screen and avoids excessive line breaks. As opposed to DesignPatterns style names I often like names like FunctionThatThrows. I love writing tests where the name of the function says outright what the test does, even if the test name is 40 characters long (not like you're going to type it again!) People get in a lot of trouble when they try to write descriptive names for everything. It was one of the most interesting things in the Lenat/Guha book on Cyc that people get fooled by labels that look like natural language. If you really have a database of unique concepts and try to attach meaningful labels you are going to have an increasingly hard time when n goes past 1,000,000. Wikipedia does about as well as can be done. There's something to say about lowering your cognitive load and using names like "that", for instance return this.add(that)
|
|