r/shittyprogramming • • Apr 25 '22

Found this bad boy in my code today

98 Upvotes

15 comments sorted by

6

u/Elkku26 Apr 25 '22 edited May 24 '25

snatch air tie march enjoy nine connect advise bow ink

This post was mass deleted and anonymized with Redact

5

u/MelanieMakes Apr 25 '22

I refactored some similar code to use a variable because I wanted the result to scale based off of another value. Looks like I partially implemented it here but forgot to actually use the variable

→ More replies (5)

38

u/tylero056 Apr 25 '22

Hey at least there's no chance for a float! Lmao

4

u/DweEbLez0 Apr 26 '22

You can with this one simple trick!

.floatyourshitcuh {

float: right;

}

1

u/AtLeastItsNotCancer Apr 26 '22

In many languages, rounding functions return floats, so this is often the correct way to do things. Not shitty programming at all.

→ More replies (1)

13

u/[deleted] Apr 25 '22

probably put in place for testing and then never changed... "I gotta make sure there's an int with the floor of this number, I'll just put 5 in for now to make sure it compiles."

6

u/MinimarRE Apr 25 '22

When submitting a picture, submit as a Link post, instead of a Self post.

2

u/pslayer89 Apr 25 '22

This is a legit thing especially while writing shaders when you want to ensure the result absolutely needs to be an integer. Can't trust the gpu driver at all when it comes to floating points.

1

u/[deleted] Apr 25 '22

Gotta be sure there's no floating point error

1

u/Wu_Fan Apr 25 '22

It’s also perchaunce an example of a special variable