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

Which is the better implementation?

Name: Anonymous 2014-09-05 19:47

int main()
{
printf("5+6=%d", 5+6);
return 0;
}


Or

////////////////////////////////////////
// AddNumbers
// param1 firstParam - The first value to add
// param2 secondParam - The second value to add
// return - The firstParam added to the secondParam
//
int addNumbers( int firstParam,
int secondParam )
{
// Here is some info
int theReturn = firstParam + secondParam;

// Now return the value
return theReturn;
}

// Entry for program
int main()
{
// Initialize variables
int firstParam = 5;
int secondParam = 6;

// Call the function
int returnValue = AddNumbers( firstParam, secondParam );

// Print out the value
printf("%d+%d=%d", firstParam, secondParam, returnValue );

return 0;
}

Name: Anonymous 2014-09-05 22:13

>>1
Nice biased examples, faggot.

First one is immediately comprehensible, the second one is way too complex to be understood by just glancing at it. The converse would be true with different cases.

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