XPath is (almost) Perfection
A good friend of mine has recently been educating me on the advantages of Functional Programming. As part of that, he has demonstrated some pretty nifty examples of LINQ in C#. When I first heard about LINQ, I wasn't impressed. Having seen his examples of using LINQ for Functional Programming, however, I now see the advantage.
The consequence of this is that I now find it ugly to have to do loops just to get a subset of data. I want to just be able to describe the data that I want.
<cfset aFields = XmlSearch(xData,"//field/relation[@onDelete='Error' or @ondelete='Error']/..")>
Right, except then I have this sort of mess in every XmlSearch statement:
<cfset aFields = XmlSearch(xData,"//field/relation[@onDelete='Error' or @ondelete='Error' or @ONDELETE='Error' OR @ONdelete = 'Error' or @onDELETE = 'Error' ]/..")>
Yeah, I could write a UDF to make my XPath statement, but at that point, my code is uglier than if I just wrote a loop to begin with.