C

C
>false is 0
>true is non-0
Unix shell
>true is 0
>false is not 0
why is unix shell so retarded?

0 being true or false is annoying in JS.

actually, I just mean 0 being false.

Something to do with programs returning error codes I guess.
Problem? No(0), Yes(not 0).

>not understanding c is evaluating booleans while shell is evaluating return codes where only one code can denote a succesful operation

ishygddt

I agree js is shit but what you posted is just plain retarded

>why is OP so retarded?
ftfy
delete your thread

If you set true to 0 and false to anything else, your program can return the exact problem with your program (1 = file not found, 2 = not enough permissions, -1 = no args passed etc...).

/thread

I love C, sh, and csh.
This. Also, please don't use negative return numbers. -1 often will equal 255, so just say 255

it's idiomatic to return 0 on success and -ENOENT.. on failure in C programs as well

>return false on failure
>return non-zero error code on failure
>Both functions return int so there's no way to tell

It was invented by unix programmers. Hope that answers your question.

This. Are you one of those regards that prints out error messages and then exit(0)s?

...

stop bumping the thread you retard

make me

ok sure

0 for exit status isn't true, it's success, both for commands (shell) and core Unix APIs.

return EXIT_SUCCESS;

yeh okay, i'll stop

>java
>false is false
>true is true
>0 and 1 are integers
>no assignment allowed inside test conditions because an assignment doesn't return a boolean
Superior design, it just makes sense

>have to use language with retarded boolean rules
>make up your own type with no BS
>???
>profit

It's not hard guys.

you could use _Bool, but none of the standard library does.

fuck java

Holy fuck that's dumb

>java
>do some blackmagic
>2+2==5 is true
great language

Front enders are subhuman

It's so you can use && and || on the command line to short circuit evaluation dipshit!

>>java
>>no assignment allowed inside test conditions
factually incorrect