• @Cerise_W@lemmy.world
    link
    fedilink
    01 year ago

    Can we talk about variable scope? Is x changing inside a called function without so much as a pointer being passed?

    • @Deuces@lemmy.world
      link
      fedilink
      11 year ago

      Avoiding global variables is just something dumb people do to protect themselves. Real programmers declare every variable before Main.

    • @frontporchtreat@lemmy.caB
      link
      fedilink
      0
      edit-2
      1 year ago

      One of the benefits of the haskell style is easy commenting of the additional functions. I do something similar in my python scripts when testing several differnent chunks of code.

      But then again I chose a career in GIS so I probably have a mental disorder.

      • @littletranspunk@lemmus.org
        link
        fedilink
        English
        11 year ago

        I might just do that style just to make my professor cringe on my next c# assignment

        “I mean, it’s right, it runs, but it looks like shit”