rectangles: polish example implementation#254
Conversation
jtigger
left a comment
There was a problem hiding this comment.
The "mandatory" change is to reconcile that some variables are named ...entry when now referring to a value from the Element enum.
I have a suggestion for another name for Element. :)
| SPACE; | ||
|
|
||
| private static Entry fromChar(final char rawGridEntry) { | ||
| private static Element fromChar(final char rawGridEntry) { |
There was a problem hiding this comment.
I sense an intent to want to pair-up the input and the output, by picking a similar name; if so, that got lost in the rename of the output type.
tl;dr — Piece?
I couldn't help myself... I had to attempt to suggest names for these little bits of the diagram (not that Element isn't "right"... just nice having options). In that journey I discovered that the Dictionary/Thesaurus that comes OOTB with OS X has a neat little section on some words called "Choose the right word". There's one such entry for "part". It reads like this:
The whole is equal to the sum of its parts — part being a general term for any of the components of a whole. But how did the whole come apart? Fragment suggests that breakage has occurred (fragments of the vase) and often refers to a brittle substance such as glass or pottery. Segment suggests that the whole has been separated along natural or pre-existing lines of division (a segment of an orange), and section suggests a substantial and clearly separate part that fits closely with other parts to form the whole (a section of the bookcase). Fraction usually suggests a less substantial but still clearly delineated part (a fraction of her income), and a portion is a part that has been allotted or assigned to someone (her portion of the program). Finally, the very frequently used piece is any part that is separate from the whole (we're missing two pieces from the jigsaw puzzle).
There was a problem hiding this comment.
I'm sick, so apologies for the abbreviated reply; but your Piece made me think of another option: Tile! I'm happy to use whichever of those two you prefer :)
There was a problem hiding this comment.
I'm sick, so apologies for the abbreviated reply ...
Unacceptable; sickness is for the weak. 😷
Oooohhh I love Tile too! I dig the physicality of it. Seems like the best names are those that are the most concrete but not overly-so.
Hope you're feeling better, soon, Stuart! 🤒
|
|
||
| private boolean isVerticalConnector() { | ||
| return this == CORNER || this == VLINE; | ||
| } |
There was a problem hiding this comment.
ooh! I ❤️ ...Connector, here!
b4bd746 to
bc4aa49
Compare
bc4aa49 to
5119e20
Compare
|
Updated! |
|
|
Following on from #243.
Renames
Grid.EntrytoGrid.Elementand adds a couple query methods to theGrid.Elementtype for readability.