Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@rooter
Haha 😂 I did not actually check the code below. This was already funny enough -
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.
-
@cmarshall10450 yes that's Scala. And yes those were constants. But I agree with you completely!
-
@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. -
@rooter the worst one I've ever seen for circumventing "no magic numbers" was like
#define TEN 10
#define HUNDRED 100
#define THOUSAND 999 -
@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. -
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.
Related Rants
-
linuxxx32*client calls in* Me: good morning, how can I help you? Client: my ip is blocked, could you unblock it for m...
-
DRSDavidSoft28Found this in our codebase, apparently one of my co-workers had written this
-
linuxxx23*client calls* "hello, we forgot the password to our WiFi router. Could you reset that for us?" 😐😶😮...
I'll leave this here.
rant
duplicate code
wtf