32

When you're trying to support a legacy product and you come across this goldmine. Stupid shit like this is the reason I want to murder people

(Read the order of the parameters)

Comments
  • 0
    Named params anyone? It saved me lots of time using them, though not sure if it was available by the time that code was written
  • 2
    On a second look, why is one function camelCase while the other is Pascal case?

    And "myXXXXX" var names get on my nerves -_-
  • 3
    @gitpush I agree "my" variable names are stupid. From the looks of it and you pointing both things out it would make sense if this was copy pasta code.
  • 0
    @n3xus exactly, hate it when someone paste without even reading again :\
  • 0
    Honestly guys this entire code base just gets worse the longer you look
  • 0
    It literally doesn't even matter what order you put them in
  • 0
    @jimshorts Yes it kinda does. When you read the method signature, it implies you should be passing in the higher value first. It then calls the Random.Next() function and passes the values in the incorrect order - and that throws an exception because the minValue cannot be larger than the maxValue
  • 1
    @Horkrine ah yes. I stand corrected. I am the problem as I do not read docs
Add Comment