Question by
MuffinMan101010 · Jul 19, 2016 at 02:39 PM ·
c#scriptingbasicsfunctions
Where to make a function in a script.
Where would i make my function so i can use it later on. Does it matter? Should I do it when i declare my variables? All people I've seen do it at the bottom of their scripts. Where would i make a function?
Comment
Best Answer
Answer by rmassanet · Jul 19, 2016 at 02:58 PM
Short answer: It doesn't really matter.
For readability purposes, you should declare it so that you can easily read your program from top to bottom. So if function A
uses function B
, then B
should be declared after A
.
Another convention is that variables should be declared first, and then methods.
But it is all a matter of personal preferences. Take a look at this link:
**https://msdn.microsoft.com/en-us/library/ff926074.aspx**
For some standard c# code conventions.