Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What stirs your rage, /prog/?

Name: Anonymous 2013-09-14 1:07

Mine are people who do this on C-like languages:
if(numbers==NULL)
{
numbers=temp;
numbers->next=NULL;
}
else
{
temp2=numbers;
while(temp2!=NULL)
{
var=temp2;
temp2=temp2->next;
}
temp2=temp;
var->next=temp2;
temp2->next=NULL;
}


No spaces between operators.
Opening brace on lines by themselve.
Else statement not a continuation of the if-statement it belongs to
Terse variable.
camelCase

Name: Anonymous 2016-10-26 8:46

>>120 Actually that is correct, since the convention of 0/!0 being boolean-convertible is due weak type safety of C/C++

Name: Anonymous 2016-10-26 8:58

>>121
so what? that's how those languages work so why not use it? not everything has to be haskall

Name: Cudder !cXCudderUE 2016-10-26 10:46

>>121
It's correct in the same way that if(x==true==true==true) is 'correct' in lesser languages like Java. It doesn't make it any easier to understand and just causes confusion.

Everything has a natural booleanness. It makes code simpler.

Try doing this in a lesser language, for example:
int numopts = !!(opts&OPT_A) + !!(opts&OPT_B) + !!(opts&OPT_C) + !!(opts&OPT_C);
if(numopts > 2)
printf("More than two options selected\n");

Name: Anonymous 2016-10-26 11:10

>>123
Measuring options that can be mutually exclusive by number, instead of using a state machine

Name: Anonymous 2016-10-26 13:16

>>123
is 'correct' in lesser languages like Java
Doesn't that work in C as well (assuming true is defined)?

Name: Anonymous 2016-10-26 18:28

>>123
Everything has a natural booleanness. It makes code simpler.
C stole that from LISP.

Name: Anonymous 2016-10-27 1:25

Everything has a natural booleanness. It makes code simpler.

This is what weak typers actually believe

Name: Anonymous 2016-10-28 19:32

>>126
except it works differently in those two languages. in C, true is non-zero. in Lisp, true is non-empty.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List