[xwiki-devs] [VOTE] Codestyle convention: variable used for discarding output
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 $ok is the shortest, thus easier to type, faster to parse, and lighter on the total size of the wiki. 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". -- Sergiu Dumitriu http://purl.org/net/sergiu/
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
$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
I use either $discard or $dummy since I found them more meaningful. I do not like $ok and $output which not really means that we do not care of them. I agree with Vincent, that size and easy typing is far less important compare to having meaningful name, but I not that it is easier to type "dummy" than "discard". Denis On Thu, Nov 10, 2011 at 08:05, Vincent Massol <[email protected]> wrote:
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
$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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO eGuilde sarl - CTO
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 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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Thu, Nov 10, 2011 at 09:23, Andreas Jonsson <[email protected]> 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
Very nice, short and meaningful ! I am +1
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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO eGuilde sarl - CTO
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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
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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi, My preference goes to $discard since it had the closest semantically meaningful relation to what the variable actually does. Or, in the variable's own voice: "use me, discard me". Guillaume PS: note that's it's a preference, not a strong feeling On Thu, Nov 10, 2011 at 9:02 AM, Thomas Mortagne <[email protected]>wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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
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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, I was using $temp before Sergiu pointed to me that $discard is pretty much the existing standard already used almost everywhere. There might be some other places where something other than $discard is used, but I really see no point in starting to use something else. If we'd start using something else, we`d still be having at least 2 styles for at least 1-2 years since nobody would be touching the old code. So I`m +1 on stabilizing to $discard. Thanks, Eduard On Thu, Nov 10, 2011 at 11:02 AM, Thomas Mortagne <[email protected]
wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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
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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
+1 for $void - sounds better +1 for $discard if we consider the 'standard' that already exists in the code Thanks, Caty On Thu, Nov 10, 2011 at 14:16, Eduard Moraru <[email protected]> wrote:
Hi,
I was using $temp before Sergiu pointed to me that $discard is pretty much the existing standard already used almost everywhere. There might be some other places where something other than $discard is used, but I really see no point in starting to use something else. If we'd start using something else, we`d still be having at least 2 styles for at least 1-2 years since nobody would be touching the old code.
So I`m +1 on stabilizing to $discard.
Thanks, Eduard
On Thu, Nov 10, 2011 at 11:02 AM, Thomas Mortagne < [email protected]
wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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
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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, Out of curiosity, here are some numbers regarding current usage of the proposed terms: [Enygma@Enygma xwiki-platform]$ grep "\$discard" . -R | wc -l 544 [Enygma@Enygma xwiki-platform]$ grep "\$void" . -R | wc -l 5 [Enygma@Enygma xwiki-platform]$ grep "\$dummy" . -R | wc -l 6 [Enygma@Enygma xwiki-platform]$ grep "\$ignore" . -R | wc -l 0 [Enygma@Enygma xwiki-platform]$ grep "\$temp" . -R | wc -l 234 [Enygma@Enygma xwiki-platform]$ grep "\$ok" . -R | wc -l 121 [Enygma@Enygma xwiki-platform]$ grep "\$output" . -R | wc -l 25 Thanks, Eduard On Thu, Nov 10, 2011 at 2:16 PM, Eduard Moraru <[email protected]> wrote:
Hi,
I was using $temp before Sergiu pointed to me that $discard is pretty much the existing standard already used almost everywhere. There might be some other places where something other than $discard is used, but I really see no point in starting to use something else. If we'd start using something else, we`d still be having at least 2 styles for at least 1-2 years since nobody would be touching the old code.
So I`m +1 on stabilizing to $discard.
Thanks, Eduard
On Thu, Nov 10, 2011 at 11:02 AM, Thomas Mortagne < [email protected]> wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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
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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Thu, Nov 10, 2011 at 10:02 AM, Thomas Mortagne <[email protected]> wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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
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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
-- Thomas Mortagne
Hi, On Thu, Nov 10, 2011 at 5:30 PM, Thomas Mortagne <[email protected]>wrote:
On Thu, Nov 10, 2011 at 10:02 AM, Thomas Mortagne <[email protected]> wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, based on Edy's stats, I think the easier / faster way is to go for $discard everywhere. Guillaume On Thu, Nov 10, 2011 at 6:24 PM, Eduard Moraru <[email protected]> wrote:
Hi,
On Thu, Nov 10, 2011 at 5:30 PM, Thomas Mortagne <[email protected]>wrote:
On Thu, Nov 10, 2011 at 10:02 AM, Thomas Mortagne <[email protected]> wrote:
On Thu, Nov 10, 2011 at 9:23 AM, Andreas Jonsson <[email protected]> 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 [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Thu, Nov 10, 2011 at 8:34 AM, Sergiu Dumitriu <[email protected]> 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
+1 for $discard or $dummy. $ok and $output are really bad imo. They are too generic and don't explain the fact that the output is not used later on. Thanks, Florin Ciubotaru
$ok is the shortest, thus easier to type, faster to parse, and lighter on the total size of the wiki. 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". -- Sergiu Dumitriu http://purl.org/net/sergiu/ ______________________________**_________________ devs mailing list [email protected] http://lists.xwiki.org/**mailman/listinfo/devs<http://lists.xwiki.org/mailman/listinfo/devs>
Love Parkinson's law of triviality. $discard is fine with me since it seems to get the most use. Caleb On 11/10/2011 01: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
$ok is the shortest, thus easier to type, faster to parse, and lighter on the total size of the wiki. 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".
Hi, On Fri, Nov 11, 2011 at 1:23 AM, Caleb James DeLisle < [email protected]> wrote:
Love Parkinson's law of triviality.
:-) I think that over the years I've seen worse cases on this list though... I'll try to dig them out some day. Guillaume
$discard is fine with me since it seems to get the most use.
Caleb
On 11/10/2011 01: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
$ok is the shortest, thus easier to type, faster to parse, and lighter on the total size of the wiki. 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".
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, I'm struggling with adding a google map to an xwiki page using javascript. Below is the code I'm using which does not work. It's not easy to see where the problem is. {{html clean="false" wiki="false"}} <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" id="script"> var tableid = 297050; var map; function initialize() { map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(37.4, -122.1), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }); var layer = new google.maps.FusionTablesLayer({ query: { select: 'Address', from: tableid }, map: map }); } </script> <script> window.onload=initialize(); </script> HELLO <table><tr><td width="400" height="400"> <div id="map_canvas" style="width:100%; height:100%"></div> </td></tr></table> {{/html}} The page can be viewed Today (14/11/2011) on http://playground.xwiki.org/xwiki/bin/view/Test/MapJavaScript Username: guest password guest123 The html page I am trying to display is shown here: http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fusiontableslayer _example.html Any help is much appreciated. Thanks Riaz
Hi, You could check http://extensions.xwiki.org/xwiki/bin/view/Extension/Map+Macro Thanks -Vincent On Nov 14, 2011, at 12:30 PM, Riaz Shafi wrote:
Hi,
I'm struggling with adding a google map to an xwiki page using javascript. Below is the code I'm using which does not work. It's not easy to see where the problem is.
{{html clean="false" wiki="false"}}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" id="script"> var tableid = 297050; var map;
function initialize() { map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(37.4, -122.1), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP });
var layer = new google.maps.FusionTablesLayer({ query: { select: 'Address', from: tableid }, map: map }); } </script> <script> window.onload=initialize();
</script>
HELLO <table><tr><td width="400" height="400"> <div id="map_canvas" style="width:100%; height:100%"></div> </td></tr></table>
{{/html}}
The page can be viewed Today (14/11/2011) on http://playground.xwiki.org/xwiki/bin/view/Test/MapJavaScript Username: guest password guest123
The html page I am trying to display is shown here: http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fusiontableslayer _example.html
Any help is much appreciated.
Thanks
Riaz
Hi Riaz, The clean approach is to put the JavaScript code in a JavaScriptExtension (see http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial#HMi... ) and leave only the HTML in the page content. Hope this helps, Marius On Mon, Nov 14, 2011 at 1:30 PM, Riaz Shafi <[email protected]> wrote:
Hi,
I'm struggling with adding a google map to an xwiki page using javascript. Below is the code I'm using which does not work. It's not easy to see where the problem is.
{{html clean="false" wiki="false"}}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" id="script"> var tableid = 297050; var map;
function initialize() { map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(37.4, -122.1), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP });
var layer = new google.maps.FusionTablesLayer({ query: { select: 'Address', from: tableid }, map: map }); } </script> <script> window.onload=initialize();
</script>
HELLO <table><tr><td width="400" height="400"> <div id="map_canvas" style="width:100%; height:100%"></div> </td></tr></table>
{{/html}}
The page can be viewed Today (14/11/2011) on http://playground.xwiki.org/xwiki/bin/view/Test/MapJavaScript Username: guest password guest123
The html page I am trying to display is shown here: http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fusiontableslayer _example.html
Any help is much appreciated.
Thanks
Riaz
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, I have followed the javascriptExtension example. I can execute the javascript when I have "Always on this page" selected (simple alert("HELLO"); command) The problem I have is executing the javascript on demand. Using the following code I cannot execute the javascript on demand. {{velocity}}$xwiki.jsx.use("<space>.<javascript Name>"){{/velocity}} Is there anything else that I need to do? I have followed the javascript example verbatim and tried executing the following code but no success: {{velocity}}$xwiki.jsx.use("XWiki.MyFirstJavascriptExtension"){{/velocity}} Any ideas? Thanks Riaz -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Marius Dumitru Florea Sent: 16 November 2011 14:44 To: XWiki Developers Subject: Re: [xwiki-devs] {{html}} tag using JavaScript Hi Riaz, The clean approach is to put the JavaScript code in a JavaScriptExtension (see http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial#HMi nimalJavaScripteXtension ) and leave only the HTML in the page content. Hope this helps, Marius On Mon, Nov 14, 2011 at 1:30 PM, Riaz Shafi <[email protected]> wrote:
Hi,
I'm struggling with adding a google map to an xwiki page using javascript. Below is the code I'm using which does not work. It's not easy to see
where
the problem is.
{{html clean="false" wiki="false"}}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" id="script"> var tableid = 297050; var map;
function initialize() { map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(37.4, -122.1), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP });
var layer = new google.maps.FusionTablesLayer({ query: { select: 'Address', from: tableid }, map: map }); } </script> <script> window.onload=initialize();
</script>
HELLO <table><tr><td width="400" height="400"> <div id="map_canvas" style="width:100%; height:100%"></div> </td></tr></table>
{{/html}}
The page can be viewed Today (14/11/2011) on http://playground.xwiki.org/xwiki/bin/view/Test/MapJavaScript Username: guest password guest123
The html page I am trying to display is shown here:
http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fusiontableslayer
_example.html
Any help is much appreciated.
Thanks
Riaz
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Tue, Nov 22, 2011 at 1:43 PM, Riaz Shafi <[email protected]> wrote:
Hi,
I have followed the javascriptExtension example. I can execute the javascript when I have "Always on this page" selected (simple alert("HELLO"); command)
The problem I have is executing the javascript on demand.
Using the following code I cannot execute the javascript on demand.
{{velocity}}$xwiki.jsx.use("<space>.<javascript Name>"){{/velocity}}
It should be: {{velocity}}$xwiki.jsx.use("<space>.<NameOfThePageThatHoldsTheJSXObject>"){{/velocity}} So don't use the value of the "Name" property of the JavaScriptExtension object. Use the name of the page holding the object. While debugging you can use: {{velocity}}$xwiki.jsx.use("Space.Page", {'minify': false}){{/velocity}} so that you can easily put breakpoints and debug your code with tools like Firebug.
Is there anything else that I need to do? I have followed the javascript example verbatim and tried executing the following code but no success:
{{velocity}}$xwiki.jsx.use("XWiki.MyFirstJavascriptExtension"){{/velocity}}
Any ideas?
It should work if XWiki.MyFirstJavascriptExtension is the wiki page that has the JavaScriptExtension object with your JavaScript code. Hope this helps, Marius
Thanks
Riaz
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Marius Dumitru Florea Sent: 16 November 2011 14:44 To: XWiki Developers Subject: Re: [xwiki-devs] {{html}} tag using JavaScript
Hi Riaz,
The clean approach is to put the JavaScript code in a JavaScriptExtension (see http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial#HMi nimalJavaScripteXtension ) and leave only the HTML in the page content.
Hope this helps, Marius
On Mon, Nov 14, 2011 at 1:30 PM, Riaz Shafi <[email protected]> wrote:
Hi,
I'm struggling with adding a google map to an xwiki page using javascript. Below is the code I'm using which does not work. It's not easy to see
where
the problem is.
{{html clean="false" wiki="false"}}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" id="script"> var tableid = 297050; var map;
function initialize() { map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(37.4, -122.1), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP });
var layer = new google.maps.FusionTablesLayer({ query: { select: 'Address', from: tableid }, map: map }); } </script> <script> window.onload=initialize();
</script>
HELLO <table><tr><td width="400" height="400"> <div id="map_canvas" style="width:100%; height:100%"></div> </td></tr></table>
{{/html}}
The page can be viewed Today (14/11/2011) on http://playground.xwiki.org/xwiki/bin/view/Test/MapJavaScript Username: guest password guest123
The html page I am trying to display is shown here:
http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fusiontableslayer
_example.html
Any help is much appreciated.
Thanks
Riaz
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Thanks Marius, I understand now. Thanks Riaz -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Marius Dumitru Florea Sent: 22 November 2011 14:52 To: XWiki Developers Subject: Re: [xwiki-devs] {{html}} tag using JavaScript On Tue, Nov 22, 2011 at 1:43 PM, Riaz Shafi <[email protected]> wrote:
Hi,
I have followed the javascriptExtension example. I can execute the javascript when I have "Always on this page" selected (simple alert("HELLO"); command)
The problem I have is executing the javascript on demand.
Using the following code I cannot execute the javascript on demand.
{{velocity}}$xwiki.jsx.use("<space>.<javascript Name>"){{/velocity}}
It should be: {{velocity}}$xwiki.jsx.use("<space>.<NameOfThePageThatHoldsTheJSXObject>"){{ /velocity}} So don't use the value of the "Name" property of the JavaScriptExtension object. Use the name of the page holding the object. While debugging you can use: {{velocity}}$xwiki.jsx.use("Space.Page", {'minify': false}){{/velocity}} so that you can easily put breakpoints and debug your code with tools like Firebug.
Is there anything else that I need to do? I have followed the javascript example verbatim and tried executing the following code but no success:
{{velocity}}$xwiki.jsx.use("XWiki.MyFirstJavascriptExtension"){{/velocity}}
Any ideas?
It should work if XWiki.MyFirstJavascriptExtension is the wiki page that has the JavaScriptExtension object with your JavaScript code. Hope this helps, Marius
Thanks
Riaz
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Marius Dumitru Florea Sent: 16 November 2011 14:44 To: XWiki Developers Subject: Re: [xwiki-devs] {{html}} tag using JavaScript
Hi Riaz,
The clean approach is to put the JavaScript code in a JavaScriptExtension (see
http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial#HMi
nimalJavaScripteXtension ) and leave only the HTML in the page content.
Hope this helps, Marius
On Mon, Nov 14, 2011 at 1:30 PM, Riaz Shafi <[email protected]> wrote:
Hi,
I'm struggling with adding a google map to an xwiki page using
javascript.
Below is the code I'm using which does not work. It's not easy to see where the problem is.
{{html clean="false" wiki="false"}}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" id="script"> var tableid = 297050; var map;
function initialize() { map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(37.4, -122.1), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP });
var layer = new google.maps.FusionTablesLayer({ query: { select: 'Address', from: tableid }, map: map }); } </script> <script> window.onload=initialize();
</script>
HELLO <table><tr><td width="400" height="400"> <div id="map_canvas" style="width:100%; height:100%"></div> </td></tr></table>
{{/html}}
The page can be viewed Today (14/11/2011) on http://playground.xwiki.org/xwiki/bin/view/Test/MapJavaScript Username: guest password guest123
The html page I am trying to display is shown here:
http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fusiontableslayer
_example.html
Any help is much appreciated.
Thanks
Riaz
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
+1 for $discard Thanks, Marius On Thu, Nov 10, 2011 at 8:34 AM, Sergiu Dumitriu <[email protected]> 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
$ok is the shortest, thus easier to type, faster to parse, and lighter on the total size of the wiki. 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". -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (12)
-
Andreas Jonsson -
Caleb James DeLisle -
Denis Gervalle -
Ecaterina Moraru (Valica) -
Eduard Moraru -
Florin Ciubotaru -
Guillaume Lerouge -
Marius Dumitru Florea -
Riaz Shafi -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol