[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(true == true){ System.out.println("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: 48
Thread images: 7

File: hqdefault.jpg (3KB, 480x360px) Image search: [Google]
hqdefault.jpg
3KB, 480x360px
if(true == true){
System.out.println("true")
}

//vs.

if(true == true)
{
System.out.println("true")
}


Discuss.
>>
No. We are not falling for your bait op.
>>
>>59505900
Latter in C/C++. Former in everything else.
>>
For a single statement you don't use brackets.
You put it all on the same line too.
>>
>>59505900
inb4 python
>>
This thread has been made a million times already, FUCK OFF.

Go find some other way to piss people off.
>>
>>59505900
if(x==y){ System.out.println("true") }

desu
>>
>>59505956
first time I've seen one. I'm with the second one OP
>>
if (x==y) System.out.println("true")
>>
>>59505900
if(true)
System.out.println("true");
>>
>>59505982
How?? How is this the first time you've seen this thread? It happens all the fucking time. Every day somebody makes this thread.
>>
if(true==true) {system.out.println("true");
}
>>
>>59505900
puts "true" if true
>>
>>59505972
you serious?

if(x==y) System.out.println("true");
>>
File: right brace and terminators.jpg (10KB, 347x145px) Image search: [Google]
right brace and terminators.jpg
10KB, 347x145px
There is a master race. Look upon it, now.
>>
>>59506065
https://www.google.com/amp/s/nakedsecurity.sophos.com/2014/02/24/anatomy-of-a-goto-fail-apples-ssl-bug-explained-plus-an-unofficial-patch/amp/

Don't be like apple, boys. Don't use gotos or this method of boolean evaluation.
>>
File: aaaaaaaaaAAAAAAAA.jpg (21KB, 480x480px) Image search: [Google]
aaaaaaaaaAAAAAAAA.jpg
21KB, 480x480px
>>59506616
>>
>>59506616
I honestly thought it was Python when I first glanced at it
>>
>>59505900
> if(true == true)
Designated Indian code.
>>
if (true == true)
goto fail;
goto fail;
>>
>>59505923
And if someone inherits your code it's that much more difficult to sort out...
>>
>>59506616
i'm in love w/ u
>>
>>59505900

Not OOP enough.

package thruthy;

class TruthValue implements Comparable<TruthValue> {
private boolean val;

public TruthValue(boolean val) {
this.val = val;
}

public truthValue() {
truthValue(false);
}

public boolean getValue() {
return this.val;
}

public void setValue(boolean val) {
this.val = val;
}

@Override
public int compareTo(TruthValue otherVal) {
if (otherVal == Null) {
throw new NullPointerException("You must not compare to Null because reasons.");
};

if (otherVal.getValue() == this.getValue()) {
return true;
} else {
return false;
}
}
}

class Main{

public static void main(String args[]){
TruthValue val1 = new TruthValue(true);
TruthValue val2 = new TruthValue(true);

if (val1.compareTo(val2)) {
System.out.println("true");
}
}
}
>>
File: indention_style.png (66KB, 597x255px) Image search: [Google]
indention_style.png
66KB, 597x255px
>>59506616

Good job, posting the thumbnail.
>>
>>59505900
public class Program
{
public static void main(String[] args)
{
int x = 6;

if (x >= 5) {
System.out.println("true");
}
else {
System.out.println("false");
}
}
}
>>
>>59505900
bool GetTrue(bool trueval) {
return trueval != false;
}

if(1 && true && !false && GetTrue(true)) {
System.out.println("very true");
}
>>
>>59507477
>not using decent editor
>being bad programmer
>>
>>59506207
no it doesn't. first for me too.
>>
>>59505900
As long as the code is run through an auto-formatter so that it's the same everywhere I don't care.
>>
>>59506278
>>>59505972
>you serious?
>if(x==y) System.out.println("true");

This
>>
File: 1485368514942.jpg (93KB, 510x798px) Image search: [Google]
1485368514942.jpg
93KB, 510x798px
>>59508124
You're a decent human being anon
>>
my coworkers use:
if(true)
{
system.out.println
}

its unreadable
>>
>>59506616
Thats genius! Love it! I'm sure $coworkers will thank you for the now beutified code base
>>
void main(int number){

if(number == 0){
printf("0");
}
if(number == 1){
printf("1");
}
if(number == 2){
printf("2");
}
if(number == 3){
printf("3");
}
if(number == 4){
printf("4");
}
if(number == 5){
printf("5");
}
if(number == 6){
printf("0");
}
if(number == 7){
printf("7");
}
if(number == 8){
printf("8");
}
if(number == 9){
printf("9");
}
if(number == 10){
printf("10");
}
v
if(number == 11){
printf("11");
}
if(number == 12){
printf("12");
}
if(number == 13){
printf("13");
}
if(number == 14){
printf("14");
}
if(number == 15){
printf("15");
}
if(number == 16){
printf("16");
}
if(number == 17){
printf("17");
}
if(number == 18){
printf("18");
}
if(number == 19){
printf("19");
}
if(number == 20){
printf("20");
}
else {
printf("Please enter smaller numbers");
}
}

It only works for small numbers.
>>
>>59509864
...
if(number == 0){
printf("0");
} if(number == 1){
printf("1");
} if(number == 2){
printf("2");
...


This is only logical way
>>
>>59509938
But by putting declarations in front of ending brackets can stress the compiler and generate a stack overflow.
>>
Latter in C#, former in anything else
>>
>>59509959
The hell did you read that from?
>>
>>59510097
It's true. There are other things. If after a declaration you put a space between the end of the declaration and the ; it causes a infinite loop.
int var ;

What happens here is that the compiler is stuck at the space character trying to read the semi-colon, and since it never read it, it's stuck.
>>
File: compiling.gif (3MB, 460x306px) Image search: [Google]
compiling.gif
3MB, 460x306px
>>59505900
Neither, both are syntactically invalid.
>>
File: 1459350637009.jpg (17KB, 404x345px) Image search: [Google]
1459350637009.jpg
17KB, 404x345px
>>59505900
>
System.out.println
>>
this is the only way

void function test(int argument)
{
if (!argument)
doThis();
else
doThat();

if (otherCondition()) {
doThisAswell();
DoThisNotAswell();
} else {
dontDoThis();
}
}
>>
>>59505900
if(1)
printf("true")
>>
>>59505900
>no space outside parentheses
Reported.
>>
>>59505900
if(true) System.out.println("true");
>>
 System.out.println("true") 
>>
>>59507963
>
compareTo


Shouldn't you be overriding equals, instead of compareTo in that case?
>>
>>59509864
In this case I would use:

switch( number )
{
case 1: printf("1"); break;
case 2: printf("2"); break;
...
case 20: printf("20") break;
default: printf("Please enter smaller numbers"); break;
}
Thread posts: 48
Thread images: 7


[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.