[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

if (foo) return false; else return true;

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 20
Thread images: 6

File: 1481817709561.jpg (143KB, 719x960px)
1481817709561.jpg
143KB, 719x960px
if (foo)
return false;
else
return true;
>>
>>58106114
>
if (POO)
return false;
else
return true;
>>
>>58106114
return foo == false;
>>
>>58106134
>>
>>58106134
return !foo;
>>
>>58106114
return !foo;
>>
>>58106114
if (foo)
Printf("poo in the loo") ;
return false;
else
Printf("OP is a fag") ;
return true;
>>
>>58106114
<code>
if (foo)
return !foo;
else
return foo;
<code>
>>
File: bfdghf.jpg (17KB, 367x388px) Image search: [Google]
bfdghf.jpg
17KB, 367x388px
>>58106184
>no scope
>upper case printf
>lacking indent
Do you even program
>>
>>58106114
try
{
if (foo == true)
{
return new Boolean(false);
}
else if (foo == false)
{
return new Boolean(true);
}
}
catch (Exception ex)
{
ex.printStackTrace();
System.exit(1);
}
>>
File: hp.jpg (539KB, 1063x657px) Image search: [Google]
hp.jpg
539KB, 1063x657px
>>58106243
>>
>>58106192
>using the carat tag block
>>
>>58106265
I've come up with a better one:
private static Boolean reverseTruthValueOfBoolean(Boolean foo) throws Exception {
Boolean theValueToBeReturnedFromThisMethod = null;

try
{
if (foo.equals(Boolean.TRUE) == true)
{
theValueToBeReturnedFromThisMethod = new Boolean(false);
}
else if (foo.equals(Boolean.FALSE) == true)
{
theValueToBeReturnedFromThisMethod = new Boolean(true);
}
else
{
throw new NullPointerException();
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
return theValueToBeReturnedFromThisMethod;
}
}
>>
>>58106114
I've actually had a manager that would bitch to me if I had written "return !foo;" in this case, because that would have been too obfuscated and code is meant to be read by other people and yadda yadda. Fuck that.
>>
>>58106353
you should have
...
BooleanFactory booleans = new BooleanFactory(BooleanFactory.PRIMITIVE_BOOLEANS);
...
BooleanFactory.makeTrue()
...
BooleanFactory.makeFalse()

instead
>>
>>58106373

Trinary, GOML

return foo ? false : true;
>>
>>58106373
oops, has to be "booleans.make..." of course
>>
File: 56520055.jpg (119KB, 400x400px) Image search: [Google]
56520055.jpg
119KB, 400x400px
>>58106360
I expect "other people" to be able to understand a simple boolean negation.
If they can't I'm clearly in a company run by baboons
>>
>>58106373
I can think of lots of things to do to make that code even more like idiomatic Java, but I really can't be fucked typing out that much code.
>>
>>58106383
thank god, you made a factory.

can you cache a singleton instance of the wrapped holder so that we can have multiple contexts without recreating the underlying dataset? i think that would perform much better and make a lot of pattern fags happy.
Thread posts: 20
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.