In Unix C programming, is it considered good practice to explicitly close file handles before the process exits, or is it instead good practice to let the OS close the file handles and thus avoid unnecessary code?
Which of the two would generally be considered as the preferred alternative?
Example:
int main (int argc, char* argv[])
{
int sd;
sd = socket(...);
// Snip
close(sd); // Good or bad practice?
return 0;
}