I recently asked a question about what I called ‘method calls’. The answer referred to ‘messages’. As a self-taught hobby programmer trying to phrase questions that don’t make me look like an idiot, I’m realizing that the terminology that I use reveals a lot about how I learned to program.
Is there a distinction between the various terms for methods/messages/etc. in OO programming? Is this a difference that comes from different programming languages using different terminology to describe similar concepts?
I seem to remember that in pre-OO languages, a distinction would sometimes be made between ‘subroutines’ and ‘functions’ based on whether a return value was expected, but even then, was this a language-by-language distinction?
I’ve found this to be a language and programming-paradigm thing. One paradigm — OOP — refers to objects with member methods, which conceptually are how you send messages to those objects (this view is reflected in UML, for example).
Another paradigm — functional — may or may not involve classes of objects, but functions are the atomic unit of work.
In structured programming, you had sub-routines (notice that the prefix ‘sub’ implies structure).
In imperative programming (which overlaps with structured quite a lot, but a slightly different way of looking at things), you have a more formulaic view of the world, and so ‘functions’ represent some operation (often mathematical).
All you have to do to not sound like a rube is to use the terminology used by the language reference for the language you’re using.