On May 19, 1:45 pm, [email protected] wrote: > On Thu, 19 May 2011, Martin Budden wrote: > > (Note that adding parameters on > > the end is OK, at least in javascript (as long as an 'undefined' > > default value is assumed)). > > I'd like to see this habit change. It makes for very noisy method > signatures. I much prefer (in javascript at least) the policy of > passing 0, 1 or 2 required parameters, and then everything else that be > option as a dict/hash. A tidied up version of this: > > var foo = function(req1, req2, passed_options) { > var options = { > bar: 'hello' > } > if (typeof passed_options === 'undefined') > passsed_options = {}; > $.extend(options, passed_options) > // actual code > > }
+1 This would be my preference in an ideal TiddlyWiki world too. -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
