Welcome to MSDN Blogs Sign in | Join | Help
Conclusion

[Table of Contents]

First, if you finished the tutorial, I am very interested to know that you did.  I am also interested in how long it took you (in hours).  Please drop me a quick email at white.eric at microsoft.com.

In the end, I believe that programming in the FP style is useful and powerful.  When programming, it enables you to focus more on the problem domain, and focus less on the plumbing.

I think that in some circumstances, imperative code is more readable than FP code, so I am not (yet) an advocate of doing everything only in the FP style.

And as always, as my learning evolves, I'll certainly expose my learning process publically.

[Table of Contents]

 

Posted: Wednesday, October 04, 2006 5:38 AM by EricWhite

Comments

Vladekk said:

I read tutorial till parsing example part, don't have time for this now. I understood almost all of this before, but FP switch is something new to me, had to think on this one a bit.

# February 19, 2008 3:33 AM

UrosBizjak said:

Great tutorial. Some of the code is very advanced (at least for me), but you gave some great solutions to problems.

It gives me much better insight into this whole LINQ business.

Thank you.

# April 6, 2008 10:51 AM

Ryan Riley said:

Thanks for this tutorial, Eric. It's very clear and helpful. It took me about 8 hours total go straight through, copying and testing only select code segments. (I'm not certain as to the time, but that's about right; I was looking at some other links for further reference, too.)

The examples you gave were good, too, but I wonder why you would use fp techniques instead of an XSLT transformation since you're using OpenXML. I can certainly see some great benefits to this for generating object transformations.

# May 5, 2008 3:45 PM

EricWhite said:

Hi Ryan,

There are two types of XML transforms, generally speaking:  1) transform a document to some simpler form of XML, and 2) transform a document into a new document (a document centric transform).

For the first type of transform, my experience is that it is far easier to write the transform using LINQ to XML compared to XSLT.  I also find the code easier to read.  I think that this is only true for developers after getting some level of experience with LINQ.

And there is the issue of performance - some LINQ transforms might perform better than the same transform in XSLT.  There are a lot of reasons for this:

- XPath expressions are typically interpreted, whereas LINQ expressions are statically bound.

- no need to fire off a separate process in C# to do the transform.

But this by itself could be a dubious reason, as it is possible to write poorly coded transforms in either language.

For document centric transforms, XSLT works well; to use LINQ, you have to do something like the technique detailed here:  http://blogs.msdn.com/ericwhite/archive/2007/07/30/how-to-use-annotations-to-transform-linq-to-xml-trees-in-an-xslt-style.aspx

And that technique, while it would perform well, is a bit abstract.

Sometimes there is an advantage to staying within one language, C# 3.0, instead of coding using a hybrid approach.

I've written a pile of programs to extract data and text from Open XML documents, and I really enjoy using LINQ for those purposes.

You are right, for object transformations, LINQ rocks!

-Eric

# May 5, 2008 10:48 PM

Eric White's Blog said:

[Table of Contents] [Next Topic] The following code is attached to this page. using System; using System.Collections.Generic;

# August 29, 2008 7:32 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker