• Brahvim@lemmy.kde.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      8 hours ago

      Doing algorithms in year 2 of college and I use goto fearlessly. We have TOO MANY cults and stigmas in programming these days…!

      Aaaaand I love writing C. …Though it can be pretty painful.

      • Buddahriffic@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 hours ago

        Goto was risky and it was one big name on some BBS back in the day that pushed for a “never use goto” dogma, rather than figuring out rules for when it should or shouldn’t be used. And a whole bunch of people just jumped on that bandwagon, but not everyone.

        The main rule for using goto that I’m aware of is to never use it to jump into the middle of a scope. Jumping around in the same scope is fine, jumping out of a scope is fine (assuming you handle unwinding the stack correctly, which I think the C compiler tries to do, at least, but there are other constructs that can save/restore stack contexts to do the same thing as a goto but safer).

        Though programming language contstructs can also help eliminate the cases where using goto gives better code. Breaking out of nested loops is the main good case for goto that I’m aware of. Without a goto, you need to set up an exit flag and check it before starting a new iteration for each loop level you want to escape from. Unless your language supports labelled breaks/continues, in which case the compiler knows which loop the break/continue refers to instead of needing to always assume it means the deepest level.

        C/C++ is my favourite language, but I’ve used an enhanced C++ with labeled loops and it was nice.

  • addie@feddit.uk
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 day ago

    Speaking as someone who does their development in Vim (with YouCompleteMe / NerdTree / CTags installed), that’s pretty much exactly what it looks like when I’m coding to this day. OP recognises elegance when they see it.

    A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.

    – Antoine de Saint-Exupery

    • Cevilia (she/they/…)@lemmy.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 day ago

      I barely even qualify as a dabbling coder, I write terrible Python code and even worse bash scripts, which I think barely counts as dabbling? But anyway, I do it in Kate because it highlights my syntax but otherwise just lets me work.

  • Thorry@feddit.org
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    1 day ago

    Having your home built mini computer sputter and blink for 20 mins, only for the correct amount of memory free to come up as BASIC is loaded. Chefs kiss

  • macniel@feddit.org
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 days ago

    Eeeh I liked TurboVision (e.g. the DOS IDEs by Borland) more than the UI Qbasic had.

    • zod000@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 hours ago

      The Turbo programs (C, Pascal, Assembler, etc) were all great. QBasic was nothing compared to them, but it was included for free with Dos, so I can give it credit there at least.