• I feel like you’re missing out on a ton of awesome features by not using a debugger? Step backs are super useful, inline/live commands save you from re-running the code to see a different value, you can change values on the fly.

      And it’s nice to say “think about your code more” but when you’re working with large teams, on legacy codebases, you don’t often have the opportunity to “think about your code” because you’re trying to decipher what someone wrote 3 years ago and they don’t even work with the company anymore.

        • I have indeed. We even practice pure TDD and won’t accept PRs without test coverage, but it doesn’t change the fact that sometimes bugs happen, and when they do it tends to be much more effective to work through the problem with a debugger than make guesses at what things need to be logged, or poked into or whatever.

          If what you’re doing works for you, more power to you, but in my opinion I’d never give up a tool in my toolset because it makes me far more productive than I’d be without it.

    • Since adopting TDD, my debugger use has really dropped off. I think it’s partially due to TDD encouraging me to develop more pure functions and push side effects to injectable (and thus mockable) objects.

      But every so often I encounter a state that I can’t understand how the code gets into, and in those cases being able to step through everything that’s going on is incredibly helpful.

      I may not use my debugger every day, but when I want it, I’m sure glad it’s there.

    • GJdan ( GJdan@programming.dev ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      It’s a little hard to iterate and think when you’re adding to a complicated codebase you might not have worked with in several months, or even just a portion of a project that’s seemed stable for a long time. In that scenario, debuggers are able to shorten the getting up to speed process by quite a bit.

  • NiftyBeaks ( NiftyBeaks@lemm.ee ) 
    link
    fedilink
    arrow-up
    2
    ·
    3 years ago

    I am unsure just how revolutionary this feature is, though I am definitely interested in trying it and can see it’s value. I’ve somewhat gotten away from Jetbrains, but I do still use and promote Rider for C# development so this is potentially a nice addition for my professional life.

    • am unsure just how revolutionary this feature is

      It’s not. This feature existed for dotnet in bugaid (which then got renamed to Ozcode) (which then got killed by Datadog) for the last 10 years already

    • snowe ( snowe@programming.dev ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      The code is already compiled. what do you mean it’s preemptively compiled? If you’re talking about executed, they explicitly called that out…

      A prediction can also end at a function call the debugger is cautious about evaluating. That is for your own (or your software’s) well-being. Since code is executed during debugging, the debugger has to be sure that it’s not causing any mutations. When running the above example, we must confirm the evaluation of the int.TryParse method (more about that later):

      As mentioned in the previous section, the predictive debugger won’t evaluate possibly impure functions to avoid side effects. As a human developer, you most certainly have more knowledge about the code, which is why we give you the possibility to forcefully evaluate a call by clicking the hint:

    • preemptively running source as it was written

      It’s not preemptively running source as it’s being written, it’s preemptively evaluating methods as you’re debugging it

      This looks like it’s preemptive compiling, which isn’t just unwise, it’s potentially dangerous.

      So I think what you might mean is preemptively evaluating methods at runtime? - which would be unwise / potentially dangerous - since it could cause side effect

      For example, evaluating a method that increments something and modifies the state. So if it’s preemptively called by the debugger, the state would be modified, and the actual invocation would be different

      I installed the Resharper RC, and this is how it looks like in a small project that parses an excel file: https://i.imgur.com/g4s0P3h.png

      So, in the example my debugger is still on the allTheFieldsEmpty line and hasn’t ran it yet, but resharper already evaluated it to false. Then it also greyed out everything in the if(allTheFieldsEmpty) block, since it knows it wouldn’t hit that

      The next line you can see there was a warning, “Possible impure evaluation” - which is that I assume you were talking about, and it didn’t evaluate that yet. I can click the box and make it evaluation it.

      The debugger inspects the method, as the article mentions, it check for the PureAttribute - indicating that it’s safe to use

      After I marked that GetMappingField method as Pure, it actually did evaluate it without any interaction, and it predicted it would throw an exception https://i.imgur.com/zQ0K3Ge.png - seems pretty useful so far

      • agilob ( agilob@programming.dev ) OP
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        A debugged code could be doing once per run operation, use unique data or send network request that’s isn’t supposed to be done until a user explicitly does it.

        • snowe ( snowe@programming.dev ) 
          link
          fedilink
          arrow-up
          2
          ·
          3 years ago

          they explicitly call out that they won’t perform the predictive calls unless they’re sure it doesn’t modify state.

          A prediction can also end at a function call the debugger is cautious about evaluating. That is for your own (or your software’s) well-being. Since code is executed during debugging, the debugger has to be sure that it’s not causing any mutations. When running the above example, we must confirm the evaluation of the int.TryParse method (more about that later):

          As mentioned in the previous section, the predictive debugger won’t evaluate possibly impure functions to avoid side effects. As a human developer, you most certainly have more knowledge about the code, which is why we give you the possibility to forcefully evaluate a call by clicking the hint:

          • agilob ( agilob@programming.dev ) OP
            link
            fedilink
            arrow-up
            2
            ·
            3 years ago

            They do say that, but how much can it be trusted? Can they really detect all native interface calls? Be aware of all future file system checks or event driven programming paradigms? hashset.getOrElse() where uniqueness decides future flow? I’m sure we will be experiencing or at least seeing bug reports related to predictive debugger triggering mutations.

            • I’m struggling to see how bug reports found using this prediction approach would ever be sent as anything but bugs of the predictive debugger itself.

              how would end-users ever see bugs caused by a debugger the devs use? how would users of a third-party library conflate bugs in their own code/the third-party code when you can see which lines are which as you debug?