Jump to content

Debugging technique

- - - - -

  • Please log in to reply
5 replies to this topic

#1
eafkuor

eafkuor

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 218 posts
From "The Practice Of Programming", by Brian W. Kernighan & Rob Pike:

Quote

Explain your code to someone else. Another effective technique is to explain your
code to somcone else. This will often cause you to explain the bug to yourself.
Sometimes it takes no more than a few sentences, followed by an embarrassed
"Never mind, I see what's wrong. Sorry to bother you." This works remarkably
well; you can even use non-programmers as listeners. One university computer center
kept a teddy bear near the help desk. Students with mysterious bugs were required to
explain them to the bear before they could speak to a human counselor.


Best. Advice. Ever.

#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 765 posts
Lol, I learn that from my own experience. Frequently when I am explaining my work to someone else, I would see the cause of known bugs, potential bugs, better approach/solution for already implemented features/functionalities, or (this one I hate the most) new interesting feature/functionalities. :)

#3
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java

Quote

Sometimes it takes no more than a few sentences, followed by an embarrassed
"Never mind, I see what's wrong. Sorry to bother you."
Haha :c-lol: So familiar.

#4
zeroradius

zeroradius

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,406 posts
and oopsy bear has now been moved next to my computer :c-penguin:
Posted Image

#5
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
  • Location:New York, NY
This is absolutely true. Back when I was a n00b and asked questions on programming forums, while explaining the issue in a post, I often realized the solution before I pressed the submit button.

#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,120 posts
  • Location:Vancouver, Eh! Cleverness: 200

John said:

Back when I was a n00b and asked questions on programming forums, while explaining the issue in a post, I often realized the solution before I pressed the submit button.

It was always my ideology to write informative questions, ninety percent of the time formulating the steps and what is output I find the issue.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users