Hi,
On Thu, Nov 10, 2011 at 5:30 PM, Thomas Mortagne
<thomas.mortagne(a)xwiki.com>wrote;wrote:
On Thu, Nov 10, 2011 at 10:02 AM, Thomas Mortagne
<thomas.mortagne(a)xwiki.com> wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson
<aj(a)member.fsf.org>
wrote:
> 2011-11-10 08:05, Vincent Massol skrev:
>>
>> On Nov 10, 2011, at 7:34 AM, Sergiu Dumitriu wrote:
>>
>>> Hi devs,
>>>
>>> Some methods must be captured so that they don't create output when
called from velocity, usually with something like:
>>>
>>> #set ($var = $obj.doSomething())
>>>
>>> Where $var is a variable whose content isn't needed and won't be
used. And everyone seems to have his favorite name for it: $discard, $ok,
$ignore...
>>>
>>> I'd like to have a single variable name, so that in the end we don't
end up creating 5 different variables for the same goal. So, which one do
you prefer:
>
> 1. $discard
> 2. $discarded
> 3. $ignore
> 4. $ignored
> 5. $ok
> 6. $output
We can also think of:
7. $dummy (I always use this one)
8. $unused
How about:
9. $void
+1, that's what I'm using usually too
I would add that "void" make clean it's nothing while "discard"
could
be a real (probably boolean) variable IMO
$void does sound good if you think of java methods with void return type.
Or, more generally, a procedure rather than a function, which is actually
our use case for velocity.
Even if "void" can be used as a verb or even a boolean variable name (i.e.
a product's warranty status or whether to change it), it's less common than
"discard".
I would be +0.5 for $void.
Thanks,
Eduard
>
> But I don't have a strong opion about this.
>
>
>>> $ok is the shortest, thus easier to type, faster to parse, and
lighter
on the total size of the wiki.
>>
>> The size is definitely a bad argument. Let's remove all comments
it'll slim down the wiki sizeā¦ yeah! :)
>>
>> Faster to type is also not a good argument. Using meaningful variable
names is better.
>>
>>> On the other hand, I prefer $discard since it's more meaningful, it
conveys exactly what that line does: "$discard the output of this method
call".
They're all fine with me except $output.
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne
--
Thomas Mortagne
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs