• UndercoverUlrikHD@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Is it really tempting for people? They’ve given me too many headaches when I’ve had to reformat or add functionality to files.

    Unless it’s a simple single use script that fit on the computer screen, I don’t feel like global variables would ever be tempting, unless it’s for constants.

    • yiliu@informis.land
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      They’ve given me too many headaches…

      I.e. you did use them, but learned the hard way why you shouldn’t.

      Very likely OP is a student, or entry-level programmer, and is avoiding them because they were told to, and just haven’t done enough refactoring & debugging or worked on large enough code bases to ‘get’ it yet.

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

      Most people suck at software engineering.

      Plus, there’s always the temptation to do it the shitty way and “fix it later” (which never happens).

      You pay your technical debt. One way or another.

      It’s way worse than any gangster.

      • Dave@lemmy.nz
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Hey, don’t you group me in with people who have had a small amount of real training!

    • BorgDrone@lemmy.one
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      1 year ago

      Is it really tempting for people? They’ve given me too many headaches when I’ve had to reformat or add functionality to files.

      I don’t get it either. Why would you ever feel the need for them to begin with?

      • CapeWearingAeroplane@sopuli.xyz
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        Unironically: For in-house scripts and toolboxes where I want to set stuff like input directory, output directory etc. for the whole toolbox, and then just run the scripts. There are other easy solutions of course, but this makes it really quick and easy to just run the scripts when I need to.