I'd add that in my experience, typing the 30 to 40 lines of assembler code is apt to be more error prone than typing one line of perl; so the odds of there being a bug due to a mental lapse while typing goes up. (A BSE instruction is not the same as a BSR for example...). It also takes longer to read the code (30 lines of it).

I'd agree that debugging tools have a massive impact on debugging time: using the perl debugger saves me a lot of time, as does gdb. Setting breakpoints at suspicious places, and being able to narrow down flawed code by single stepping through functions that are misbehaving until I get to the broken code is a huge timesaver.

Yes, I can get the same results "by hand", using trace statements or the like, but it takes many more runs get the same results, and I have to keep tinkering with the code, fixing stupid syntax errors in my debug statements, and so forth.

And on some systems, the core dump file you get isn't compatible with your debugger, so you either need to read it by hand (ick!), or run the whole program through the debugger for a while, and wait for it to die, so you can check the stack trace...yuck!

A good debugging environment is wonderful. A test suite that includes comprehensive regression tests is even better.

Lines of code give me a rough estimate of how much work is in the project, and how much can go wrong if I assume it's all a tangled mess just waiting to fall apart. It's a starting point for estimates of how long it will take to maintain code, assuming that the code is riddled with ridiculous side effects that shouldn't be in there, but are anyway. All too often, this assumption will turn out to be correct.

-- AC


In reply to Re^4: Source lines of code (SLOC) -- meaningful number? by Anonymous Monk
in thread Source lines of code (SLOC) -- meaningful number? by kaif

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.