Will i really cry after learning how to use the debugger?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

slightlydead
Posts: 115
Joined: Wed Sep 23, 2009 10:52 pm UTC

Will i really cry after learning how to use the debugger?

Postby slightlydead » Tue Oct 06, 2009 5:22 am UTC

Currently doing java on eclipse and my teacher has told the class that on the day you learn the debugger, a tear will roll down your cheek and you will remember it forever. When you are old and have grandchildren you will tell them about this day, the day you learned how to use the Debugger. Is the debugger that great?

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Will i really cry after learning how to use the debugger?

Postby Sc4Freak » Tue Oct 06, 2009 6:09 am UTC

Yes.

Once you get to writing larger programs, a debugger is an essential part of a programmer's toolkit. A good debugger is vastly superior to placing print statements everywhere. Once you learn to use the debugger in a real environment, you will wonder how you ever got along without it.

User avatar
schmiggen
Posts: 383
Joined: Wed Nov 28, 2007 12:15 am UTC
Location: location, location

Re: Will i really cry after learning how to use the debugger?

Postby schmiggen » Tue Oct 06, 2009 6:20 am UTC

I'm actually just learning to use eclipse now, too, and today I got at least a bit of a feel for how the debugger works (although for a shamefully long period of time I thought it was telling me it couldn't find the path to the library where it needed to go to understand ArrayList's get(int) method when I was actually seeing the result of an index-out-of-bounds-exception being caught).

There might be a bit of a learning curve for use of the debugger. On the other hand, once I saw what it was trying to tell me, I found the problem immediately -- where it was and why it was happening -- and fixed it on the spot. Until recently I'd been using BlueJ to write things in Java, but I think now I'll never switch back. Once you get past the technical details of how eclipse wants you to set up your environment, the debugger is an invaluable tool.
Kabann wrote:Aw hell, as far as I'm concerned the world started in late 1967. Everything else is just semantics and busy-work.

User avatar
OOPMan
Posts: 314
Joined: Mon Oct 15, 2007 10:20 am UTC
Location: Cape Town, South Africa

Re: Will i really cry after learning how to use the debugger?

Postby OOPMan » Tue Oct 06, 2009 12:02 pm UTC

Debugging is that good. The difference between using a debugger and not using on is the difference between locating a bug in 5 minutes and locating a bug in 5 hours.
Image

Image

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Will i really cry after learning how to use the debugger?

Postby Berengal » Tue Oct 06, 2009 4:29 pm UTC

OOPMan wrote:Debugging is that good. The difference between using a debugger and not using on is the difference between locating a bug in 5 minutes and locating a bug in 5 hours.

Well, sometimes the difference is between spending 2 minutes looking at the buggy method with a few sample values printed out in a log, and spending 5 minutes restarting your appserver in debug mode, 5 minutes redeploying your app on an appserver in debug mode, 15 minutes stepping through your program running on the appserver in debug mode on a machine that's slow as molasses because it's running an appserver (in debug mode (and an oracle instance and whatnot)), then 5 minutes restarting your appserver in normal mode so your machine can return to a useable state.

The difference is very subtle, and the choice is almost impossible to make. Yes, I need both more RAM, and a proper development server... And preferably a language with an interpreter so I didn't have to guess what things do so much, but fat chance that's going to happen anytime soon.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

stephentyrone
Posts: 778
Joined: Mon Aug 11, 2008 10:58 pm UTC
Location: Palo Alto, CA

Re: Will i really cry after learning how to use the debugger?

Postby stephentyrone » Tue Oct 06, 2009 4:50 pm UTC

OOPMan wrote:Debugging is that good. The difference between using a debugger and not using on is the difference between locating a bug in 5 minutes and locating a bug in 5 hours.


Or between locating a bug in 5 days and never locating the bug, ever.
GENERATION -16 + 31i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.

User avatar
mrbaggins
Posts: 1611
Joined: Tue Jan 15, 2008 3:23 am UTC
Location: Wagga, Australia

Re: Will i really cry after learning how to use the debugger?

Postby mrbaggins » Fri Oct 09, 2009 1:50 am UTC

Seconding (or Seventhing) the gigantic YES at the top of this page.

How does one go about debugging C++ code though? (I'm just starting C++, after becoming proficient in Java. I intend to use the Eclipse CDT if that helps)
Why is it that 4chan is either infinitely awesome, infinitely bad, or "lolwut", but never any intermediary level?

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Will i really cry after learning how to use the debugger?

Postby Sc4Freak » Fri Oct 09, 2009 2:45 am UTC

Visual Studio has the best integrated C++ debugger by far. It's also generally regarded as the best Windows IDE. If you're on Windows you really should be using Visual Studio for any real work, although Eclipse seems all right.

On Linux, you can use GDB on the command line which, if you're used to Eclipse, is an experience similar to stabbing yourself in the eye repeatedly with a rusty fork when compared to VS's integrated debugger. IDEs like Code::Blocks provide a GUI frontend for GDB which makes it actually usable.

poohat
Posts: 230
Joined: Mon Apr 07, 2008 6:21 am UTC

Re: Will i really cry after learning how to use the debugger?

Postby poohat » Fri Oct 09, 2009 3:25 am UTC

I program almost exclusively in R (statistical programming language) these days and the lack of a good debugger is a constant source of frustration. If your language has good debugging tools then be very very greatful

Karrion
Posts: 92
Joined: Fri Jun 22, 2007 12:14 am UTC
Location: Melbourne, AU

Re: Will i really cry after learning how to use the debugger?

Postby Karrion » Fri Oct 09, 2009 4:39 am UTC

Eclipse CDT (at least on unix, not entirely sure about on windows) has an integrated frontend for gdb. It's not quite as smooth as the JDT debugger but it behaves in essentially the same way.

Unparallelogram
Posts: 336
Joined: Mon Jul 28, 2008 4:16 am UTC

Re: Will i really cry after learning how to use the debugger?

Postby Unparallelogram » Fri Oct 09, 2009 5:27 am UTC

The debugger will make you cry LESS.

slightlydead
Posts: 115
Joined: Wed Sep 23, 2009 10:52 pm UTC

Re: Will i really cry after learning how to use the debugger?

Postby slightlydead » Fri Oct 09, 2009 4:43 pm UTC

Unparallelogram wrote:The debugger will make you cry LESS.

Q _Q

Outchanter
Posts: 669
Joined: Mon Dec 17, 2007 8:40 am UTC

Re: Will i really cry after learning how to use the debugger?

Postby Outchanter » Sat Oct 10, 2009 2:29 am UTC

poohat wrote:I program almost exclusively in R (statistical programming language) these days and the lack of a good debugger is a constant source of frustration. If your language has good debugging tools then be very very greatful

Hehe, I use it too. I also wish R had a proper dictionary datatype.

User avatar
OOPMan
Posts: 314
Joined: Mon Oct 15, 2007 10:20 am UTC
Location: Cape Town, South Africa

Re: Will i really cry after learning how to use the debugger?

Postby OOPMan » Mon Oct 12, 2009 7:46 am UTC

Berengal wrote:
OOPMan wrote:Debugging is that good. The difference between using a debugger and not using on is the difference between locating a bug in 5 minutes and locating a bug in 5 hours.

Well, sometimes the difference is between spending 2 minutes looking at the buggy method with a few sample values printed out in a log, and spending 5 minutes restarting your appserver in debug mode, 5 minutes redeploying your app on an appserver in debug mode, 15 minutes stepping through your program running on the appserver in debug mode on a machine that's slow as molasses because it's running an appserver (in debug mode (and an oracle instance and whatnot)), then 5 minutes restarting your appserver in normal mode so your machine can return to a useable state.

The difference is very subtle, and the choice is almost impossible to make. Yes, I need both more RAM, and a proper development server... And preferably a language with an interpreter so I didn't have to guess what things do so much, but fat chance that's going to happen anytime soon.


A very pertinent point. I personally am a little bit too quick on firing up the debugger when it comes to dealing with stuff which seems to be misbehaving. This sometimes leads to "Doh!" moments when the problem is, in fact, a simple logic error that I would have located if I had just read the code properly.

You're debugging pain sounds a lot like it stems from Java application servers, though. Am I right? I first got hooked on debugging when I was doing Java web development. I do remember the irritation of having to shut down the web app server in order to restart it in debug mode. I think I eventually found it easier to just always run in the debug mode and attach/detach the debugger as necessary (Which NetBeans makes very easy ;-) )

Anyway, debugging PHP is a lot less painful thanks to debuggers like XDebug being enableable simply by setting a request variable (Assuming the debugger is set up correctly).
Image

Image

Parsifal
Posts: 113
Joined: Thu Feb 28, 2008 1:35 am UTC

Re: Will i really cry after learning how to use the debugger?

Postby Parsifal » Mon Oct 12, 2009 1:16 pm UTC

Yes, you probably will, especially if you've wasted days of your life debugging with console statements.

My boss just saw me using the debugger yesterday (he's not a coder) and said 'Oh... that's how you do it!'

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Will i really cry after learning how to use the debugger?

Postby Earlz » Mon Oct 12, 2009 5:23 pm UTC

Parsifal wrote:Yes, you probably will, especially if you've wasted days of your life debugging with console statements.

My boss just saw me using the debugger yesterday (he's not a coder) and said 'Oh... that's how you do it!'


my first real project in C was an OS kernel... here debuggers are difficult, if not impossible to use well(I had self generating code in a lot of places too)... so sometimes you still need to know the proper way of debugging without a debugger..

when I first figured out how to use a debugger with a userland project though.. Oh me yarm.. I did cry lol
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Will i really cry after learning how to use the debugger?

Postby Berengal » Mon Oct 12, 2009 6:54 pm UTC

OOPMan wrote:I think I eventually found it easier to just always run in the debug mode and attach/detach the debugger as necessary

I used to do that, but when I did I was only running the appserver with one app deployed and NetBeans.

These days I've got OracleXE, Eclipse, SQLDeveloper (usually with about 10 open connections), three instances of Excel, two instances of Word and one instance of Outlook in addition to Glassfish and NetBeans, Glassfish usually serving about 4-5 different apps. I've got 2GB RAM and a 4GB page file. Betting on how fast a scanline rerenders when switching apps has become a favorite pasttime of mine. Note I didn't say firefox, which I've only got open if I need it.

I try to close things I don't need, but most of the time the machine doesn't speed up enough that I save time overall, because I'm almost guaranteed to need it again pretty soon anyway, and waiting for eclipse to start could take a good 15 minutes on a bad day (while waiting for it to become responsive takes only about 3).
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 9 guests