165

I work at a small company that uses very outdated coding approaches for their solutions.

About a year ago I went through our main application to improve performance and found quite a few areas that I could tackle such as using a dictionary data structure in place of (many) foreach loops that required to pull out a single object.

That specific change yielded a lot of improvement (you can only imagine) and the other developers wanted to learn the ways of dictionaries (because it was so revolutionary and new to them). I showed them many examples so that they could better understand this data structure.

Fast forward to a few months later, saw one of my coworker's code and noticed that they were using a dictionary... And iterating through each kvp similar to a foreach..... Wtf?!

P.S. that person's salary is much higher than mine :(

First time rant. Thanks for listening!

Comments
  • 13
    Welcome to the club, +1 and go get your avatar!
  • 6
    Haha, if they were iterating the values that wouldn’t be too bad but I think you should hit them with a chair.
  • 2
    Welcome to devRant!
  • 3
    Could you elaborate a bit on what improved? Going through a Dictionary using a foreach doesn't seem like something bad from my perspective. Are you talking about using linq or something?
  • 5
    They are probably using the foreach to get a single value out of the dictionary, instead of using the key to get it.
  • 4
    "very outdated coding approaches" => honestly it sounds more like trying to cut a tree with a hammer.
  • 1
    Welcome to devRant :D Almost stole my name there :P
  • 4
    @BorderKeeper like @henne mentioned, they're iterating through each kvp in order to get a single value out and then doing an exit for :\
  • 3
    Thanks for the warm welcome everyone! That is a good name @TheItalianGuy but I'm glad mine was available :)
  • 6
    Hey, welcome!
    Good first rant 😊

    But seriously, using an O(1) data structure in O(n) time? I'd facepalm so hard...
Add Comment