Live data from Hacker News

Ask HN: Do you spend more time coding or debugging?

news.ycombinator.com

21–30 of 77 posts

Re: Ask HN: Do you spend more time coding or debugging?

#22
post #20
post #18

Analysis Programming Debugging Overhead ------------ -------- ----------- --------- -------- My Own Stuff 30% 60% 10% 0% Others' Code 50% 10% 30% 10% Enterprise 10% 10% 10% 70%

I get your point but my guess is the lack of analysis is only exacerbating the problem on the Enterprise end.

That's where you schedule a meeting to talk about scheduling a meeting to talk about Where We Went Wrong With Analysis.

Re: Ask HN: Do you spend more time coding or debugging?

#23
I am currently integrating a handful of open source big data systems and frameworks, the breakdown of my time is

    60% debugging
    15% stack overflow
    25% email archives
    15% commit logs
    10% navigating code, spelunking
    12% jira
     5% writing tests to confirm config/state/feature availability
     3% coding

Re: Ask HN: Do you spend more time coding or debugging?

#24
I spend most of my time debugging or extending old code, but then again I'm personally responsible for about 600,000 lines of undocumented code without any tests (but there are a lot of daily reports which act as monitoring checks). I will say that I rarely need to debug my own code, it's usually old code that needs to be updated due to a data change or business logic change

Re: Ask HN: Do you spend more time coding or debugging?

#25
post #20
post #18

Analysis Programming Debugging Overhead ------------ -------- ----------- --------- -------- My Own Stuff 30% 60% 10% 0% Others' Code 50% 10% 30% 10% Enterprise 10% 10% 10% 70%

I get your point but my guess is the lack of analysis is only exacerbating the problem on the Enterprise end.

If he means reading code and documentation as the only activities of analysis, then I'd say the ratios are about right.

The overhead consists of endless meetings that never reach consensus, but arguably this could be filed under analysis

Re: Ask HN: Do you spend more time coding or debugging?

#26
From The Mythical Man-Month by Fred Brooks:

  """
No parts of the schedule are so thoroughly affected by sequential constraints as component debugging and system test. Furthermore, the time required depends on the number and subtlety of the errors encountered. Theoretically this number should be zero. Because of optimism, we usually expect the number of bugs to be smaller than it turns out to be. Therefore testing is usually the most mis-scheduled part of programming. For some years I have been successfully using the following rule of thumb for scheduling a software task:

  1/3 planning
  1/6 coding
  1/4 component test and early system test
  1/4 system test, all components in hand.
      This differs from conventional scheduling
      in several important ways:
1. The fraction devoted to planning is larger than normal. Even so, it is barely enough to produce a detailed and solid specification, and not enough to include research or exploration of totally new techniques.

2. The half of the schedule devoted to debugging of completed code is much larger than normal.

3. The part that is easy to estimate, i.e., coding, is given only one-sixth of the schedule.

  """

Re: Ask HN: Do you spend more time coding or debugging?

#27
Neither, I spend more time writing or thinking about tests. When I was earlier in my career I used to insert debug comments, run code, look at output to figure out what was going on. Now, I try to write my tests that will eliminate the need to debug. If I'm trying to fix a bug, the first thing I do is write tests for what should happen if the tests don't already exist and work backwards from there. If you get in a good habit of this, it just becomes natural and with today's toolchains you can re-run tests with a watcher to achieve a real time feedback loop, which is better than a debugger IMO. The plus side is going forward you always know that the code works vs just seeing it work that one time. As your application grows, something may change what the value of the debug statement output and you'll never catch it, but your test will. /old man rant

Re: Ask HN: Do you spend more time coding or debugging?

#28
post #20

Earlier quoted context omitted.

I get your point but my guess is the lack of analysis is only exacerbating the problem on the Enterprise end.

That's where you schedule a meeting to talk about scheduling a meeting to talk about Where We Went Wrong With Analysis.

You joke but the meeting meetings are pretty common, and as awful as you would expect.

Re: Ask HN: Do you spend more time coding or debugging?

#29
post #26

From The Mythical Man-Month by Fred Brooks: """ No parts of the schedule are so thoroughly affected by sequential constraints as component debugging and system test. Furthermore, the time required depends on the number and subtlety of the errors encountered. Theoretically this number should be zero. Because of optimism, we usually expect the number of bugs to be smaller than it turns out to be. Therefore testing is u…

and from Robert L Glass, Facts and Fallacies of Software Engineering (2003, but I think a self-reference from Building Quality Software, 1992):

"The data on the percentage of time spent in error removal has varied over the years, but the usual figures are 20-20-20-40. That is, 20 percent for requirements, 20 percent for design, 20 percent for coding (intuition suggests to most programmers that here is where the time is spent, but intuition is very wrong), and 40 percent for error removal."

Post reply on HN