2 ms·
> Declaring code defines subprograms Absolutely not. No points awarded. Declaring code declares subprograms. They are defined by the implementation. > A decl
by tantalor 6y ago
> Declaring code defines subprograms
Absolutely not. No points awarded.
Declaring code declares subprograms. They are defined by the implementation.
> A declaration provides basic attributes of a symbol: its type and its name. A definition provides all of the details of that symbol--if it's a function, what it does; if it's a class, what fields and methods it has; if it's a variable, where that variable is stored.
https://www.cprogramming.com/declare_vs_define.html https://www.cprogramming.com/declare_vs_define.html
> the purpose of declaring code is to connect pre-existing method calls to implementing code
That sounds mostly right to me. Without declarations, the compiler cannot connect the function call to the implementation. Thomas ignores a crucial idea that decoupling definition & declaration enables multiple implementations for the same declaration.
> Declaring code creates the method calls.
That's nonsense. I have no idea what this means.
- pseudo0 6y ago"Declaring code" is a specific term of art used in this case. For an example of what they consider declaring code vs. implementation code, see page 38 of the decision which has a handy diagram and example. > That's nonsense. I have no idea what this means. He's referring to how the workflow for an API generally involves gathering requirements, writing the "defining code", and then finally implementing the functionality promised by the interface. From that perspective, the defining code determines what implementation code is created, rather than linking up already existing implementation code.