Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 7
    Dont prohibit yourself from creating a function just because it will not be called from any other place. Functions can also be used to clean up the code (if you have a large procedure spanning several pages breaking it into functions makes it more readable) and self document (just naming a function properly can convey information to the reader.) Commented Mar 18, 2016 at 13:17
  • 22
    If you came here from Google and want to know how to how to emulate inline functions in c#, go here: stackoverflow.com/questions/473782/inline-functions-in-c The answers below don't pertain to "inline" functions in the true sense of the word, and c# doesn't even have true inline functions but the link above provides a compiler optimization that can be used. Commented Mar 9, 2018 at 16:56
  • Thanks James, the question title is rather misleading indeed. Commented May 11, 2018 at 12:45
  • 10
    If you came here from Google, and you don't want to dig -- just put this attribute: [MethodImpl(MethodImplOptions.AggressiveInlining)] Commented Jan 27, 2021 at 21:32