lainchan / λ

Rubber Duck Debugging

Unidentified · 2017-07-26 21:40
Explain your problems or anything programming related here. Write self contained posts. Avoid references.
Trinity · 2017-07-28 01:34
>new to C++ >try Qt >can't get push button to work while in a window Help please
Vasya Pupkin · 2017-07-28 01:39
>>2629 #include <QApplication> #include <QLabel> #include <QPushButton> #include <QVBoxLayout> int main(int argc, char *argv[]) { QApplication a(argc, argv); //WINDOW QWidget window; QVBoxLayout* mainLayout = new QVBoxLayout(&window); window.show(); //TITLE QLabel* title = new QLabel("JACK'S ADVENTURE 3"); mainLayout->addWidget(title); //START BUTTON QPushButton* startButton = new QPushButton("START"); mainLayout->addWidget(startButton); return a.exec(); } >My code
↑ · 2017-07-28 01:42
>>2632 >Jack's adventure >forgetting code now I just look autistic //BUTTON FUNCTIONALITY QObject::connect(&startButton, SIGNAL(clicked()), &a, SLOT(quit()));
Chani · 2017-07-28 12:40
>>2633 >>2632 >>2629 You don't understand what rubber duck debugging is - please do some searches
Unknown · 2017-07-28 18:44
>>2653 Explaining what rubber duck debugging is would have been valuable information for the opening post to contain; it also would've prevented it from being so very small. This is made more ironic by the opening post encouraging writing self-contained posts without references. Regardless, I'll do so now, using a reference: The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck. Many programmers have had the experience of explaining a programming problem to someone else, possibly even to someone who knows nothing about programming, and then hitting upon the solution in the process of explaining the problem. In describing what the code is supposed to do and observing what it actually does, any incongruity between these two becomes apparent. I'm not certain if I've ever debugged in this manner, before. My most typical method of debugging is writing the program, testing it, and then incrementally correcting it in this manner until errors are eliminated. I then generally actually look over the code more to make certain it's correct. This saves me time from one-off errors and whatnot.
Elliot Alderson · 2017-07-28 20:24
>>2660 I would think everybody knew what rubber duck debugging was. Several times I've started writing a post asking for help on a weird problem, and in the process I'd find the problem and abort posting about it. It's useful.
Lord Nikon · 2017-07-28 21:04
I've been searching for 20 minutes for a story about the same technique, but without the rubber duck, something else was used instead. It was told from an older developer's perspective, who remembered that when he was just starting out his co-worker was getting annoyed by him coming up to him and finding the solution to his problem while he was talking, so he decided to make him explain his problem to some object in a corner of the office, and only if he didn't understand yet, come bother him. It was told in a nice style, and I liked it more than other stories about rubber ducking. Anybody know what I'm talking about?
McCarthy · 2017-07-28 22:00
>>2660 OP here I thought /lam/ was aware of that. But thanks anyway. Now the goal is to stop discussing that point and see if some vagabond find this thread useful.
Yamaoto Toshi · 2017-07-29 01:38
>>2675 I think that most people would find it faster to just get a rubber duck and talk to it than to organize their thoughts for a proper post.
Tank · 2017-10-07 01:06
Anyone know how to implement USB rubber ducky attack on Android without installing Kali Nethunter?
Cereal Killer · 2017-11-10 14:15
>>4131 Not related.