I’m curious to know what the programmers here think of prototyping functions. It was how I was trained to write C and C++, formally, but I also agree with the reasoning of it.
Since program execution starts in
main(), it should be the first function you see, yeah? If you have your functions declared and written, it would take quite some time to scroll through the file to find the main function and see what’s going on.
However, as I’m starting to look at C and C++ code in the wild and written professionally, my professor and I seem to be in the minority. Is my anecdote wrong, and I’m just a newbie that hasn’t gotten in the trenches with these beautiful languages yet? Or is prototyping a beginning tactic?
What do you think? Do you prototype functions? Why or why not?