In D I can create templates like this:
template Foo(A) {
A add(A a, A b) { ... }
A multiply(A a, A b) { ... }
A concatenate(A a, A b) { ... }
}
What should a template be named ideally? What conventions exist out there? I’m looking to something similar like ‘function names must always start with a verb’.
5
In your case, I would use a name that refers to the collection of functions that you have. For example:
template Operations(A) { ...
If you hadn’t mentioned concatenate
, then I would have suggested ArithmeticOperations
for example.
3