On Mon, Oct 24, 2011 at 19:30, Jesse <[email protected]> wrote:
> > I prefer naming more like this : > CB.setSupportedOrientations(0,180); > This provides more indication to the developer that they are setting all of > them, where supportOrientation( ) might imply that you are simply adding a > value to the list. > Again, it's semantics. > If "CB" is to become the object we namespace off of, then I think we probably want to reserve the next "field" to be a subcategory, as it were. If we had a function name CB.setSupportedOrientations(), then we're opening the "top level" of CB as a dumping ground for all sorts of functions people think should be "global-ish". I'd prefer to limit the # of global-ish functions under CB directly. CB.orientation might make sense, if it didn't overlap with accelerometer et al goop. Which I guess it does. Maybe "rotation"? "displayRotation"? CB.rotation.allow(0,180)? We want a "getter" as well, right? I'm partial to jquery-styled same-name for getter and setter. CB.rotation.allow() returns the current values, CB.rotation.allow(something) sets it. Presumably the getter should return the same sort of value as the setter takes as a parameter, which means varargs aren't a good fit, but an array is. -- Patrick Mueller http://muellerware.org
