On 29 fév, 11:27, Jann Horn wrote:
> And in coffee, you can even use 'fn?()' for that. :P
Cool! As a result:
assert? xxx
... is problably the best way today to remove asserts in production
mode when using CoffeeScript : set assert to null. Idem for trace?()
--
Job Board: http://jobs.nodejs.or
On 5 mar, 02:26, Marcel Laverdet wrote:
> > de&&bug( msg) is much faster when traces are disabled
>
> Is this a true statement?
"much faster" than debug( msg) of course ;)
When traces are disabled, the right side of the && operator is not
evaluated ; as a result the call to some "debug( msg)" fu
> de&&bug( msg) is much faster when traces are disabled
Is this a true statement?
On Wed, Feb 29, 2012 at 7:36 AM, JeanHuguesRobert <
jeanhuguesrob...@gmail.com> wrote:
> On 29 fév, 00:33, Phoscur wrote:
> > How is this better than:
> > function debug(msg) {
> > if (DEBUG_ON) {
> >
On 29 fév, 00:33, Phoscur wrote:
> How is this better than:
> function debug(msg) {
> if (DEBUG_ON) {
> console.log(msg);
> }}
>
> ?
de&&bug( msg) is much faster when traces are disabled. Idem with
de&&mand() vs assert().
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
And in coffee, you can even use 'fn?()' for that. :P
Am 29.02.2012 08:10 schrieb "Bruno Jouhier" :
I use something like:
// top of file:
var trace = require('appConfig').getTrace(module); // returns logging
function or null
// anywhere in the file
trace && trace(some_message);
getTrace can ret
I use something like:
// top of file:
var trace = require('appConfig').getTrace(module); // returns logging
function or null
// anywhere in the file
trace && trace(some_message);
getTrace can return console.log but may also return a function that
logs to file.
On Feb 29, 12:46 am, Diogo Resende
On Wed, 29 Feb 2012 00:33:32 +0100, Phoscur wrote:
How is this better than:
function debug(msg) {
if (DEBUG_ON) {
console.log(msg);
}
}
?
The complex logic in msg is processed (in some way) and debug is
called. For the same behavior you need to do:
function debug() {
if (DEBU
How is this better than:
function debug(msg) {
if (DEBUG_ON) {
console.log(msg);
}
}
?
Am 28.02.2012 23:55, schrieb JeanHuguesRobert:
> de = false // true when debugging
> de&&mand( cond ) // ie "demand" instead of "assert"
> de&&bug( msg) // ie "debug" to output trace msg
>
> On 27
de = false // true when debugging
de&&mand( cond ) // ie "demand" instead of "assert"
de&&bug( msg) // ie "debug" to output trace msg
On 27 fév, 16:30, Tim Caswell wrote:
> That's clever, I like that. Not sure if I'll use it, but I'll keep the
> technique in mind.
Thanks!
See also http://virtre
That's clever, I like that. Not sure if I'll use it, but I'll keep the
technique in mind.
On Sun, Feb 26, 2012 at 4:30 AM, JeanHuguesRobert <
jeanhuguesrob...@gmail.com> wrote:
> De&&mand( something) // ie "Demand" instead of "Assert"
>
> That's a convention I use to solve your issue. Instead of
De&&mand( something) // ie "Demand" instead of "Assert"
That's a convention I use to solve your issue. Instead of commenting
out the assertions, I simply sets global "De" variable to false.
Note: works for debug trace messages too, using De&&bug( msg)
On 26 fév, 10:02, sungchan lee wrote:
> H
11 matches
Mail list logo