Book description
LINQ draws on principles of functional programming and represents a paradigm shift for developers used to an imperative/object oriented programming style. Thinking in LINQ explains the benefits of functional programming built into LINQ, allowing developers to use these techniques write more efficient and concise data-intensive applications.
While other books on the subject merely scratch the surface in terms of problem solving using LINQ, Thinking in LINQ shows readers how use functional programming techniques to solve common every-day problems as well as more complex problems using LINQ’s features.
LINQ lets you write code that resembles natural language and is easier to debug compared to traditional loops and branching statements. The purpose of a well written LINQ Query will be immediately evident unlike the looping construct so commonly used in traditional programming. LINQ operators can be used in unison to orchestrate a solution for complex real world problems.
Table of contents
- Cover
- Title
- Copyright
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
- Chapter 1: Thinking Functionally
-
Chapter 2: Series Generation
- 2-1. Math and Statistics: Finding the Dot Product of Two Vectors
- 2-2. Math and Statistics: Generating Pythagorean Triples
- 2-3. Math and Statistics: Finding a Weighted Sum
- 2-4. Math and Statistics: Finding the Percentile for Each Element in an Array of Numbers
- 2-5. Math and Statistics: Finding the Dominator in an Array
- 2-6. Math and Statistics: Finding the Minimum Number of Currency Bills Required for a Given Amount
- 2-7. Math and Statistics: Finding Moving Averages
- 2-8. Math and Statistics: Finding a Cumulative Sum
- 2-9. Recursive Series and Patterns: Generating Recursive Structures by Using L-System Grammar
- 2-10. Recursive Series and Patterns Step-by-Step Growth of Algae
- 2-11. Recursive Series and Patterns: Generating Logo Commands to Draw a Koch Curve
- 2-12. Recursive Series and Patterns: Generating Logo Commands to Draw a Sierpinski Triangle
- 2-13. Recursive Series and Patterns: Generating Fibonacci Numbers Nonrecursively (Much Faster)
- 2-14. Recursive Series and Patterns: Generating Permutations
- 2-15. Recursive Series and Patterns: Generating a Power Set of a Given Set
- 2-16. Collections: Picking Every n th Element
- 2-17. Collections: Finding the Larger or Smaller of Several Sequences at Each Index
- 2-18. Number Theory: Generating Armstrong Numbers and Similar Number Sequences
- 2-19. Number Theory: Generating Pascal’s Triangle Nonrecursively
- 2-20. Game Design: Finding All Winning Paths in an Arbitrary Tic-Tac-Toe Board
- 2-21. Series in Game Design: Solving Go Figure
- 2-22. Miscellaneous Series: Finding Matching Pairs from Two Unsorted Collections
- 2-23. Miscellaneous Series: Using a Lookup-Based Approach
- 2-24. Miscellaneous Series: Solving the FizzBuzz Challenge in a LINQ One-Liner
- 2-25. Miscellaneous Series: Solving the FizzBuzz Challenge by Using Set Theory
- Summary
-
Chapter 3: Text Processing
- 3-1. Simulating a T9 Word Suggestion
- 3-2. Simulating a Gesture Keyboard
- 3-3. Cloning Peter Norvig’s Spelling-Correction Algorithm
- 3-4. Reversing a Sentence Word by Word
- 3-5. Creating a Word Triangle
- 3-6. Finding Anagrams
- 3-7. Checking for Anagrams Without Sorting Characters
- 3-8. Creating a Rudimentary Programming Language Identifier and Automatic Syntax Highlighter
- 3-9. Creating a Word-Ladder Solver
- 3-10. Formatting on the Fly
- 3-11. Solving Eric Lippert’s Comma-Quibbling Problem
- 3-12. Generating Random Serials
- 3-13. Generating All Substrings of a Given String
- 3-14. Creating a Scrabble Cheater
- 3-15. Finding All the Subsequences of a Given String
- 3-16. Squeezing a Paragraph to Fill Tightly
- 3-17. Printing the Lines of a Song
- 3-18. Mining Abbreviations and Full Forms from News Articles
- Summary
-
Chapter 4: Refactoring with LINQ
- 4-1. Replacing Loops by Using LINQ Operators
- 4-2. The Any Operator
- 4-3. The All Operator
- 4-4. The Take Operator
- 4-5. The Skip Operator
- 4-6. The TakeWhile Operator
- 4-7. The SkipWhile Operator
- 4-8. The Where Operator
- 4-9. The Zip Operator
- 4-10. OrderBy and OrderByDescending Operators
- 4-11. The Distinct Operator
- 4-12. The Union Operator
- 4-13. The Intersect Operator
- 4-14. The Except Operator
- 4-15. The Concat Operator
- 4-16. The SequenceEqual Operator
- 4-17. The Of Type Operator
- 4-18. The Cast Operator
- 4-19. The Aggregate Operator
- 4-20. Replacing Nested Loops
- 4-21. Running Code in Parallel Using AsParallel( ) and AsOrdered( ) Operators
- Summary
-
Chapter 5: Refactoring with MoreLINQ
- 5-1. Getting MoreLINQ
- 5-2. Using the Scan Operator
- 5-3. Using the Slice Operator
- 5-4. Using the Interleave Operator
- 5-5. Using the Windowed Operator
- 5-6. Using the Cartesian Operator
- 5-7. Using the Partition Operator
- 5-8. Using the Index Operator
- 5-9. Using the PairWise Operator
- 5-10. The ForEach Operator
- 5-11. Using the MinBy/MaxBy Operator
- Summary
- Chapter 6: Creating Domain-Specific Languages
-
Chapter 7: Static Code Analysis
- 7-1. Finding Verbose Type Names in the .NET 3.5 Framework
- 7-2. Finding the Number of Overloads for a Method
- 7-3. Finding the Size of a Namespace
- 7-4. Finding the Code-to-Comment (C# Style) Ratio
- 7-5. Finding the Size of Types
- 7-6. Generating Documentation Automatically
- 7-7. Finding Inheritance Relationships
- 7-8. Locating Complex Methods
- Summary
- Chapter 8: Exploratory Data Analysis
-
Chapter 9: Interacting with the File System
- 9-1. Comparing Two CSV Files
- 9-2. Finding the Total File Size in a Directory
- 9-3. Cloning LINUX Head and Tail Commands
- 9-4. Locating Files with the Same Name (Possible Duplicates)
- 9-5. Finding Exact-Duplicate Files
- 9-6. Organizing Downloads Automatically
- 9-7. Finding Files Modified Last Week
- 9-8. Locating Dead Files (Files with Zero Bytes)
- Appendix A: Lean LINQ Tips
- Appendix B: Taming Streaming Data with Rx.NET
- Index
Product information
- Title: Thinking in LINQ: Harnessing the power of functional programing in .NET applications
- Author(s):
- Release date: December 2014
- Publisher(s): Apress
- ISBN: 9781430268444
You might also like
book
Functional Programming with C#
After decades of relative obscurity, functional programming is finally coming into its own. With concise, easy-to-read …
book
Design Patterns in .NET Core 3: Reusable Approaches in C# and F# for Object-Oriented Software Design
Implement design patterns in .NET Core 3 using the latest versions of the C# and F# …
book
Functional Programming in C#, Second Edition
Real world examples and practical techniques for functional programming in C# without the jargon and theory. …
book
Hands-On Object-Oriented Programming with C#
Enhance your programming skills by learning the intricacies of object oriented programming in C# 8 Key …