[OpenLayers-Dev] constructor signatures

Schuyler Erle schuyler at nocat.net
Thu Jun 17 19:22:00 EDT 2010


On Jun 17, 2010, at 3:33 PM, Tim Schaub wrote:

> In adding the WMTS layer, I created a constructor that takes a single 
> argument.  If others agree that this is the way forward, I think there 
> is sense in getting used to it before 3.0.
> 
> I am bringing this up here because Chris objected to my commit of the 
> WMTS layer and reopened the ticket.
> 
> If anybody else has an opinion about the many versus one argument 
> constructor, please weigh in.

I think that we can address this by placing a practical guideline on the number of arguments to any function in OL. For example, we could express a style guideline that any method that might take more than 3 arguments should use a dict instead of OR in addition to one or two fixed arguments. We can then require that any violation of this guideline be accompanied by a strong justification in the code comments.

SDE


More information about the Dev mailing list