Longest class name
-
Today's feature article was on the longest method name. But what about classes with long names? Can anyone come up with an example that beats
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
from Roslyn (the open-sourced C# compiler)? Examples should be from real-world code, ideally with a link for verification.
-
@RaceProUK said in THE BAD IDEAS THREAD:
For comparison:
InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
-
@RaceProUK Not bad, although it's kind of repetitive.
InternalFrame
InternalFrameTitlePane
InternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Almost sounds like some sort of song where you keep repeating everything you've done before while building up to what comes next. :P
-
Found a longer one than:
InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10MessageSecurityVersion
WorcestershireWhat's more, it's a nested class, so its full name is really
MessageSecurityVersion+WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10MessageSecurityVersion
And with the namespace, it's
System.ServiceModel.MessageSecurityVersion+WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10MessageSecurityVersion
-
@masonwheeler said in Longest class name:
Not bad
-
@RaceProUK said in Longest class name:
Found a longer one than:
InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10MessageSecurityVersion
WorcestershireWhat's more, it's a nested class, so its full name is really
MessageSecurityVersion+WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10MessageSecurityVersion
And with the namespace, it's
System.ServiceModel.MessageSecurityVersion+WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10MessageSecurityVersion
Alias: Fred.
Moving on.
-
-
@masonwheeler said in Longest class name:
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
But it's self-documenting!
-
@antiquarian said in Longest class name:
But it's self-documenting!
I keep suspecting that the text of the body of the implementation will be shorter than the name…
-
@dkf There's this poem from a book of silly childrens' poems by Shel Silverstein. It has this really long name, something along the lines of "thoughts on the topic of waking up in the middle of the night and having to go to the bathroom but I don't want to get out of bed because it's nice and warm here and the floor is cold and my feet will get cold if I have to walk down the hallway" and stuff like that, the title just goes on and on for a while. Then you get to the actual text of the poem:
Maybe it was better
when I was a wetter
-
-
@masonwheeler said in Longest class name:
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
That's what you get when you take "many small classes" approach to the extreme and don't know/can't comprehend "composition over inheritance".
-
@anotherusername Pfft.
-
@Gąska said in Longest class name:
@masonwheeler said in Longest class name:
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
That's what you get when you take "many small classes" approach to the extreme and don't know/can't comprehend "composition over inheritance".
To be fair, this is one of those instances where inheritance makes a lot of sense.
(The name... not so much.)
-
@RaceProUK but do they have classes there?
-
@anotherusername If they don't, they should.
-
@masonwheeler said in Longest class name:
@Gąska said in Longest class name:
@masonwheeler said in Longest class name:
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
That's what you get when you take "many small classes" approach to the extreme and don't know/can't comprehend "composition over inheritance".
To be fair, this is one of those instances where inheritance makes a lot of sense.
I'm pretty sure the "WithStackGuard" and "WithoutRecursion" bits can be factored out into generic functions that would be provided to BoundTreeRewriterOnTheLeftOfBinaryOperator in the constructor. But that requires your brain to not be fully devoured by OOP worm and understand that there's more ways to customize object's behavior than deriving the hell out of it.
-
@masonwheeler said in Longest class name:
@dkf There's this poem from a book of silly childrens' poems by Shel Silverstein. It has this really long name, something along the lines of "thoughts on the topic of waking up in the middle of the night and having to go to the bathroom but I don't want to get out of bed because it's nice and warm here and the floor is cold and my feet will get cold if I have to walk down the hallway" and stuff like that, the title just goes on and on for a while. Then you get to the actual text of the poem:
Maybe it was better
when I was a wetterRemove one letter and it stops being children's poem.
-
@RaceProUK Wow, that's worse than Whakarewarewa's full name!
(But less humorous, as a Maori
wh
is equivalent to en Englishf
)
-
@Gąska said in Longest class name:
"composition over inheritance".
I always wondered whether there was an advantage of having a class that's nothing but a giant forwarding API to a subset of classes that composes it.
Seems like there should be a way to automate composition.... like multiple inheritance, but without mixing all the sandboxes together.
-
-
@HardwareGeek said in Longest class name:
@masonwheeler said in Longest class name:
Not bad
Agreed. I hate overly long names.
-
@RaceProUK said in Longest class name:
@anotherusername Pfft.
Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
-
@xaade said in Longest class name:
@Gąska said in Longest class name:
"composition over inheritance".
I always wondered whether there was an advantage of having a class that's nothing but a giant forwarding API to a subset of classes that composes it.
Seems like there should be a way to automate composition.... like multiple inheritance, but without mixing all the sandboxes together.
Like a mixin, kind of?
-
From our live Python codebase (these class names are GPL3, but whatever):
spinnman.messages.eieio.data_messages.eieio_16bit_with_payload.eieio_16bit_with_payload_payload_prefix_lower_key_prefix_data_message.EIEIO16BitWithPayloadPayloadPrefixLowerKeyPrefixDataMessage
spinnman.messages.eieio.data_messages.eieio_16bit_with_payload.eieio_16bit_with_payload_payload_prefix_upper_key_prefix_data_message.EIEIO16BitWithPayloadPayloadPrefixUpperKeyPrefixDataMessage
spinnman.messages.eieio.data_messages.eieio_32bit_with_payload.eieio_32bit_with_payload_payload_prefix_lower_key_prefix_data_message.EIEIO32BitWithPayloadPayloadPrefixLowerKeyPrefixDataMessage
spinnman.messages.eieio.data_messages.eieio_32bit_with_payload.eieio_32bit_with_payload_payload_prefix_upper_key_prefix_data_message.EIEIO32BitWithPayloadPayloadPrefixUpperKeyPrefixDataMessage
I guess I'm fortunate that the first few components of the qualified path are short; many of our packages are much wordier there…
-
@antiquarian said in Longest class name:
@masonwheeler said in Longest class name:
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
But it's self-documenting!
This is self-commenting code, not self-documenting code.
-
@dkf said in Longest class name:
EIEIO
Not sure if anonymization or if @dkf works for seven dwarves.
-
@dkf said in Longest class name:
eieio
TIL.
https://en.wikipedia.org/wiki/EIEIO, among other meanings:
- Enforce In-Order Execution of I/O, a machine instruction used on the PowerPC computer processor
- EIEIO, an Emacs lisp implementation of the Common Lisp Object System
- Computer bought the farm, an error message with symbol EIEIO, from the GNU Hurd operating system [haha, very funny ]
-
@Zecc said in Longest class name:
Not sure if anonymization or if @dkf works for seven dwarves.
No anonymization this time. Those classes really do sound like they should be singing about gold. (Also, I was too lazy to come up with replacement names of the same length. The way the bits of names are repeated in silly ways and… meh; just CBA.)
-
@dkf said in Longest class name:
No anonymization this time.
Also, the rest of the class definition is about the length of the (full) name. Yes. It's a set of very silly little classes with stupidly long names. I'm probably going to refactor it all tomorrow. With an axe or maybe some gasoline and a match.
-
@Zecc And on his farm he had some unix...
-
With a core dump here,
and a core dump there,
Here a dump,
there a dump,
but proper debuggers nowhere!
-
@masonwheeler said in Longest class name:
With a core dump here,
and a core dump there,
Here a dump,
there a dump,
but proper debuggers nowhere!EIEIO!
-
@masonwheeler said in Longest class name:
With a core dump here,
and a core dump there,
Here a dump,
there a dump,
but proper debuggers nowhere!Old Mc-intosh had a... SPARC.
EIEIO
-
@Magus said in Longest class name:
@Zecc And on his farm he had some unix...
Seven Dwarves, Old MacDonald... same thing.
-
@Zecc said in Longest class name:
@Magus said in Longest class name:
@Zecc And on his farm he had some unix...
Seven Dwarves, Old MacDonald... same thing.
To be fair, most Dwarf Fortress embarks start with Urist McMiner, Urist McCarpenter, Urist McWoodCutter, Urist McMason, Urist McJeweler, Urist McFisher, and Urist McClothesMaker.
That's seven dwarves, although generally you don't get Urist McDonald until much later in the game unless you're unlucky and the king dies and one of your starting seven was their son or daughter or something.