Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 2
    I fail to see how two parameters of the same type, which are well named, lead to a maintanance problem. You have this all over the place in every existing piece of software. (Think createRange(from, to) or Math.pow(base, eponent), which is absolutely clear to every reader.) Commented Feb 16, 2022 at 6:01
  • Yes, I may be worrying for no reason. It was mostly when I went to register it in DI. I couldn't just register my two instances of IMap & then trust the LookupService to be constructed correctly - I now had to manually specify the creation of LookupService - but this my not be problematic & is reassuring to hear that you may not think it is. I thought about doing a strategy pattern so the MoreSpecificMap & LessSpecificMap also had to define a type explicitly setting them apart, but decided against it. Wasn't sure if I would regret it or not Commented Feb 16, 2022 at 6:08
  • 2
    I remember an interface where a 2d point was specified with two arguments h (horizontal) and v (vertical) and some genius changed it to (x, y). Still compiled. Results were completely wrong. Commented Feb 16, 2022 at 6:45
  • @mtj: the difference is the two IMap objects behave differently. Two different integers do not behave differently. Commented Feb 16, 2022 at 16:55
  • Do you need to mock the IMap objects for testing purposes? Do you have differing "specific" implementations, and differing "less specific" implementations? Commented Feb 16, 2022 at 16:59