I agree with u that those many if statements will clutter code. But a method call 
everytime is also expensive in terms of performance. So it is really a trade off 
between performance and readability.
 
Regds
Aditya

        -----Original Message----- 
        From: Xavier Noria [mailto:[EMAIL PROTECTED] 
        Sent: Thu 8/5/2004 2:47 PM 
        To: Struts Users Mailing List 
        Cc: 
        Subject: Re: System.out.println
        
        

        On Aug 5, 2004, at 10:58, Aditya Athalye wrote:
        
        > U shld use a flag say debug.
        >
        > so the code will look like
        >
        > boolean debug = true;
        >
        > if(debug)
        >
        > System.out.println(" .... ");
        >
        > In production make the flag as false.
        
        Just out of curiosity.
        
        I see that pattern often, and find that "if" for every single debug
        message clutters the source code unnecessarily. I just put the "if" in
        the dubug function and gain readability and lines at the price of a
        method call.
        
        Is that "if" around logging calls a measured, conscious choice? Or it
        is just you can't psychologically stand an unnecessary call? Even if
        the block was optimized out by the compiler the price of the extra
        lines all over the source tree looks too expensive to me in the context
        a web application. Should I revise this?
        
        -- fxn
        
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to