+1, as a class getter, an internal function, or even a local variable
with a descriptive name.
On 19 November 2015 at 09:44, Justin Mclean wrote:
> Hi,
>
> I prefer:
>
> if (giveItName()) {
> ….
> }
>
> giveItName() {
> return condition1 && condition2 && condition3;
> }
>
> Thanks
I don't think there is any reason to mandate any particular style. If
that's the way you want to write some code, that's fine with me.
IMO, my brain thinks "loop" when it sees "do" as in, "something in here
may need to be done more than once", so if you do use this style, could
you try to remembe
Of course there’s no reason not to mix and match. In this case, I’d probably
join similar conditions like this:
do
{
if(prompt == null || prompt == "")
break;
if(!skin || !skin.currentState)
break;
if(skin.currentState.indexOf("WithPrompt") == -1 && text.length != 0)
To be clear, I think Mark’s code was a nice compromise between approach #1 and
approach #2.
In this case following Flex code formatting style, do-while-false should look
something like this:
do
{
if(prompt == null)
break;
if(prompt == "")
break;
if(!skin)
brea
I believe example2 need to be reformatted to match example1
do
{
if(prompt == null)
{
break
};
if(prompt == "")
{
break
};
if(!skin){
break
};
if(!skin.currentState)
{
break
};
if(skin.currentState.indexOf("WithProm
Let me see if I can reformat into all the examples so we can have a real sample
for people. Below shows the original, what was committed. Then shows the last
few examples. Hopefully this won't get word wrapped to badly or have font
issues.
The original was changed to better group the sets of
Hi Harbs,
Really extraordinary way of use do-while. I love it and I'm ok with using it
in invalidateSkinState!
Thanks for sharing it!
Piotr
-
Apache Flex PMC
piotrzarzyck...@gmail.com
--
View this message in context:
http://apache-flex-development.247.n4.nabble.com/do-while-false-tp5
Hi,
I prefer:
if (giveItName()) {
….
}
giveItName() {
return condition1 && condition2 && condition3;
}
Thanks,
Justin
I personally prefer
if(conditiona && conditionb && conditionc &&conditiond)
{
//do something
}
it is shorter and more clear to me
not sure about performance, but I guess "if(conditiona && conditionb &&
conditionc &&conditiond)" should produce better native code
On Thu, Nov 19, 2015 at 2:16 PM, H