• HiddenLayer5@lemmy.ml
    link
    fedilink
    English
    arrow-up
    31
    ·
    edit-2
    1 year ago

    Sometimes I think Go was specifically made for Google to dictate its own preferences on the rest of us like some kind of power play. It enforces one single style of programming too much.

    • flame3244@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      1 year ago

      I think this is a good thing. The styles are just opinions anyway and forcing everyone to just follow a single style takes a lot of bikeshedding away, which I really like.

    • space_comrade [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 year ago

      From what I’ve heard from Google employees Google is really stringent with their coding standards and they usually limit what you can do with the language. Like for C++ they don’t even use half the fancy features C++ offers you because it’s hard to reason about them.

      I guess that policy makes sense but I feel like it takes out all the fun out of the job.

      • Sloogs@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        1 year ago

        Just about any place I know that uses C++ also does that with C++ so that’s nothing unusual for C++ specifically. It’s too big of a language to reason about very well if you don’t, so you’ve gotta find a subset that works.

    • philm@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      Is this a hard error? Like it doesn’t compile at all?

      Isn’t there something like #[allow(unused)] in Rust you can put over the declaration?

      • HiddenLayer5@lemmy.ml
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        1 year ago

        Never really coded in Go outside of trying it out, but as far as I know it’s a hard error.

      • flame3244@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Yes it is a hard error and Go does not compile then. You can do _ = foobar to fake variable usage. I think this is okay for testing purposes.