- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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 callssetMachinToBidule
(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.
Admin
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.)
Admin
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.
Admin
At least Java now has standard read-only implementations for
Map
,List
andSet
, 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.Admin
Have they not heard of the verb "convert"?