this post was submitted on 04 Apr 2024
960 points (97.4% liked)

Programmer Humor

19589 readers
490 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] RavenFellBlade@startrek.website 36 points 7 months ago* (last edited 7 months ago) (34 children)

I'd love to know what this would actually do.

Edit: Thanks for the responses and lively discussion!!

[–] BombOmOm@lemmy.world 85 points 7 months ago (28 children)

Assuming the accounting system this thing links with both does not protect from SQL injection attacks (many don't, despite it being easy to protect against) and also has a table named "Bills" with a field named "amount"; what this would do is go through every single Bills record and half the value in the amount field. This would completely fuck the system, particularly when it came to billing and tax filing as the numbers for accounts billing and receivable wouldn't even come close to matching each other. The accounting department would have a hell of a time fixing the damage.

[–] lightnsfw@reddthat.com 12 points 7 months ago (8 children)

Couldn't they just *2 all the bills from before this was ran and straighten it out?

[–] dfc09@lemmy.world 17 points 7 months ago (2 children)

I imagine they could if they knew exactly what you did and when, but if it doesn't get discovered until later and nobody knows what happened, it would probably be a bitch to figure out

[–] T156@lemmy.world 7 points 7 months ago

It seems like it would be fairly easy to find. All you need to do is find out where the price drops massively, and work backwards from there, since it doesn't change the code going forward.

[–] SchmidtGenetics@lemmy.world 5 points 7 months ago* (last edited 7 months ago) (1 children)

Pretty sure it would be obvious to anyone working there that chicken tenders are $10 not $5. Even a quick glance at any single bill would show the issue.

[–] DrJenkem@lemmy.blugatch.tube 7 points 7 months ago (1 children)

No it would change the value of all past bills, future bills would still be correct.

[–] SchmidtGenetics@lemmy.world 0 points 7 months ago (1 children)

And anyone who looks at a past bill would see half price tenders.

[–] DrJenkem@lemmy.blugatch.tube 2 points 7 months ago* (last edited 7 months ago) (1 children)

No. The bill given to the customer would still show the correct amount.

And if anyone looked at previous bills from the backend, they would see normally priced chicken tenders. The total for the bill would be wrong though.

[–] SchmidtGenetics@lemmy.world -1 points 7 months ago* (last edited 7 months ago) (1 children)

Bill

2x orders chicken tenders $10 =20

Bill total $10 - 20/2 = 10…

Huh… I wonder what the issue is…..

[–] DrJenkem@lemmy.blugatch.tube 3 points 7 months ago

Yeah, obviously the issue can be discovered. My point is that it's not going to be immediately discovered by the cashier or a customer. It'll probably not get discovered until the accountant comes by and notices the discrepancy.

load more comments (5 replies)
load more comments (24 replies)
load more comments (29 replies)