I note that the sortField parameter has now been removed. While I
don't think that this is incorrect in this particular case, I do
caution in general about removing unused parameters. The reason is
this: in object oriented programming it is common practice to have
unused parameters in a function, since the the function defines an
interface; an interface used by those who call or override the
function. So by removing parameters you are changing the interface,
which is bad from compatibility terms - it can break the code of
callers or overriders of the function. (Note that adding parameters on
the end is OK, at least in javascript (as long as an 'undefined'
default value is assumed)).

The reason it is OK to remove the parameter in this particular case is
that stated in this thread - namely an array of strings (rather than
an array of tiddlers) is returned, so the initial inclusion of the
sortField parameter must have been incorrect (and was probably there
to provided similarity with the getTiddlers function).

However I repeat my caution about removing parameters, even unused
ones, in the general case.

Martin

On 18 May 2011 17:45, FND <[email protected]> wrote:
>>> However the getMissingLinks function won't ever need to sort via a
>>> field because it just returns an array of strings not a collection
>>> of tiddler objects so there isn't anything to sort on.
>>
>> Not exactly true. [...] Thus, there is already work being done to
>> retrieve tiddler data associated with the link (or it's container)
>> and those data values could be used to sort the resulting list
>
> Fair point - however, I believe Colm was referring to the current state
> of getMissingLinks, where his assessment is correct.
>
> What you describe sounds like a potential feature request - a reasonable
> one too, though I guess it's YAGNI for now*. The fact that the parameter
> already existed seems like coincidence.
>
>
> -- F.
>
>
> * I haven't been following this thread in detail though
>
> --
> 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.
>
>

-- 
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.

Reply via email to