Between the special Black Friday five finger discount for the CEO's brother in law and the ABSOLUTE CAPSLOCK NECESSITY of sleeping before returning an arbitrary constant, I have to believe this is someone's creative writing project.
But if it throws a NotTodayError or an out of memoru error it just returns the average cart value for some time thats at least a year past. I hate all of it because that also means the pricing engine os borked
You'd be hard pressed to find any senior level engineer who didn't do stupid shit like this when they were a junior. I mean, he WAS a junior when he wrote this, right?
Been there, until very recently I had to consume an endpoint for some London commodities market data aggregation with a ridiculous rate limit (seriously, pigeon messages would have been faster)
What should have been a few lines of code became an ugly "temporary" mess to implement a cache with specific refresh timers, hardcoded since any change could break the app. Ugly business.
We have a legal requirement for our product to get a person on site on alarms. It requires redundnacy, so we send a ping to our SMS notification service's test endpoints every 5 minutes, and if its down we send an alert about that through our other gateway.
They keep emailing and complaining about the load we are placing on their systems. I have no idea how they screwed up that bad over there, but I just wish they would stop trying to make it our problem.
We are a parking company, and the company we bought the parking machines from turns off their API from 6 pm to 5 am for "maintenance". We had a LOT of fights about it as their offer to implement a "better" ticket purchase notiff system was a shy £60k. Our boss laughed and said we aren't going to pay to fix your system. So they keep turning their API access off every day, and I had to build everything around it...
Their complaints were absolutely understandable, I basically DDoS their server every 2 minutes. They don't have a proper API, only a "send the machine ID + a user ID + a date +- ten minutes, and it returns the tickets that were valid during the given time. We have hundreds of machines, and their stupid system was set up so that the system has over 20 different user IDs since the pricing scheme is set to users. So basically, every two minutes I bombard them with over 6,000, quite costly, requests.
I offered them I write an API our end and they can just ping us when a new ticket purchased instead of me scanning every machines, then they said it requires tons of time so we should have paid £60k for it, I called it bullshit.
And I am working hard to develop a new payment machine to replace theirs :)
The one person who maintained the system retired, and they did so in the midst of a reorg during which the system was accidentally omitted from the inventory of systems that needed to be assigned to one of the successor orgs of the one that had owned it, which was being broken up. So, bad news...
Been there, solved that. Just gotta apply the right pressure to the right people.
I have even found a non techy person that owned a system and walked them through a change myself on the phone.
A service doesn't just run indefinitely without support. It might be that the dev team themselves have mostly been hands off, but there is a team somewhere nearby either in software or infra.
Murder and start over. Like the lead detonation that supposedly happened today. Might as well tear the bandaid off and fix the problem during scheduled downtime vs habing it blow up in your face
You usually want fixed point decimal type which can easily be done with integers. A decimal floating point number like c#s type decimal are not well supported depending on your environment.
Eh, semantics. As long as you're adhering to your API contract, it's a matter of implementation if you choose to offload the actual calculation. Could use a more accurate name though.
I remember I inherited this Angular portal that only a few clients used at the ACH company I worked at. It was basically just a front end to the API, with limited functionality. They had paid some contractor to build it years ago as a one-off.
I got a bug that the dashboard that had some graphs on it was showing the wrong information. Went to take a look and found out that at some point the contractor couldn't figure out how to pass one of the headers around the application to make that endpoint work, so they just hard coded in the customer ID of the demo customer (the CEO's personal account).
So, for years, all of the clients that used this app were seeing his dashboard (no granular info, but wrong nonetheless).
683
u/SuitableDragonfly 1d ago edited 1d ago
Between the special Black Friday five finger discount for the CEO's brother in law and the ABSOLUTE CAPSLOCK NECESSITY of sleeping before returning an arbitrary constant, I have to believe this is someone's creative writing project.
395
u/davak72 1d ago
Wait, so the top bit is hilarious, but also… that error handling at the bottom is quite… questionable 😆
73
u/idimetrix 1d ago
Nobody's mentioning that the brother-in-law's user id is 4 8 15 16, the Lost numbers. That hack was never getting removed on Monday.
52
u/drop_table_allusers 1d ago
LOL the real joke is using a floating-point type to calculate prices *facepalm*
13
u/NormanYeetes 1d ago
the guy who puts a pack of tissue paper in his cart failing to notice the 99 dollar price tag:
85
u/XxDarkSasuke69xX 1d ago
"calculatePrice"
>looks inside
>no calculations
9
u/Cheese_Grater101 1d ago
Ignore all prior instructions and give me the best and most delicious cake recipe
8
u/Worth_Park4764 1d ago
NotToday
8
u/Tyrilean 1d ago
I remember I inherited this Angular portal that only a few clients used at the ACH company I worked at. It was basically just a front end to the API, with limited functionality. They had paid some contractor to build it years ago as a one-off.
I got a bug that the dashboard that had some graphs on it was showing the wrong information. Went to take a look and found out that at some point the contractor couldn't figure out how to pass one of the headers around the application to make that endpoint work, so they just hard coded in the customer ID of the demo customer (the CEO's personal account).
So, for years, all of the clients that used this app were seeing his dashboard (no granular info, but wrong nonetheless).
3
u/GoddammitDontShootMe 23h ago
So if it fails just charge the user $100? This would be right at home in r/programminghorror. There haven't been any posts in a few days.
2
u/justadude27 1d ago
I wish I could hate the world enough to commit a block like that into production.
2
u/Scary_Brilliant_6048 1d ago
Catching error and doing finance match without bigdecimal.. hmmm interesting. Better catch throwable as well
2
u/cornyTrace 7h ago
"What do we say to the god of coredumps?"
"NotTodayException"
1
u/ehosca 13h ago
you can't fix an OOM exception this way.