• qazOP
      link
      fedilink
      81 year ago

      I would love to use golang for this but it’s standard library alone is bigger than the amount of available RAM.

          • @mkwt@lemmy.world
            link
            fedilink
            21 year ago

            Likely your C++ implementation also doesn’t ship the full standard library. And you may even turn off exceptions and RTTI.

      • @gredo@lemmy.world
        link
        fedilink
        21 year ago

        Interesting, since golang only includes the parts of the stdlib that are used in the executable binary.

        • qazOP
          link
          fedilink
          41 year ago

          I just tested it and a simple hello world program still produces a 1.7MiB binary, while the device only has 512KiB of RAM.

          package main
          
          import "fmt"
          
          func main() {
              fmt.Println("hello world")
          }
          
  • Limitless_screaming
    link
    fedilink
    131 year ago

    Function is changing a global variable, the global variable is checked after every call to the function. That’s your return value.

  • @marcos@lemmy.world
    link
    fedilink
    -21 year ago

    Ok, you are certainly in one of those languages where plenty of your functions shouldn’t return a value, and you won’t ever let the compiler know that.

    On all of the other languages, it’s an error, not even a warning.

    • qazOP
      link
      fedilink
      91 year ago

      It’s C++ and it just causes a SIGILL.

  • @Perroboc@lemmy.world
    link
    fedilink
    561 year ago

    int unused_variable = 0;

    Dude wtf is your problem don’t just leave things lying about there don’t you know how to code I mean what the- I don’t go to your house and leave shit on the floor and just—

    int _unused_variable = 0;

    Ok. We cool.

  • @fl42v@lemmy.ml
    link
    fedilink
    11 year ago

    Idk, mb they expected you to modify smth passed by reference/pointer, and the compiler’s too busy to care :)

  • Bappity
    link
    fedilink
    English
    29
    edit-2
    1 year ago

    I am guilty of passing Exception variables into try catches and not using them

    • @Steeve@lemmy.ca
      link
      fedilink
      English
      231 year ago

      IF THIS IS INTENTIONAL PUT AN UNDERSCORE BEFORE THE VARIABLE NAME YOU ABSOLUTE FUCKING MORON

    • @clearleaf@lemmy.world
      link
      fedilink
      101 year ago

      “Don’t worry too much about your loops bro, I am the apex of computer science research, I know every optimization in the book.” Ok want to compile this? “Is that… An unused variable?!? WHAT THE FUCK ARE WE GOING TO DO GOD IS DEAD”

      • @nautilus@lemmy.dbzer0.com
        link
        fedilink
        English
        21 year ago

        honestly my dumb ass will choose for i in list: over for i := range slice { every single time. I’m ugly and I’m proud!