debugging. because coding is the easiest part. when I am asked to build any feature. I take some time thinking on what and how should I do (around 10%-20% of my time). Once I feel like I have a good idea I continue to code (But sometime when I start to code I spend more time on thinking on designing code, like best practises etc.) so I think like 30%-40% of my time go to coding and thinking about best code practises.…
Ask HN: Do you spend more time coding or debugging?
61–70 of 77 posts
Re: Ask HN: Do you spend more time coding or debugging?
#62Neither. I spend most of my time procrastinating and/or day dreaming.
Re: Ask HN: Do you spend more time coding or debugging?
#63I used to spend the vast amount of my time debugging. Fast forward a few years - Experience, good programming habits, and the gratuitous use of assertions. Now I spend a negligible amount of time debugging, and it never ceases to amaze me how frequently things just work the first time. Edit: I guess I want to say that there is one, and only one, bottom line: the relentless, ruthless pursuit of quality . It takes time…
Not that it happens much.
Re: Ask HN: Do you spend more time coding or debugging?
#64Re: Ask HN: Do you spend more time coding or debugging?
#65I used to spend the vast amount of my time debugging. Fast forward a few years - Experience, good programming habits, and the gratuitous use of assertions. Now I spend a negligible amount of time debugging, and it never ceases to amaze me how frequently things just work the first time. Edit: I guess I want to say that there is one, and only one, bottom line: the relentless, ruthless pursuit of quality . It takes time…
Agreed, but with the addition of some periodic, many hour, something-completely-unanticipated-happened-and-I-am-so-perplexed debugging sessions.
I spend more time creating then debugging when I write the code from scratch, but I still say I spend probably at most 70% coding if it is a new project. The rest is in failing tests and finding those weird screwed up errors that take multiple days of a debugging session to find. For existing code I take over, it is probably usually more like a max of 50-60% coding depending on the original authors skill.
Re: Ask HN: Do you spend more time coding or debugging?
#66Bonus points if the project started as one thing and pivoted to something completely different midway through development, and about 50% of the code is completely unused.
Re: Ask HN: Do you spend more time coding or debugging?
#67Re: Ask HN: Do you spend more time coding or debugging?
#68Honestly, I'm probably better at it than building new features anyway.
Re: Ask HN: Do you spend more time coding or debugging?
#69I've sunk a lot of time into trying to change this. Among other changes, I've:
- Improved crash dump collection, to spend less time reproducing bugs and be more thorough in addressing them.
- Improved code debuggability - for example, writing scripts to inject call stack information into actionscript and java via disassembly, which I can then display on assert, especially on platforms where I have unreliable or incomplete debuggers.
- Learn and use defensive coding techniques to make bugs fewer in number, shallow, and caught more quickly and with more context.
- Write thorough tests to catch said bugs before I even run my main application, and more edge cases to input
- Learned more tools to catch bugs I might not even know exist - valgrind, address sanitizer, static analyzers, fuzz testers, ...
I spend much less time debugging my own code now. If I'm lucky, I'll work on projects where I don't have to debug my coworker's code all that much either. That still leaves debugging 3rd party libraries and tools - which I may lack the source to entirely - that I suddenly have more free time to really properly investigate and get to the root cause of.