GDBased

Using the debugger doesn't make you a bad programmer. In fact you shouldn't use GDB as a last resort. You should be running your code in GDB from the very beginning, along with the -x option to load a script with predefined tests and breakpoints. Even if you're code is running fine, this will help you understand what it's doing, making you a better programmer.

Beware Cat Shirt $21.68

Rise, Grind, Banana Find Shirt $21.68

Beware Cat Shirt $21.68

  1. 3 weeks ago
    Anonymous

    90% of the time I don't need a debugger to understand what's going on, usually a simple print statement is enough, but it will depend on how big the project is. If you see yourself constantly using the debugger to figure out what the hell is happening it, you're probably writing spaghetti code with too much coupling and bad architecture.

    • 3 weeks ago
      Anonymous

      lmao what a moron

      • 3 weeks ago
        Anonymous

        no u

    • 3 weeks ago
      Anonymous

      Cope, you just don't write things complicated/important enough.
      >print statements
      Lmao you just finished watching a C tutorial a few weeks ago. Nobody serious ever uses print statements. It's either logs, tests, or break points/watch points. Imagine polluting the code with debug statements.

      • 3 weeks ago
        Anonymous

        >you just don't write things complicated/important enough
        I don't care, as long as it makes money

        >Nobody serious ever uses print statements
        Uncle bob uses it, lmao

        >Imagine polluting the code with debug statements
        You can remove them with one cli command

        • 3 weeks ago
          Anonymous

          >I don't care, as long as it makes money
          Bad programmers shouldn't have opinions.
          >Uncle Bob
          >serious
          lmao. This guy full wagie.
          >You can remove them with one cli command
          No you can't rajeesh. Actual code is never resolved by print(f'poo_count={poo}'). If you really want to use print statements sometimes you need to write loops and conditions on different objects or data structures to print their fields. You just write basic stuff.
          5 years and you'll be replaced by AI or some 15 year old intern.

    • 2 weeks ago
      Anonymous

      How do you debug core dumps if not with a debugger?

      • 2 weeks ago
        Anonymous

        My software doesn't crash.

        • 2 weeks ago
          Anonymous

          Can't crash if it doesn't compile.

          • 2 weeks ago
            Anonymous

            challenge accepted

            int main()
            {
            char *c = 0;
            *c = 0;
            }

    • 2 weeks ago
      Anonymous

      completely based and correct. TDDchads don't have this problem btw

      • 2 weeks ago
        Anonymous

        not op
        but yeah
        >tddchads dont have this problem
        IF they have a decent team
        IF said team uses TDD too
        IF they dont work on years old code whose author is no longer with the company
        IF they dont work with 3rd party code (which is pretty much always unless youre writing your own bios, drivers etc)

        i didnt work one day in corporate and even i know your statement is false whenever your company exceeds 10 employees

        • 2 weeks ago
          Anonymous

          yeah, sadly it only applies to personal projects since 99% of programmers write shitty spaghetti code and will instantly frick up any codebase they touch

  2. 3 weeks ago
    Anonymous

    Damn, I ain't on carmack level shit. In fact, the most serious program I've written is just a simple http server. But yeah I like using a debugger and I don't see the point of hating it. It's not like running a debugger is as heavy as running a complex program. Why add too many printf statements when the debugger usually tells you what's going on, the value of variable, which part is causing a segfault, etc?

  3. 3 weeks ago
    Anonymous

    And that's why I pay Jetbrains.

  4. 2 weeks ago
    Anonymous

    Good tip. Here's my vim kludge: :!f=%; echo r| gdb ${f/.c}
    Must confess I still get along fine with printf, but tell me how to do basic stuff please

  5. 2 weeks ago
    Anonymous

    Ok so this is where I'm at.
    :w |!!f=%; x=${f/.c}; gcc % -o $x && gdb $x <<< "r"

    Any input?

  6. 2 weeks ago
    Anonymous

    :w |!f=%; x=${f/.c}; r=~/.gdbrc; printf "break mainn run varn framen stepn fr
    ame" >$r; gdb -x $r $x

    alright, baby steps

  7. 2 weeks ago
    Anonymous

    I tried but GDB is so fricking annoying, like when you put "quit" and then it ask you if you wanna quit, it's a non sense.

  8. 2 weeks ago
    Anonymous

    Gdb is such a an unironic piece of shit that it shouldn't be considered a real debugger. Use the visual studio debugger or even Windbg and you'll see how much a pain in the ass it is to use that gnu jeet ware.
    People who think gdb is fine either haven't known any better or they are tinker trannies that wrote some command line bullshit tool for themselves once and think they know real programming.

  9. 2 weeks ago
    Anonymous

    I found out about GEF for gdb and my life has changed. It's just a really nice tool with how it lays out everything on the stack and in the registers.

  10. 2 weeks ago
    Anonymous

    >no watch window
    Yeah gdb is garbage for setious debugging

Your email address will not be published. Required fields are marked *