After a recent discussion as to the correct terminology to use when referring to code written in CFCs I've decided to share my opinion so people have a general idea as to what is meant when someone is referring a function or a method in its simplest sense.
- A function is a piece of reuseable code that is called by name. It can be passed data to operate on (arguments / parameters) and can optionally return a result.
- A method (also known as a property method) is a piece of code that is called by name that is associated with an object. A method is almost identical to a function but it's purpose is generally to operate on the data contained within the component (class).
Likewise, in ColdFusion, you could probably say that UDFs (User defined functions) and the standard built in functions provided by ColdFusion are "functions" and the functions within CFCs are methods.
I'm sure people have their own opions on this but in general that's how I like to refer to functions or methods.