3

Continuation of my first comment regarding the poor use of dictionaries...

Co-worker's code:
Foreach kvp in dict1{
ForEach kvp2 in dict2{
...
ForEach x in list{
ForEach kvp3 in dict3{
...
}}}

At least 2 of those kvp iterations can be changed to a standard dictionary use

What the hell am I looking at...... :(

Comments
  • 1
    Very common lazy, sloppy code.

    When you see them thinking "Oh! it makes things faster!" and the same cockwombles proceeding to create multiple dictionaries on every-single-damn-iteration-with-the-same-source you know it's time to leave.
  • 0
    @DenzilPenburthy I just modified probably 20ish of these in a single file.... Can't wait to see how much better it will be performed wise
  • 0
    @italyguy7 Make sure you reap the glory ;) If anything, this situation makes standups and sprint reviews bearable. I find that if you present a "before I fixed" and "after I did your job for you" measurements at a review it tends to shower laurels on me and shame on the predecessor. They really should know better.

    Problem then becomes "Can you fix my code for me?"
Add Comment