• ByteJunk@lemmy.world
    link
    fedilink
    arrow-up
    78
    arrow-down
    1
    ·
    edit-2
    9 months ago

    I couldn’t care less about crashes, that’s an end-user problem. But do you expect me to go to sleep while that squiggly line in my IDE??

    /s just in case

    • kevincox@lemmy.ml
      link
      fedilink
      arrow-up
      5
      ·
      9 months ago

      I mean it isn’t even just a squiggly line, the code fails to compile. Like come on, I will clean up my unused imports and variables before sending it for review, but just let me develop in peace.

  • xmunk@sh.itjust.works
    link
    fedilink
    arrow-up
    27
    arrow-down
    2
    ·
    9 months ago

    You’ll go fmt and you’ll like it. Go has the single easiest to Google name of any programming language. Thou shalt not question golang decisions.

    • fl42v@lemmy.ml
      link
      fedilink
      arrow-up
      30
      ·
      9 months ago

      Go has the single easiest to Google name of any programming language.

      Ackchually Screenshot_20240215-004708_Mull

      • xmunk@sh.itjust.works
        link
        fedilink
        arrow-up
        19
        ·
        9 months ago

        C is also bad - but I do think .Net takes the cake. I’m willing to give C a pass though since it existed before we had search engines… Go was specifically developed at Google so there’s no excuse.

    • Scrath@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      9 months ago

      You bring back my bad memories of having to implement a server program in rust and all my searches ended up with about 1/3 useful results and the rest being hosting options for rust gameservers

      • tuto@lemmy.world
        link
        fedilink
        brezhoneg
        arrow-up
        1
        ·
        edit-2
        9 months ago

        Me (Chad): having to get 32GB+ of RAM to compile my memory-safe point-and-click adventure

        You(virgin): being able to compile your segmentation faults with 4GB RAM

        Giga Chad: having to get 32GB+ of RAM to compile rust-safe memory-leaks

        • uis@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          9 months ago

          Tera Chad: having to get 32GB+ of RAM to compile bus faults

    • YIj54yALOJxEsY20eU@lemm.eeOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      9 months ago

      Thank you very much, I’m definitely going to take this for a spin! Can I ask if you or someone you know uses this? I’m curious what the experience is like and if theres any downfalls.

      • anti-idpol action@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        9 months ago

        A simple example:

        
        func GetConfig(path string) mo.Result[*Config] {
        return mo.Try(func (*Config, error) {
        // logic to get the config
        })
        }
        
        conf := GetConfig.OrElse(&DefaultConfig)
        

        While it might not make much sense for a function you use just once, it can get actually pretty useful to simplify error handling like this for something you use more often.

      • anti-idpol action@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        9 months ago

        mostly the Result type. MustGet where you’d except a panic OrElse to pass a fallback value (can be a function with return value of the same type, as the inner function, but without an error). Useful in e.g. more complex constructors where some fields might not be readily available. Either can for instance be useful to have arbitrary type unions in structs. I haven’t used Option that much but seems similar to Rust’s.