Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lambda Louge 03/2012

Lambda Louge 03/2012

Avatar for Tod Karpinski

Tod Karpinski

March 22, 2012
Tweet

Other Decks in Programming

Transcript

  1. whoami •  Developer @ DyKnow •  Primarily C# / SQL

    / MVC •  Integrating ObjectiveC, iOS, JS and nodejs into our stack •  Currently working on: •  MVC3 API, nodejs file converter, iPad dev
  2. LINQ •  Language Intergrated Query •  LINQ is a MS

    originated technology introduced in 2007 with .NET 3.5 •  Available in C#/VB, 3rd Party libraries available for JavaScript, Java. •  Influenced by Haskell/SQL •  introduced Lambdas/Anonymous types and more functional concepts to the .NET world. •  IEnumerable vs IQueriable (Rx) •  Lots of Implementations o  Linq to Objects (tonight) o  Linq2SQL/ Entity Framework o  Parallel LINQ (.NET 4.0)
  3. Why LINQ • More Concise Enumeration (Where vs foreach) • Adds a

    bit of functional love to your day (especially if you’re stuck in VB.NET) • Libraries allow you to utilize your knowledge in other platforms. • Microsoft has built a compelling platform within the .NET stack.
  4. Multiple ways to write your 'Where' var  x  =  new

     List<string>   {  "x","y","z"};   var  z  =  x.Where(f  =>  f  !=  "x");   var  y  =  from  f  in  x  where  f  !=  "x"   select  f;
  5. Works in VB (ew) Dim  lString  As  List(Of  String)  =

     New   List(Of  String)  From  {"x",  "y",  "z"}   Dim  result  =  From  f  In  lString  Select  f   Where  f  <>  "x“   Dim  result  =  lString.Where(Function(name)   name  <>  "x")
  6. Lots of Keywords • Select,  Where,  SelectMany,  Sum/Min/ Max/Average,  Aggregate,  Join/

    GroupJoin,  Take/TakeWhile,  Skip/ SkipWhile,  OfType,  Concat,  OrderBy/ ThenBy,  Reverse,  GroupBy,  Distinct,   Union/Intersect/Except,   SequenceEqual,  First/ FirstOrDefault  /  Last/LastOrDefault,   Single,  ElementAt,  Any/All/Contains,   Count  
  7. C9 IDE • Editor for NodeJS (and other code) • IDE with

    attached debugger all within browser • Can Clone github repos, public is free, private is pay