Terminology – function definition, function

Is there a distinction between a function definition (not a declaration) and a function?
For me a function definition, is what gets defined by the programmer in the source code while the function it self is what we get after compilation.
Is that a valid distinction?

1

Sure, there’s a difference between a function and a function definition, otherwise we wouldn’t bother having both terms. Function isn’t just an abbreviation of function definition, they’re separate terms that are used in different contexts.

For instance:

The function definition for readInput() starts on line 34.

But:

Input data are retrieved by the readInput() function.

It would be simply wrong to use function definition here. The function definition has a certain number of tokens, occurs at a specific place in the program and an be pointed out in a program listing. The function has a specific purpose, is active at specific times, and can be pointed out in a call stack or a memory segment.

2

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *