34

I'll leave this here.

Comments
  • 0
    @rooter
    Haha 😂 I did not actually check the code below. This was already funny enough
  • 0
    😅😅
  • 2
    Is that Scala? If it is, The addition concerns me but the already merged code also concerns me. UpperCamelCase should only be used for constants according to the scala style guide and default values should be changeable, otherwise they aren't default.
  • 0
    @cmarshall10450 yes that's Scala. And yes those were constants. But I agree with you completely!
  • 4
    @A4Abhiraj it's not the worst I've seen.

    The other day I saw a regex of "\d" 13 times, twice, as already approved code in a pull request, instead of "\d{13}". That made me die a little inside.

    I have to admit that I'm not the best at regex so I might have missed something but I'm pretty sure I haven't.
  • 1
    @cmarshall10450 I can imagine how horrifying that is man!
  • 4
    @rooter the worst one I've ever seen for circumventing "no magic numbers" was like
    #define TEN 10
    #define HUNDRED 100
    #define THOUSAND 999
  • 2
    @Fast-Nop lol at THOUSAND 😂
  • 1
    @Fast-Nop I've seen time being defined liek that too.

    Val tenSeconds = 10
    Val oneMinute = tenSeconds * 6
    Val oneHour = oneMinute * 60

    Only the one hour variable was used.
  • 3
    In our code we have multiple constants like;
    TWO_FLOAT 2.0000000
    ONE_INT 1

    I shit you not. They are not named even after their context. There is even macro like;

    #define HALF(x) x/TWO_FLOAT

    Syntax might be different.
Add Comment