Why I Don’t Use the ForEach Extension Method

In my first version of my functional programming tutorial, I discussed a ForEach extension method, but I removed the topic from the second version.  This extension method iterates through a source collection and performs an action on each item in the collection.  ForEach isn’t included in the .NET base class library (BCL), but its implementation…


Ease of Maintenance of LINQ Code

I believe that it is easier to maintain code that is written in the functional style.  For one thing, this is the very reason for many of the characteristics of functional code.  No state is maintained, so we don’t have to worry about corrupting any state.  If a variable is in scope, then the variable…


Finding Paragraphs by Style Name or Content in an Open XML Word Processing Document

About a week ago, I posted a very interesting guest post by Bob McClellan, where he discussed some code that allows you to more easily move/insert/delete paragraphs in Open XML documents.  He is in the process of putting together a PowerShell cmdlet that demonstrates this functionality within the PowerTools for Open XML open source project….


Functional Programming Tutorial for Visual Basic 9.0

Visual Basic 9.0 added many language features that allow us to write in the functional style in a natural and expressive way.  The value of programming in the functional style has been apparent to me for some time.  VB developers can realize the benefits of functional programming, so I’ve written a tutorial for VB developers:…



Closures are one of the key components in C# 3.0 that makes functional programming easy, and results in clean syntax.  Yet, they are not really necessary to understand in order to write queries in the functional style.  Why?  Because closures make the language ‘just work’ exactly in the way that you expect.  I’ve made use…


Object Dumper: An Invaluable Tool for Writing Code in the Functional Programming Style

When developing C# programs in the functional programming style, you often need to dump out a collection to the console.  Object dumper is a great tool to use for this.  It is a sample that far too few developers know about. This blog is inactive.New blog: EricWhite.com/blogBlog TOCA functional transform typically takes the form of…


Are Developers Using LINQ? (Part 2)

The response to my previous blog post has been very interesting to me.  And it has, to a very large extent, matched my own experience. This blog is inactive.New blog: EricWhite.com/blogBlog TOCI have seen four basic scenarios where folks use LINQ: Using LINQ to Objects (and LINQ to XML, which is really just LINQ to…


Are Developers Using LINQ?

I had an interesting conversation with my nephew the other day.  He is a very bright CS student working as a summer intern at a software company (not Microsoft).  He is programming in C# using Visual Studio 2008.  I asked him if developers at his company were using LINQ, and he said, “No, that the…


Using Annotations to Transform LINQ to XML Trees in an XSLT Style (Improved Approach)

You can use LINQ to XML to transform XML trees with the same level of power and expressability as with XSLT, and in many cases more than with XSLT. This blog is inactive.New blog: EricWhite.com/blog Blog TOCOne of the reasons that XSL is so powerful is that you can write multiple rules to transform a node. …


Using the Open XML SDK

[Blog Map]  [Table of Contents]  [Next Topic] Open XML Packages To follow this tutorial, you don’t need to delve into all of the details of working with packages.  This topic presents a small chunk of code that you can use as boilerplate code – it opens a word document and retrieves the main part, the…