That’s basically asking whether left-wing or right-wing or middle is better politics.
Whether Apple’s taste better than oranges, better than manderines…
Everyone has his own opinion and there’s no definite correct answer.
The compiler doesn’t care, so you get to choose yourself.
My opinion:
-
If at all (normally i put functions in a different file or namespace, because i don’t like globally available functions) I put them after the main, because the main dictates in what order/context which function is executed.
-
This way any reader always reads the main first, and can look up the function definitions in the order they are supposed to be executed, which makes understanding a lot easier. (I suggest starting by reading the main-function anyways, unless you want to read random function definitions, with no context to put them in)