Friday, March 10, 2017

The second to last talk I saw yesterday at MVPMIX was Barry S. Stahl on using a DSL to make queries more readable.

You may kinda see what he thinks is a bad query at the upper right of this photo:

Alright, in his case he is slurping in stuff from StackOverflow and posts which have no parents themselves are themselves the standalone questions and not the commentary associated with the questions. With that in mind, would this:

whatever.Where(x => x.ParentId == null)

 
 

...be more readable like this...

whatever.Questions()

 
 

I'm paraphrasing what he had a little bit. How do you make this happen? With extension methods of course.

No comments:

Post a Comment