1

In all of my C labs, my professor, without fail, uses return(0); instead of (and correct me if I'm wrong) the preferred return 0;. Shouldn't a C professor know good programming style?

I wonder this because my C textbook (Problem Solving and Program Design in C) also uses this format. It also puts a newline between int and main(), which I find a bit odd.

Could it simply be that older versions of C used this format and she (as well as the book) never adapted? Or is this just downright bad programming style? Or am I completely off base here?

joce
  • 9,624
  • 19
  • 56
  • 74
Marcus McLean
  • 1,306
  • 2
  • 13
  • 24

1 Answers1

3

This is purely a style choice, and user preference. There isn't a real reason to prefer one style over the other.

Granted, I prefer return 0; and not using extra newlines, but there is no technical advantage or disadvantage to either style. I would hesitate to call one style "good" and the other "bad".

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373