[wp-hackers] echo and return
Brian Meidell Andersen
brian at mindflow.dk
Mon Jul 26 19:37:24 UTC 2004
I can definitely see the advantages. I just don't like the style, I guess.
I'm an old fart when it comes to coding style at the tender age of 25.
How sad.
I would never make a function with 12 parameters. I would probably make
a class, then make an instance of it and have people configure it before
they output it, like this:
<?php
$calendar->setFirstWeekDay("sunday");
$calendar->setMonth("february");
$calendar->setYear(2004);
$calendar->Show();
?>
But as I said - I'll do whatever is The Way.
Noone benefits from everyone following their old style in a group
programming effort.
/Brian
Ryan Boren wrote:
>On Mon, 2004-07-26 at 10:18 -0700, Kitty wrote:
>
>
>>On Mon, 2004-07-26 at 14:53 +0200, Brian Meidell wrote:
>>
>>
>>>About the url encoded parameter lists, though:
>>>Since user friendliness seems to be an issue (an approach I agree with),
>>>I can't understand why we would go with url encoded argument strings.
>>>
>>>I can't think of anything much more user hostile than asking the user
>>>not only learn the parameters for the method, but also the name of the
>>>parameters, and then try to get the encoding right.
>>>
>>>I will would be shaken at my foundation if users weren't more confused
>>>by url encoded parameter lists than either $echo parameters or double
>>>functions.
>>>
>>>
>>Prepare to have your foundation shaken.
>>
>>One of my plugins, "Show Categories" is pretty widely used. If someone
>>wants a mini-blog in a side bar, they either use this, or Matt's asides.
>>Somewhere around the second release, I was was in param list hell. So I
>>went to the 'url' style param list.
>>
>>I've not had *one* support request/feedback asking how to use it! And
>>with the nature of the plugin you *have to* pass params.
>>
>>Some of the functions that most widely modified in #menu also take 'url'
>>params, and tend not to be a problem for users. It's a fairly intuitive
>>way of passing params, believe it or not. The users can see exactly what
>>they're setting, and don't have to worry about the positional aspect.
>>
>>So don't underestimate the users. Don't develop for "grandma," as a lot
>>of people in the open source world are. I try an stick with this
>>assumption:
>>"Anyone interested in customising their blog will be able to digest the
>>the few technical bits that are needed to make things work. So document
>>accordingly."
>>
>>
>
>Yep. I personally like named parameters. The main reason we use them
>in WP is to make it possible to change the default value of parameter
>number 12 without having to set values for parameters 1 - 11. Further,
>time and time again I see reports in the forums from people who tried to
>do "foo=bar" in a template tag. Perhaps html tag attributes and query
>strings have people thinking in terms of named parameters.
>
>Ryan
>
>
>
>_______________________________________________
>hackers mailing list
>hackers at wordpress.org
>http://wordpress.org/mailman/listinfo/hackers_wordpress.org
>
>
>
>
More information about the hackers
mailing list