• (nodebb)

    Taking this code in isolation, we end up face-to-face with a lack of knowledge about what other stuff is in the codebase, specifically the question of whether this code is just a (weirdly-named) transformation from the DTO's wire format to a map that's consumed by some (probably even more WTF) external component.

    No, that doesn't explain why it's called (paraphrasing) _getMachinBidule and calls setMachinToBidule (changing the verb and inserting a "To"), but it does provide a possible reason for why we want the transformation.

    I don't, frankly, believe that it's really that, but it exists as a possibility.

  • Klimax (unregistered)

    Why use object when all you have is key/value pair? Frankly, this is pretty mild at best WTF and strongly depends on what rest of code does with Map. OOO is not everything… (And secnod again? Funny.)

  • (nodebb) in reply to Klimax

    Define "all you have is key/value pair". All objects are basically sets of KVPs (see JavaScript), yet we have strongly typed compiled languages where those pairs are actual properties. If the names and types of the values are known at compile time, they SHOULD be objects - in a language like Java; you use a "dynamic" solution like a dictionary (Map<> in Java) when those aren't known.

  • (nodebb)

    At least Java now has standard read-only implementations for Map, List and Set, so you can avoid a lot of trouble pretty easily... though that won't stop people from misnaming methods. But then, nothing will do that and it was always thus.

  • Solomon Ucko (unregistered)

    Have they not heard of the verb "convert"?

Leave a comment on “The Getter Setter Getter”

Log In or post as a guest

Replying to comment #:

« Return to Article