• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 day ago

    that static variable is local to that function

    Yes I know how static storage durations work. It’s still global state, which is a code smell. Actually I’d go as far as to say global state is just bad practice, not just a smell. Occasionally it’s the only option, and it’s definitely the lazy option which I won’t claim to never take!