if (condition == true)
If (condition == true)
int main()
why
condition is nullable. I personally prefer
if( condition ?: false)
But intelliJ bitches at me when I do that.
Nullable booleans are niggerlicious
static void main(String[] args)
Dont have that shit in C
let status = false;
switch (condition === true ? true : false) {
case true:
true ? (status = true) : (status = false);
break;
case false:
return false ? (status = true) : (status = false);
break;
}
if (status === true && typeof status === 'boolean') {
// do stuff
}
I'm lazy so I do
if(nullableThing?.run{ isThingGood(this)} ?: false)
Instead of
if( nullableThing != null && isThingGood(nullableThing))
Especially when I'm SO lazy that I'm using mutableNullableThing
What does passing a function in c to an if statement do? And why does it branch as if was true?
In C, if var is a primitive data type, passing it to if essentially does this
if(var!=0)
C treats all basic variables as numbers like god intended.
But what does that even mean?
What do you mean "passing a function"?
A function pointer or calling a function?
The former is just an int and the latter uses the return value.
If condition is not 0, it's true in C.
It means that all bits in var are not zero
>in this ITT bottom of the barrel students making fun of bottom of the barrel indians
>>in this ITT
wut
It's everyone's duty to make fun of the bottom of the barrel, from students to vetted engineers.
> ITT brainlets can't into memory
For example
int main(){
return main ? 1 : 0;
}
It returns true because main points to a function located at an address other than 0.
What's wrong with that?
Being explicit is good practice
Maybe this helps too.
repl.it
brevity is the soul of wit
what does referencing main give me?
no u
pretentious tripe
*dereferencing
a function call
if((condition == true && condition2 != false) || (condition3 == true && condition4 == false))
{
System.out.println("stop posting and think");
}
if (condition := true)
using python:
if faggotry == True:
shart()
else:
deletesystem32()
>System.out.println
> java
disgusting.
You are actually fucking stupid
caxapa.ru
if ( negatedVariableName != true )
>not just running both branches 100% of the time
lmao
>using signed int for an index
public class shit {
public static void main(String[] args) {
foobar(true, false);
}
public static void foobar(Boolean firstBooleanArgument, Boolean secondBooleanArgument) {
try {
if (firstBooleanArgument.equals(new Boolean(true)) && secondBooleanArgument.equals(new Boolean(false))) {
System.out.println("foobar");
}
} catch (NullPointerException e) {
// Handle error
System.err.println(e);
}
}
}
What thefuck
sizeof(*main)*CHAR_BIT
sizeof(&main)*CHAR_BIT
sizeof(main)*CHAR_BIT
sizeof(int)*CHAR_BIT
I get 8, 64, 8, 32
So is *main == main? an 8bit pointer holding a 64bit address?
That's another pet peeve of mine, I think data should be unsigned by default, because unless I'm actually doing math I never use signed.
1) Not every language implicitly converts numeric values into boolean values (VHDL for example)
2) "if (true == cond)" and "if (false == cond)" are easier to differentiate then "if (cond)" and "if (!cond)" on a quick read-through.
Readable code attracts pajeets like ants to sugar.
stdio, you fucking retard
>triggered
I would agree. It’s too much voodoo.
How about
if condition
and
if not condition
Depending on the semantics, the name of a function may be implicitly converted to a pointer to the function, but not always.
>not using a BooleanFactory
disgusting
Yep, one thing that really ticks me off is when people return an explicit true or false when they could just return the evaluating statement itself
poobar
#define _DEFAULT_SOURCE
#include
#include
#include
#include
int
main(void)
{
const int incr = getpagesize();
size_t size = incr;
char *buf;
while ((buf = (char*) malloc(size))) {
for (uintptr_t i = 0; i < size; i += incr)
buf[i] = 0;
/* interesting side effect of writing one byte per page -- other bytes show weird patterns */
putchar(buf[size - 2]);
free(buf);
size += incr;
}
return EXIT_SUCCESS;
}
if condition:
... # :^)
fucking faggot
put that int back on the line