Is it ok to have an argument type of IEnumerable? [on hold]
$begingroup$
I've seen tutorials of Unit Testing and I've never seen IEnumerable<T>
as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.
However, my signature of method looks like this:
private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions,
IEnumerable<Answer> possibleAnswers)
{
...
}
Is it okay? Is it a code smell to have collections as arguments?
c#
$endgroup$
put on hold as off-topic by Malachi♦ 8 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
$begingroup$
I've seen tutorials of Unit Testing and I've never seen IEnumerable<T>
as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.
However, my signature of method looks like this:
private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions,
IEnumerable<Answer> possibleAnswers)
{
...
}
Is it okay? Is it a code smell to have collections as arguments?
c#
$endgroup$
put on hold as off-topic by Malachi♦ 8 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi
If this question can be reworded to fit the rules in the help center, please edit the question.
$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi♦
8 hours ago
add a comment |
$begingroup$
I've seen tutorials of Unit Testing and I've never seen IEnumerable<T>
as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.
However, my signature of method looks like this:
private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions,
IEnumerable<Answer> possibleAnswers)
{
...
}
Is it okay? Is it a code smell to have collections as arguments?
c#
$endgroup$
I've seen tutorials of Unit Testing and I've never seen IEnumerable<T>
as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.
However, my signature of method looks like this:
private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions,
IEnumerable<Answer> possibleAnswers)
{
...
}
Is it okay? Is it a code smell to have collections as arguments?
c#
c#
asked 8 hours ago
StepUpStepUp
251310
251310
put on hold as off-topic by Malachi♦ 8 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by Malachi♦ 8 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi
If this question can be reworded to fit the rules in the help center, please edit the question.
$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi♦
8 hours ago
add a comment |
$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi♦
8 hours ago
$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi♦
8 hours ago
$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi♦
8 hours ago
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi♦
8 hours ago