8 ms·
Debugger! Surprised no one has mentioned it yet. I work in js and php, both of which I use the debugger a lot. Set a breakpoint, burn through the code. Chrome
by monk_e_boy 11y ago
Debugger! Surprised no one has mentioned it yet. I work in js and php, both of which I use the debugger a lot.
Set a breakpoint, burn through the code. Chrome has some really nice features - you can tell it to skip over files (like jQuery) you can open the console and poke around, set variables to see what happens.
Stepping though the code line by line for a few hours will soon show you the basics.
- shogun21 11y agoWhat debugger do you use for PHP? I've yet to find one I really like.
- cstuder 11y agoxdebug and Eclipse is good enough. Configuration got a lot easier since the installation wizard has been introduced: http://xdebug.org/wizard.php http://xdebug.org/wizard.php
- jh3 11y agoxdebug and phpstorm is great.
- spdionis 11y agoXdebug is de facto the only debugger AFAIK. The integration in Phpstorm is great.
- kieranajp 11y agohttp://codebugapp.com http://codebugapp.com is a fantastic front-end for Xdebug. I get a lot of mileage out of this, not least because I only had to set it up once and now it works with whichever editor I'm trying out this week.
- __oz 11y agoXdebug and Netbeans, tons of tutorials on how to set it up on google/youtube.
- monk_e_boy 11y agoNuSphere is better than xdebug. It allows more actions and is generally better. But I use xdebug and phpstorm. I find it better than netbeans. Search in netbeans is good, but the whole thing has a weird GUI and is slow. Best bet is to try a bunch.
- noir_lord 11y agoXdebug and with phpstorm 9 you have inline display of the values held in that variable which you can expand with a click. That is incredibly powerful (PyCharm has it as well).
- girvo 11y agoCodebug. Phenomenal Xdebug client.
- collyw 11y agoI am surprised how few younger programmers use a debugger these days.
- neverminder 11y agoI'm not a younger programmer and I don't use a debugger. Tried it several times and found it counterproductive.
- candu 11y agoLike with most useful tools, you have to use it more than "several times" to gain fluency.
- webhat 11y agoIndeed, and learning to use a debugger will allow you to gain fluency in new languages and frameworks much faster that the simple, albeit powerful, printf. I remember needing to learn Ruby and Rails on an existing closed codebase and having the debugger take me right to the core of Rails several times to understand why certain things were done in a certain way in the top level code. This allowed me to get acquainted with internals of Rails and how Ruby's inheritance system much faster as well as the existing codebase that was built on top.
- kelvin0 11y agoHow is it counterproductive exactly? The setup of the debugger itself? Or trying to figure out how it works?
- neverminder 11y agoIt's a complicated explanation I suppose, but I would say that among other things, I've seen my colleagues abusing debugging and since debugger is a "single threaded" and sequential approach if you will, they were losing the big picture. I try to understand the code and keep it in my memory so that I could predict the behaviour without the debugger. On a better day this would be a better explanation.
- __oz 11y agoDebugger++ Without a debugger you're a sitting duck!
- parshimers 11y agoDebugging through the test cases in particular is a good way to decipher/dissect things, at least that I have found. Usually you can find a test case that is only for a specific component that you are interested in, and then the test case should only exercise those pieces, so there is not an overwhelming amount of information all at once.