|
|
|
|
|
by minork
3587 days ago
|
|
I'm probably missing your point, but public static IList<Ephraimite> FindEphraimitesToKill(IList<Ephraimite> ephraimites)
{
var ephraimitesToKill = new List<Ephraimite>();
foreach (var ephraimite in ephraimites)
if (ephraimite.Speak("shibboleth") == "sibboleth")
ephraimitesToKill.Add(ephraimite);
return ephraimitesToKill;
}
or: public static IList<Ephraimite> FindEphraimitesToKill(IList<Ephraimite> ephraimites)
{
return ephraimites.Where(e => e.Speak("shibboleth") == "sibboleth").ToList()
}
is not that verbose. |
|
The C# style guide of a former employer of mine (an enterprise C# user) forbids both of these snippets because of the unbraced statements in the former and the LINQ and lambdas in the latter. But admittedly I don't know what's common among C# users, so maybe they were in the minority.