A colleague and I are working together on a Meteor app.
One of us thinks that the following code in two places should be wrapped in a function to avoid duplication -- the other thinks that it leads to needless indirection/complexity.
I won't tell you which is me, because I would like the answers to be unbiased :).
We disagree on this particular point and would like some help coming to a conclusion which is beneficial to our codebase.
One file has:
Email.send({
from: sender,
to: recipient,
subject: "Message from our company",
message: message
});
Another file has the same code:
Email.send({
from: sender,
to: recipient,
subject: "Message from our company",
message: message
});
Please be keep your comments respectful.
Question: Should this code be abstracted out into a function?
Clarification/Edit: The "Message from our company" is the same in both Email.send
calls.