dannyman.toldme.com

About Me : Free Style : Good Reads : News and Reaction : Photographs : Technical : Travels : Unsorted

Search:
June 24, 2005
Technical

Bug Density

<Adam> pickle.dump((self.dsId, dict((key, self.index[key].tolist()) for key in self.index)), open(path, ‘w’))
<Adam> Wow. Just when I was beginning to think that Guido’s plan to use structure-as-syntax was going to force nice readable structure on everyone, my hopes are dashed.
<meekay> People are still writing sh_tty code.
<Adam> And I deal with it!
<dman> That’s python?
<dman> I thought the whole point of Python was to make code like that impossible.
<Adam> Well, it’s the traditional “one in n lines of code contains a bug, so I’m going to reduce the number of lines in order to keep bugs out” thinking.
<Adam> Ironically, the kid who wrote that is my coworker who apparently had an offer from google and turned it down last year.
<meekay> I actually espouse that belief.
<meekay> Of course, if you get to the point where you’re writing obfuscated Perl in Java, you’re being counter-productive.
<Adam> I think, however, that a distinction needs to be made between “one in n operations contains a bug” and “one in n lines of code”.
<Adam> Packing more operations into one line just means that you’re making the bugs harder to untangle.
<Adam> And the code harder to parse for my poor little brain.
* Adam dumbass. Likes to stay that way.
<meekay> The pattern is not typically x bugs per n lines of code across the industry.
<meekay> It is typically a solid average x bugs per n lines of code per developer.
<meekay> And some developers have a lower x than others.
<dman> Adam: Greater bug density!
<meekay> I, for example, try to keep x very low.
<meekay> And by doing so, I am more productive.
<meekay> Because my coworkers bug queues typically have size five or six, and I typically have size two.
<dman> I think if the operation is a no-brainer, that stuff is okay, but you should reuse one of the lines you “saved” to drop a comment that will give the next sucker who has to maintain your code a friggin clue.
<meekay> Where “the next sucker” may in fact be you.
<meekay> =)
<meekay> I love it when my coworkers come and ask me about code that they wrote.
<dman> especially me, because i’m the SysAdmin, and when I start looking at the code, we’re already in trouble.

Read More

Next: Uncle John’s Avuncular Advice
Previous: Quizzes are Dumb
Categories: Technical
Possibly-Related Posts
Selling my Yen
Advice for Women: BYOC
Alien-chan!
The First Monty
Linux Uptime Reset
Anyone know what is an Alien Registration Number?
Medieval Visitation

Post a Public Comment

The Rules:

  1. For private messages, e-mail me: dannyman@toldme.com
  2. I will not publish or share your e-mail address.
  3. I will not spam you.
  4. Therefor: no anonymous posts; send me your e-mail address!
(required)
(required)

. . . comments from new posters will be held for screening.

Danny Howard is 100% responsible for the content on this site, except some of it is stolen.

All rights are reserved, unless otherwise noted. Generally, I'm a BSD guy, so you can assume implicit permission to adapt, modify, and redistribute my intellectual property with appropriate attribution. Except some of this content is itself re-appropriated, so you'd best ask first, especially for commercial use. Thanks!

You can contact me via e-mail: dannyman@toldme.com

Most of http://dannyman.toldme.com/ is powered by WordPress.

If you're hip to RSS and whatnot, you can subscribe to this site.

These links are for dannyman: login AND backlinks