Is using a debugger lazy?
#21 Moderator* - Reputation: 5387
Posted 18 September 2012 - 01:33 PM
Real programmers walk.
#22 Senior Moderators - Reputation: 4739
Posted 18 September 2012 - 01:34 PM
You know, I'm beginning to think we miss a category for 'dynamic, but stupidly unsafe' languages.I think we can agree that javascript counts as a high level language. If so, I am using a debugger on an almost daily basis to find out why the code I have wri.... the code my colleagues have written doesn't work anymore.
I find Javascript to be every bit as much of hell to develop in as a low-level language. Lack of type checking is a huge downside, as is lack of useful immutability, and the lack of anything resembling a standard library is equally painful.
And this mentality can lead to serious strife in the workplace. If someone writes a single line of production code without a design in place, then Houston, we have a problem.Why plan ahead when you can use start something and debug until I get it right?
Tristam MacDonald - SDE @ Amazon - swiftcoding [Need to sync your files via the cloud? | Need affordable web hosting?]
#23 Members - Reputation: 623
Posted 18 September 2012 - 02:23 PM
That's true to a point as well. I was also thinking that this professor is too mired in academia and not real world practices, but I do not know his professional (non-educational) experience. Personally, I'm more afraid of his preference for Dev-C++ over any other IDE. So what might he think of using printf/cout to dump data onto the screen? For web development I never used debuggers. But I sometimes have to dump data when I am not certain what my output will be.Here's another quote -
"Those who do, do. Those who can't, teach".
Debuggers are not the panacea for programming, but it's also outrageous to say it should not be used at any cost.
#24 Members - Reputation: 451
Posted 18 September 2012 - 02:34 PM
Anyone actually believes that using a debugger is lazy can't have worked on anything more than small hobby projects.
I'm currently working in a code base with literally millions of lines of code, and hundreds of coders making changes every day... efficient debugging is an essential part of programming.
Edited by Capoeirista, 18 September 2012 - 02:49 PM.
http://www.massive.se
#26 Senior Moderators - Reputation: 4739
Posted 18 September 2012 - 03:18 PM
Mine did. Then again, he was an ex-soviet rocket scientist.Did your math professor tell you that using a calculator is lazy?
Tristam MacDonald - SDE @ Amazon - swiftcoding [Need to sync your files via the cloud? | Need affordable web hosting?]
#27 Members - Reputation: 2770
Posted 18 September 2012 - 03:23 PM
Using a debugger to analyze a problem or to learn how existing code works is appropriate use of the tool. Using it in place of understanding a problem or instead of thinking through and designing a solution is not.
Professional Free Software Developer
#29 Members - Reputation: 525
Posted 18 September 2012 - 04:07 PM
Your professor is correct. Using a debugger to make poorly designed and written software just barely maybe work is lazy and an ineffective use of resources.
Using a debugger to analyze a problem or to learn how existing code works is appropriate use of the tool. Using it in place of understanding a problem or instead of thinking through and designing a solution is not.
This is absolutely true. I remember when I was a young lad learning to program. I used the debugger a lot. Then one day I wanted to try and see how it is to do without all the fancy stuff, so I started a project using Emacs and GCC. Because GDB is pretty cumbersome to use in comparison to "some other" debuggers, I only used it when absolutely necessary.
Needless to say, I learned a lot from that project. Another way of thinking, you could say. A way of thinking that has helped me when coming back to the "fancy" tools. It's hard to explain exactly what I mean, but it has caused more defensive programming, and when something is wrong, a quick browse around the code is usually all it takes to figure it out.
For all people learning, I recommend doing some kind of learning project without too many "crutches" to try it out.
#30 Members - Reputation: 1006
Posted 18 September 2012 - 06:50 PM
#31 Members - Reputation: 382
Posted 18 September 2012 - 08:20 PM
I use the debugger to verify if my algorithms are flowing the way I expected -- like desk checks.
To simply trust your code because a few test cases output the right answer is the most lazy thing one can do.
So debuggers are meant to be used to support your coding, just like armors are important to warriors. No matter how good you are with the sword/code, one day your foe/bug will hit you and every second in the world will be most valuable.
;)
Edited by kuramayoko10, 18 September 2012 - 08:25 PM.
#32 Members - Reputation: 1057
Posted 18 September 2012 - 09:19 PM
#33 Members - Reputation: 309
Posted 19 September 2012 - 07:59 AM
I mean if you write something and then by default you debug because there's surely something wrong you missed in our own code then better if you don't have a debugger and just learn how a while or for loop works.
But in the end debugging functionality from a broader point of view is also a printf. Debugging is also mentally parse your code trying to figure out what's wrong with your algorithm.
But development of every non-trivial software in 2012 needs good debugging tools.
Those who fail to realize it either live 40 years in the past or have never written (and shipped) any non trivial product.
#34 Moderator* - Reputation: 5387
Posted 19 September 2012 - 08:46 AM
Last time I checked, printf doesn't let me change the line of execution, or modify the value of variables, or dump/print register values, or step through a program I don't have access to the code to, or slowly step through an algorithm iteration by iteration so I don't get a massive amount of printf dumps of information and instead focus on only the iterations I care about, etc. If all you ever use your debugger for is to look at the value of a variable, it's kinda like only using the stereo in a car and never actually driving it somewhere.But in the end debugging functionality from a broader point of view is also a printf.
But yeah, I'll agree with people that a debugger is no excuse to be lazy and slide into the don't-plan-just-code-and-debug-later mode of action.
#35 Members - Reputation: 1054
Posted 19 September 2012 - 10:14 AM
Your professor has been sitting in the ivory tower so long that he's lost sight of what matters and replaced it with stuff that doesn't matter.
Hobby: Game Developer
Currently employed as: Sr. Sharepoint Developer in Afghanistan
#36 Senior Moderators - Reputation: 4739
Posted 19 September 2012 - 10:42 AM
Correct and bug-free software is not created by endlessly running through the debugger. It is created by painstakingly designing and re-designing every aspect of the software, and exhaustively testing each component in isolation and as part of the whole.They only care about whether or not the application works, does what its supposed to do, and does it correctly and as expected. A debugger may actually help a lot with that.
Debuggers are a useful tool to track down the point of failure. But if you are using a debugger to replace any of the following, then you are doing it wrong:
- Up-front design
- Design reviews
- Code reviews
- Unit testing
- Functional testing
- Stress testing
- User testing
Tristam MacDonald - SDE @ Amazon - swiftcoding [Need to sync your files via the cloud? | Need affordable web hosting?]
#37 Crossbones+ - Reputation: 1333
Posted 19 September 2012 - 11:01 AM
#38 Members - Reputation: 466
Posted 19 September 2012 - 11:19 AM
Today I was talking with a few professors at my university about doing some work on a couple new servers they've got set up. They asked me about my background in coding, and I mentioned that I'd written a couple games over the summer with C++/Allegro, and that I used Visual Studio 2010 as my IDE. One of the professors told me that he preferred Dev-C++, which I found quite odd considering Dev-C++ at least seems very bare-bones (I wouldn't know, I've only written a couple very simple projects in it).
Anyway, I told him I thought he'd find VS2010 to be nice because the debugger is great for catching unhandled exceptions/null pointers, and he told me that debuggers are for lazy people. Now something tells me he's out of his mind, but I'm no expert, so I can't be sure. Do you think using a debugger is lazy? I don't mean overusing it, or relying on it too much. Just the simple act of using it at all. I think a debugger is a great tool and it's a good idea to use one. What do you think?
Tell him to use VI then...
Edited by UltimaX, 19 September 2012 - 11:23 AM.
#39 Members - Reputation: 302
Posted 19 September 2012 - 11:36 AM
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
#40 Members - Reputation: 2042
Posted 19 September 2012 - 12:43 PM
If I have a bug that's non-obvious enough to require the use of a debugger, I always try to think about what I could have done to avoid having to use it at all. Is there an assertion missing? Is there a test missing? Could I have used a different coding technique, perhaps one that's safe by construction, rather than relying on convention? Does this interface, as written, promote misuse? Is the code I've written less obvious than it might be?
In doing this, I now only need a debugger very rarely.
In my humble opinion and experience, it's quite often the case (though not always the case) that code written with debugger-driven-development is harder to follow because it hasn't been thought through as thoroughly.
Debuggers have their use as exploratory tools too, of course.
Disclosure: I currently work on the debuggers for one of the top games console manufacturers.
Edited by edd, 19 September 2012 - 12:44 PM.






