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
-
cyanly6286yWe have a senior software engineer apparently lived the golden age of tape programming delivered a major piece last year that he proudly blended order flags within a single byte, all bit operator and shits.
Now the clean up crew had to figure out how to implement extra flags.... hundreds of thousands of orders going through system like yours.... -
@cyanly Using bit operations for flags is highly convenient if done right. Using only a single byte, limiting the number of flags to 8, is just plain stupid.
I'd have checked how many flags there are, multiplied by three, and then used the number of required bytes plus mod 2.
Related Rants
What a fucking day!
So some many years ago, we placed a small and useful piece of code into a MySQL Query, which prefixes the order ids with a string and returns the value.
Basically
SELECT
CONCAT(“ORDER_PREFIX”, LPAD(order.id,5,’0’) AS order_reference
Now many years ago when this was a simple solution to a system that wasn’t expected to be running today, all went well, except today.... today that fucking line exceeded 5 digits
😓😍😓
I don’t know if I should be ashamed, or happy right now, a totally unfuture proof query that just rolled that little too far, or the fact that I’ve watch 100k orders role through this system.
Now for the clean up crew to do their job.... oh 🙁 that’s me too.
Now this doesn’t affect the order ids... so that’s something but external systems rely on that guy 😭
rant
why did that ever get written like that
happy
cry
tired
confused
ashamed