Skip to content
DevMeme
3021 of 7435
A Dog's View on Coding Anti-Patterns
CodeQuality Post #3336, on Jun 25, 2021 in TG

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

27
Anonymous ★ Top Pick Global state is just a singleton that's too embarrassed to admit it's a design pattern
  1. Anonymous ★ Top Pick

    Global state is just a singleton that's too embarrassed to admit it's a design pattern

  2. Anonymous

    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?”

  3. Anonymous

    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

  4. Anonymous

    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

  5. Anonymous

    Globals: the silent killer turning your monolith into a quantum soup of non-deterministic state mutations

  6. Anonymous

    Global variables: the hidden cache with no TTL and an infinite blast radius

  7. Anonymous

    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

  8. @sylfn 5y

    Haskell: you guys are using variables?

    1. Deleted Account 5y

      Nice

  9. @qtsmolcat 5y

    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

    1. @adhdnigga 5y

      it can be in a namespace or a struct or a class

  10. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

    Dark

  11. @adhdnigga 5y

    Naaaameespaceee::beeeef

    1. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

      Run::Run::Run::Run

  12. @sashakity 5y

    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

    1. @arpanetus 5y

      pass everything as a pointer

      1. @sashakity 5y

        thats what i said, passing everything as a giant struct.

        1. @arpanetus 5y

          but in fact glob var is ok for C it was not intended to satisfy needs of bonktional brogrammers

    2. Deleted Account 5y

      well, there goes our threading

      1. @behrad_4 5y

        Openmp to the rescue

        1. Deleted Account 5y

          will solve nothing here

  13. @sashakity 5y

    it becomes unbelievably complex

  14. @sashakity 5y

    passing everything as a pointer individually is even worse

    1. @sylfn 5y

      passing by value: i am absolute evil

  15. @vulpes_br 5y

    They do things dogs can't understand like coding at all

    1. @affirvega 5y

      Nice bio 👆

  16. @aw0x0 5y

    very sad picture btw

Use J and K for navigation