6 Sep 11:48
[groovy-user] Support for 'unless'
From: Luke Daley <ld@...>
Subject: [groovy-user] Support for 'unless'
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-09-06 09:50:54 GMT
Subject: [groovy-user] Support for 'unless'
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-09-06 09:50:54 GMT
The previous thread about unless was a bit complex as it combined the
concept of 'unless' and having conditions after statements. I am bit
worried that 'unless' by itself got a bit lost in that.
The consensus seemed to me to be that almost everyone who had used
'unless', sees it's value.
To be clear,
unless (condition) {
// stuff
} else unless (otherCondition) {
// other stuff
}
which is equivalent to…
if (!condition) {
// stuff
} else if (!otherCondition) {
// other stuff
}
I didn't see the point of unless until it was available to me, now I
am a big fan. It seemed very foreign to me when I started using perl
and ruby and at that point I did question it's usefulness. Now though,
it seems such an obvious win to aid readability.
Just wanted to get some people's opinions on this (and only this).
(Continue reading)
RSS Feed