Very long class names

后端 未结 7 1621
一个人的身影
一个人的身影 2021-02-18 13:41

I try to name a class (also members, properties and so forth) as exact as I can. But sometimes I’m not sure if this is so clever if the class name becomes huge (50 chars and mor

7条回答
  •  旧时难觅i
    2021-02-18 13:55

    Every time you feel bad about your long names, try looking at this class for more than 5 seconds. I give you:

    • InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState

    And its big sister:

    • HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor

    Don't feel bad about it, names are supposed to be self explanatory, so as long as your class name is shorter than the code it contains, I think we are all good.

提交回复
热议问题