this post was submitted on 16 Apr 2025
702 points (99.6% liked)

Programmer Humor

22726 readers
1252 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 2 years ago
MODERATORS
 

So today I discovered that there's a cron job that holds non-reproducible state that died, and now our system is fucked.

The cron job doesn't live inside any source control. This morning it entered a terminal state, and because it overwrites its state there's no way to revert it.

I'm currently waiting for the database rollback and have rewritten it in a reproducible/idempotent way.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 23 points 6 days ago (1 children)

Idempotent code/repositories are great - I love making everything as reproducible as possible. Particularly in make where every 'all' type command should have a corresponding 'clean' command. Many times I'll see code bases where they skip defining the 'clean' command... or worse, have no 'all' command to begin with and rely on the developer knowing all the build and environment setup commands...

[–] [email protected] 21 points 6 days ago (1 children)

Yeah, I don’t consider most code complete unless it’s safe and reproducible. I love make, currently using npm but you can set up scripts with it. Automating the build process was the very first thing I did.

This project is a piece of work. There’s effectively no documentation, and every now and then I find something new like this. The stuff I’ve fixed up so far has been much much more reliable and performant.

Part of me just wants to rewrite the whole thing, but I need to ship features so we can sell the product and pay my salary.

At least I’m not a cog in a huge corporation getting my soul crushed every day. I actually love fixing weird stuff.

[–] [email protected] 5 points 6 days ago (1 children)

since you are currently using npm, check out pnpm

also "just" seems to be a more modern replacement for make

[–] [email protected] 4 points 6 days ago

I'll check out both, thanks!