Question about debug code on published packages
Carlos Ribeiro
carribeiro at gmail.com
Sun Nov 5 17:10:04 GMT 2006
Hi,
I would like to hear some sincere opinions about the practice of including
debug code in published packages. More specifically, if I take a package
written by someone else and modify it to include debugging code (for
example, by converting "print" statements that are commented out in the
code), is such contribution an acceptable/desirable practice? What about
adding debug code that can be turned on/off? I ask this question because I
know there are pros and cons to the practice; and also, because I don't want
to waste my time or even to "piss off" the maintainer with something
unwanted by himself or by the community.
PROS:
Debug options are a valuable tool when one is starting to look at some
package, to track a bug, or just to understand how something works.
It's cleaner than using "prints" that need to be removed or commented out
before publishing the package.
It avoids a potential problem when a little used "print" statement stays in
the code because someone forgets to remove it.
It makes clearer to whoever is reading the code about which messages are
supposed to be debugging ones, and which ones are really regular messages.
CONS:
It's of limited use most of the time;
Depending upon the implementation, it can be confusing for non experienced
users;
Depending upon the implementation, it may have a performance impact;
It adds more "bloat" to the package (and with CD space at a premium, every
byte counts);
It adds more complexity (command line or configuration file parsing), thus
opening the chance for new bugs or even vulnerabilities;
Last, some people believe that published packages should not include debug
code, as a matter of practice.
Finally, please bear in mind that I am asking this question in the generic
sense, and this it does not imply a problem with any specific package, or
with the coding practices of any particular developer. I also hope this
forum is the appropriate place for this kind of question. Thanks in advance,
--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20061105/3c9fea33/attachment-0001.htm
More information about the ubuntu-devel
mailing list