#reflections on jargon
1 messages · Page 1 of 1 (latest)
Jargon doesn’t come into existence in a vacuum. There’s always a specific need for it: distinct concepts that need to be differentiated. It may stick around after the need for it has passed, but it always starts from a potential for confusion.
See the discussion just had about differentiating train and locomotive
One of the ones that bothers me from time to time is "argument" vs "parameter" vs whatever other names, in the context of trying to indicate to someone "that stuff after the function name". Similarly, it might be important to distinguish a function declaration, prototype, definition, and call.
WDYM by "function prototype"? Value?
that only means something to me because of JS's prototypal inheritance chain
That's my association too, though IDK what it would mean like that.
In C and maybe C++, one can declare the name/symbol whatever and the return value. The prototype is with the parameter types (for type-checking. a name for the parameter is thrown away), definition is what the function actually goes and does, and call is (of course) using it.
This one might be better: https://stackoverflow.com/questions/43781565/declaration-and-prototype-difference
so... a signature?
That must be something new. Never seen it called that.
A prototype and type signature look to be the same (except C doesn't do overloading).
It's in the C89 draft 🤷. If the declarator includes a parameter type list, the list also specifies the types of all the parameters; such a declarator also serves as a function prototype for later calls to the same function in the same translation unit.
enjoy jargon
Prototype just seems like one of those words that means more or less the same thing everywhere it shows up
like, it's always in the vein of "This thing exemplifies X, all X have the same kinds of attributes"
It's Greek. Edit: Sorry can't find a good reference, but πρωτότυπος )
@limber patio If it's in the function definition, it's a parameter (sometimes called a "formal argument" or "formal parameter"). If it's in the function call site, it's an argument (sometimes called an "actual argument" or "actual parameter").
Combined in a sentence: "Here we call square() with an argument of 2 for the parameter x."
I'm the one who brought it up here, what makes you think I wouldn't know?
Because you used the term "bothers me," which I read as "confuses me."
No, bothers me. I want to tell someone that thing is wrong/incomplete/etc, and argument is easier than parameter
Argument's more commonly a word I would expect someone to have seen or have used [in the programming context], too
Fixed some grammar, nothing else.^
Yes, sometimes people call both an argument. I don't think it's that big of a deal as long as the meaning is clear.
And then there are different way to phrase things. Compare "function has two parameters" with "function takes two arguments". Both correct usage of the respective word, both mean the same.