In Obj-C, what’s the best practice for function prototype ? Should I include them for every function in my class or just the one that’s needed (i.e a function call happens before a function implementation)
In Obj-C, what’s the best practice for function prototype ? Should I include them
Share
Generally speaking, there is no need to forward declare private functions and methods unless the compiler requires it. I can think of no practical benefit to forward declaring proactively. Even for internal documentation purposes, it is better to put the documentation close to the function rather than all at the top of the file.
Of course you have to declare public methods and functions in the header, and you should document them there as well. But that’s a separate issue.