I write bugs and sometimes features! I’m also @[email protected].

  • 0 Posts
  • 4 Comments
Joined 1 year ago
cake
Cake day: June 21st, 2023

help-circle


  • CoderKat@lemm.eetoProgrammer Humor@programming.devGolang be like
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Let’s not pretend people acknowledge warnings, though. It’s a popular meme that projects will have hundreds of warnings and that devs will ignore them all.

    There’s a perfectly valid use case for opinionated languages that don’t let you get away with that. It’s also similar to how go has gofmt to enforce a consistent formatting.

    Honestly, I’ve been using Go for years and this unused variable error rarely comes up. When it does, it’s trivial to resolve. But the error has saved me from bugs more often than it has wasted my time. Most commonly when you declare a new variable in a narrower scope when you intended to assign to the variable of the same name (since Go has separate declare vs assign operators).