Update to the Functional Programming Tutorial

[Blog Map]  This blog is inactive.  New blog: EricWhite.com/blog I just added a new topic in the Functional Programming Tutorial, Procedural Analogs. This introduces the Switch extension method, which you would use in certain circumstances. It is somewhat analogous to the C# switch statement, except that this extension method implementation of switch can be applied to every member of…


Procedural Analogs

[Blog Map]  This blog is inactive.  New blog: EricWhite.com/blog In the last topic, we showed an FP analog to a loop, the ForEach extension method. There are other analogs. We can do something similar to implement something analogous to the C# switch statement. To do this, we’ll write an extension method that takes as parameters, 1) a delegate that returns…


The FP Switch Pattern (used to implement the World’s Smallest RPN Processor)

[Blog Map]  This blog is inactive.  New blog: EricWhite.com/blog You can implement common procedural constructs in the Functional Programming (FP) style. For instance, the FP tutorial showed how to loop using a ForEach extension method. We can do something similar to implement something analogous to the C# switch statement. To do this, we’ll write an extension method that takes as parameters, 1)…


The Source Word Document

[Back to the Table of Contents]   This blog is inactive.  New blog: EricWhite.com/blog Attached to this page is the source word document that contains the paragraphs styled as Code, and the comments on those paragraphs. Next: Retrieving the Paragraphs CodeInDoc.xml


A Tutorial on Functional Programming using C# 3.0

[Blog Map]  This blog is inactive.  New blog: EricWhite.com/blog A couple of months ago, I wrote some code that used LINQ to XML to parse WordML files. It was interesting to do, and relatively easy. I posted it on this blog, and some other people here at MS used it for various purposes. Then it came to…


Translating Query Expressions to Dot Notation

[Blog Map]  This blog is inactive.  New blog: EricWhite.com/blog [Back to the Table of Contents]  This topic provides some hints and clues about how query expressions are translated into expressions using the dot notation. I haven’t written this topic yet. Expect it by the end of October. Next: Conclusion


Query Composition using Functional Programming Techniques in C# 3.0

Functional Programming (FP) has the potential to reduce program line count by 20% to 50%, reduce bugs and increase robustness, and move us in the direction of taking advantage of multiple core CPUs.  But perhaps due to the learning curve, and unfamiliarity, many developers are not taking advantage of the potential that LINQ and FP offers. This blog is…


Object and Collection Initializers

[Blog Map]  [Table of Contents]  [Next Topic] Object and collection initializers are a C# 3.0 feature that allows you to create objects and collections of objects in an expression context instead of in a statement context.  Sometimes this is called in-line initialization of objects. This blog is inactive.New blog: EricWhite.com/blog Blog TOCWhen doing FP, we…


Lazy Evaluation (and in contrast, Eager Evaluation)

[Blog Map]  [Table of Contents]  [Next Topic] One of the most important concepts in LINQ is the notion of lazy evaluation.  Without this facility, LINQ would perform very poorly. This blog is inactive.New blog: EricWhite.com/blog Blog TOCQuery expressions operate on some type that implements IEnumerable<T>.  The variable of type IEnumerable<T> on which the query expression…


The Yield Contextual Keyword

[Blog Map]  [Table of Contents]  [Next Topic] Yield Return is a means to more elegantly implement the plumbing for iteration.  Yield was introduced in C# 2.0, but my informal polling indicates that many developers don’t yet understand it.  It’s not hard, but it deserves some explanation. This blog is inactive.New blog: EricWhite.com/blog Blog TOCUse of…