C# C# Basics (Retired) Prepare and Plan Program Structure

Justin Ryndak
Justin Ryndak
5,134 Points

Why Method instead of calling them functions?

Is their something deeper to this reason for calling them methods or is terminology just specific to C#?

2 Answers

Jennifer Nordell
STAFF
Jennifer Nordell
Treehouse Staff

Hi there, Justin Ryndak ! This is a great question and something that trips up many. Just as all thumbs are fingers, but not all fingers are thumbs, all methods are functions, but not all functions are methods. A "method" is a function that is defined on a object as opposed to a sort of free-floating function. This is true for object-oriented languages of all types and is not specific to C#. This is something you will likely hear and see many times over and people tend to use them a bit interchangeably although they are not necessarily interchangeable.

All methods are functions. The only difference is semantics. They are functions attached to an object.

Hope this helps! :sparkles:

Justin Ryndak
Justin Ryndak
5,134 Points

This definitely helps! Thanks so much!