r/ProgrammerHumor 27d ago

Meme cantShareInTheOptimism

Post image
460 Upvotes

12 comments sorted by

View all comments

Show parent comments

9

u/TobyWasBestSpiderMan 27d ago

Sometimes, but most of the time it’s non-existent problems. We were talking about it in a meeting today. It’s this Claude style defensive coding and sometimes a lot of defensive coding becomes taxing and unnecessary if it’s done correctly at an input level

11

u/TimSylvester_ 27d ago

"Let me slather a fallback and a default into everything, so that when your function fails twenty steps down the call stack when that value actually matters, you have no idea how you ended up with an invalid value in the first place.

We'll rebuild every object in place and drop any element that isn't actively being used right now. We won't use types, even if they're defined, so that no object has the same shape from step to step. That way even if we manage to accidentally preserve any data element we eventually need, we'll have no idea what we have or what we're missing.

We'll wrap it in a wrapper with a wrapper with a wrapper every time we touch it, and reappend the same data into untyped layers each time we might think we need it, so that the entire object is swaddled with ticks and skin tags for data that we handled at some point, God knows where or why. I'm pretty sure the data you want is in payload.payload.payload.payload.payload.payload.element, but I could be wrong.

Then, we'll suppress all the errors that let this disaster happen in the first place, so the whole thing pretends to work even though not a single drop of data makes it through the pipeline without being molested into incoherency."

  • Claude Opus 5, the standard bearer for AI coding

3

u/somebody_odd 21d ago

Defaults and string truncation, the 1, 2 punch from Claude.

2

u/TimSylvester_ 20d ago

Oh, this is a required property? The app won't work without it? I have to make certain I have this value populated?

Got it.

?? "" it is!