• Omgpwnies@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    8 days ago

    Break it up into functions with names that describe what it does, then the script becomes basically a sequence of function calls and is easier to read and troubleshoot.

    • Radioactive Butthole@reddthat.com
      link
      fedilink
      English
      arrow-up
      5
      ·
      8 days ago

      This is how I started writing my scripts and it is sublime. Even better is when your function can be a single return statement, makes writing tests easy.

    • jkercher@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 days ago

      I’m on your side dude. Comments rot. Some are useless. Don’t even get me started on doxygen comments.