4 ms·
Don't want to sound mean, but is there an excuse for excessively long names? http://javadoc.bugaco.com/com/sun/java/swing/plaf/nimbus/InternalFrameInternalFram
by ericHosick 14y ago
Don't want to sound mean, but is there an excuse for excessively long names?
http://javadoc.bugaco.com/com/sun/java/swing/plaf/nimbus/InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonPainter.html http://javadoc.bugaco.com/com/sun/java/swing/plaf/nimbus/Int...
(link from a recent HN post)
(Edit: Just wanted to point out that the concept goes both ways).
- brazzy 14y agoThe only excuse for such a monstrosity would be that it's machine-generated and follows some scheme that prevents name collisions. If you look at the other class names in that package, it seems pretty clear that the name was in fact the result of a bug that duplicated prefixes. It almost certainly should have been InternalFrameTitlePaneMaximizeButtonPainter, which is admittedly pushing it but can be justified.
- ericHosick 14y agoI would argue that the reason why we end up with really long or short names is of no importance: they exist. The only important factor of variables names is that they help with "documenting" the source code. I just wanted to point out that it goes both ways.
- zxcdw 14y agoIndeed. However, I personally do see that variable names/naming is really something where some people tend to over-engineer things. Say iterating over an array. Why on earth would anyone bother with using "index" instead of "i"? What does it add, other than unnecessary bytes? Another example would be using "Input" and "Output" as argument names instead of simply "In" and "Out". Unnecessary bytes, repetition, noise for no stronger signal. No new information, just noise.
- ericHosick 14y agoTrue that. Now where is that quote (just for fun): "There are only two hard things in Computer Science: cache invalidation and naming things." - Phil Karlton