3 ms·
If I may offer the downside... :) There exists a type of programmer who will write essentially the same lines of code over and over and over again. If you're t
by jt2190 11y ago
If I may offer the downside... :)
There exists a type of programmer who will write essentially the same lines of code over and over and over again. If you're this type of programmer, having to type long function names is extremely painful.
There exists another type of programmer who refuses to retype the same thing over and over, so instead uses some technique for reusing that code. If you're this type of programmer then long, descriptive names are preferable.
- rimantas 11y agoIt is already mentioned: you never have to type those by hand, there is autocomplete with placeholders.
- kbenson 11y agoBut you do have do have to read them multiple times, and while while a descriptive name is good, there is a point where you are taking things too far and causing more problems than you are solving. If I'm reading a variable name and by the end I've forgotten the first half of it's name, the long descriptive name isn't helping me nearly as much as the author might think. Really, the variable name has a context, and I want to evaluate it within that context. That is, within the function as named, or the class and method, what does this variable name mean.
- rimantas 11y agoAlso mentioned: usually in these cases you have items on separate lines, aligned at co colon. So you have to read just the first line to know what it is all about.