A Dog's View on Coding Anti-Patterns
Description
This meme uses a three-panel format with scenes of a golden retriever on a quiet country road to make a point about software development best practices. The first two panels show a wide shot of the road, with subtitles that read, 'Humans are complicated.' and 'They do things dogs can't understand.' The final panel is a close-up of the dog, looking earnest, with the punchline as the subtitle: 'like declaring global variables'. The humor lies in using the simple, pure perspective of a dog to pass judgment on a widely recognized coding anti-pattern. To an experienced developer, the use of global variables is a sign of poor design that can lead to unpredictable side effects and nightmarish debugging sessions. The meme hilariously frames this bad practice as an act so illogical and unnecessarily complex that even a dog, a symbol of simplicity and loyalty, finds it baffling
Comments
27Comment deleted
Global state is just a singleton that's too embarrassed to admit it's a design pattern
Global variables are the rural intersection of codebases - no stop signs, every thread has right-of-way, and the post-mortem starts with “why were we even on that road?”
After 20 years in the industry, I've finally understood why junior devs love global variables - they're like that one shared Confluence page everyone edits but nobody owns, until production crashes at 3 AM and suddenly it's your problem because you touched it last in 2019
The dog's confusion is justified - global variables are like leaving your house keys under every doormat in the neighborhood. Sure, everyone can access them, but good luck tracking down who moved your car at 3 AM when the production incident hits. Senior engineers know that the real complexity isn't in declaring globals; it's in the six-month debugging session trying to figure out which of the 47 modules mutated that state, especially when the stack trace points to a callback three layers deep in a legacy event handler that nobody's touched since 2015
Globals: the silent killer turning your monolith into a quantum soup of non-deterministic state mutations
Global variables: the hidden cache with no TTL and an infinite blast radius
Singletons are just global variables with a PR team - every new one adds an implicit dependency edge you’ll only discover at 3am during a flaky integration test
Haskell: you guys are using variables? Comment deleted
Nice Comment deleted
Well tbf when you need the variable in seven different functions that it'll be the same in and used the same it doesn't make sense to redeclare it seven times Comment deleted
it can be in a namespace or a struct or a class Comment deleted
Dark Comment deleted
Naaaameespaceee::beeeef Comment deleted
Run::Run::Run::Run Comment deleted
if it's a really small c program, it makes way more sense to use global variables for things like graphics contexts instead of making a giant struct to pass everything into every function Comment deleted
pass everything as a pointer Comment deleted
thats what i said, passing everything as a giant struct. Comment deleted
but in fact glob var is ok for C it was not intended to satisfy needs of bonktional brogrammers Comment deleted
well, there goes our threading Comment deleted
Openmp to the rescue Comment deleted
will solve nothing here Comment deleted
it becomes unbelievably complex Comment deleted
passing everything as a pointer individually is even worse Comment deleted
passing by value: i am absolute evil Comment deleted
They do things dogs can't understand like coding at all Comment deleted
Nice bio 👆 Comment deleted
very sad picture btw Comment deleted