Orbi Camp
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@piefed.world to Programming@programming.devEnglish · 5 days ago

Debugging Vs Printing

hackaday.com

external-link
message-square
10
fedilink
29
external-link

Debugging Vs Printing

hackaday.com

cm0002@piefed.world to Programming@programming.devEnglish · 5 days ago
message-square
10
fedilink
We’ll admit it. We have access to great debugging tools and, yes, sometimes they are invaluable. But most of the time, we’ll just throw a few print statements in whatever program weR…
alert-triangle
You must log in or register to comment.
  • atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    30
    ·
    edit-2
    5 days ago

    The entire article: You can do things with a debugger that you can’t do with print statements.

    • Lembot_0004@discuss.online
      link
      fedilink
      arrow-up
      17
      ·
      5 days ago

      And print statements can do things that are impossible for the debugger (quick example before you start rage: last program I wrote needed some information about short-lived processes that I know only pid about. If I would use a debugger, the OS would already delete all the data I need to analyze)

      • Valmond@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        4 days ago

        Yeah, multi threadin/multi processing is a bitch to debug sometimes and prints/logs can really help.

      • wildbus8979@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        4 days ago

        Wrap the launching of that process with the debugger, problem solved.

        • Lembot_0004@discuss.online
          link
          fedilink
          arrow-up
          7
          ·
          4 days ago

          Wrapping the kernel with GDB is the last thing I want to do with my life :)

          • wildbus8979@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            4 days ago

            If it has an unstable pid, then you aren’t debugging the kernel.

  • esa@discuss.tchncs.de
    link
    fedilink
    arrow-up
    10
    ·
    5 days ago

    Why is this linking to what appears to be another link aggregator, rather than what appears to be the original blog post?

  • Frezik@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    7
    ·
    4 days ago

    Now try debugging on a microcontroller with none of that UART stuff Arduino gives you. Print statements? Ha, try debugging by blinking an LED.

    • TheAgeOfSuperboredom@lemmy.ca
      link
      fedilink
      arrow-up
      5
      ·
      4 days ago

      LED? Luxury! 😁

      I had one board with an improperly loaded power supply and I could tell what it was doing by the pattern and pitch of the squeal.

      It did have a debug UART though, but I did come to find the sound pretty useful too!

      • Frezik@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        3
        ·
        4 days ago

        Heh, kinda like knowing if your 56Kinda modem got a good connection or not.

Programming@programming.dev

programming@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 71 users / day
  • 582 users / week
  • 2.6K users / month
  • 7.94K users / 6 months
  • 1 local subscriber
  • 22.7K subscribers
  • 820 Posts
  • 9.21K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • MaungaHikoi@lemmy.nz
  • UlrikHD@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org