'method' vs. 'message' vs. 'function' vs. '???'

后端 未结 11 949
北荒
北荒 2020-12-24 12:59

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\

11条回答
  •  粉色の甜心
    2020-12-24 13:36

    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.

提交回复
热议问题