[Cosmo-dev] Re: [commits-cosmo] (br) [4567] this is a better way not to clobber namespaces.

Bobby Rullo br at osafoundation.org
Mon Jun 11 10:09:54 PDT 2007


Matthew,

+1 to letting dojo create namespace objects, deprecating use of local  
scope for private variables.

I appreciate your flexibility with this stuff!

Bobby

> Yes, the use of underscore with public properties as a flag for  
> "this is private" seems to me to be kind of cheesy when JavaScript  
> has actual private variables and methods available. But I can also  
> see the value of being able to explore them in Firebug or some  
> other shell without having to add debug code.
>
> It affects the other team members more than it does me, since the  
> affected code they're working in is mine, and I know mostly where  
> stuff is anyway. If it'll make things easier for them, I'll work to  
> overcome my knee-jerk sense of revulsion and work with the  
> underscores. :)
>
> Sounds like a clear consensus for letting the Dojo packaging system  
> create the namespace objects, and not using local scope for private  
> variables or functions. Unless someone else has an objection, I'll  
> consider that our standard approach, and as opportunity presents  
> itself I'll migrate the two problem places in the code over to use  
> a common.js. file and underscored public members instead of private  
> ones.
>
> The cosmo.app.pim namespace conversion will be fairly easy, since  
> there's less code -- and the other offender, cosmo.view.cal.canvas,  
> is in need of some serious work anyway to remedy all the ugly shim  
> code sitting in there that bridges the render method of the  
> cosmo.view.cal.canvas.Canvas object with the rendering code sitting  
> in cosmo.view.cal.canvas.
>
> Note: I will not be doing this conversion any time in the immediate  
> future, as it would have negative impact on scheduling. (Just added  
> that to make sure Ted isn't hyperventilating. :))
>
> Nicola, thanks very much for getting this discussion started.
>
>
> Matthew
>
>
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev



More information about the cosmo-dev mailing list