Hacker News new | past | comments | ask | show | jobs | submit login

Well, if your example were meant seriously, it is needlessly verbose. ToList is not necessary in this context, and the type arguments to ToList and FirstOrDefault are not necessary since they can be inferred. And anyway, you can just insert line breaks if you think the chain is too long. So:

    grain.OfType<Salt>()
          .Where(m => m.Value.Contains(nothing))
          .OrderBy(m => m.irrelevance)
          .FirstOrDefault();
I don't really get your verbosity criticism, sine any alternative I can think of (eg. using for loops) is much more verbose.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: