[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r15177 - trunk/subversion/bindings/swig/ruby/svn

From: David James <james82_at_gmail.com>
Date: 2005-06-28 16:45:18 CEST

On 6/28/05, Kouhei Sutou <kou@cozmixng.org> wrote:
> But I don't know which is better way to do this. Should I
> ask Jani to apply my patches or commit to trunk?

Personally, I recommend the following approach: Instead of adding
print statements, add "debugprint" statements. Set up a debugprint
function which only prints when debugging is enabled. Leave these
debugprint statements in the source code permanently and they will
always be helpful whenever you are debugging.

The developers of the Log4j project for Java present a convincing
argument for including logging (or debugging) code in your Ruby (or
Java) projects. Read it below.

"Inserting log statements into your code is a low-tech method for
debugging it. It may also be the only way because debuggers are not
always available or applicable. This is often the case for distributed
applications.

On the other hand, some people argue that log statements pollute
source code and decrease legibility. (We believe that the contrary is
true). In the Java [or Ruby] language where a preprocessor is not
available, log statements increase the size of the code and reduce its
speed, even when logging is turned off. Given that a reasonably sized
application may contain thousands of log statements, speed is of
particular importance.
Logging equips the developer with detailed context for application
failures. On the other hand, testing provides quality assurance and
confidence in the application. Logging and testing should not be
confused. They are complementary. When logging is wisely used, it can
prove to be an essential tool. ...

Logging equips the developer with detailed context for application
failures. On the other hand, testing provides quality assurance and
confidence in the application. Logging and testing should not be
confused. They are complementary. When logging is wisely used, it can
prove to be an essential tool."

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 28 16:46:42 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.