He didn't need to escape them in that example. But, he's a nerd (we can smell our own), and he probably just escapes parens by default if they're intended to be literals.
Media Center's Expression Language treats all characters as literals unless they are part of a
recognized function or field. For example, if you have no valid field in the Library defined as [My Custom Field #418], and you enter that in an expression, MC will treat it as literal.
So
=FixCase([My Custom Field #418], 4) results in
[my custom field #418] (square brackets and all). Only if that field actually exists do you have to escape the brackets if you want them. Otherwise the string passes through unscathed.
You can use non-escaped parenthesis with reckless abandon in MC,
unless they are intended to be literals within an expression function. Say, instead, you wanted to Title Case the string:
MrC is a (big) nerd but so am iIf you put that in a FixCase() function without being careful, it'd be:
=FixCase(MrC is a (big) nerd but so am i)In this case, the expression engine gets a bit confused and outputs:
Mrc Is a (Big nerd but so am i)That's because it interprets the expression from left to right looking for a closing parenthesis, and so the closing parenthesis "big)" becomes the end of the function (and then outputs the rest as a string literal).
If on the other hand, the source text was:
MrC is a big nerd (but so am i)You put that in a FixCase() function without being careful, it'd be:
=FixCase(MrC is a big nerd (but so am i))And that works fine (except for messing up MrC, of course). But that isn't because MC's expression engine stops evaluating from left to right, and instead searches for parenthesis from outside-in. No, the first of the double
)) pair still closes the function in this case. The second just becomes the literal parenthesis, and since that matches the desired output, it "works".
All of which is to say that MrC has just decided, being a big nerd, that it is "safer" to essentially always escape literal parenthesis. I think it is likely because to do otherwise would gently needle something deep down inside, violate unspoken symmetries, and just generally disturb the order of things. Plus he's a Perl programmer, and used to all sorts of crazy escaping and bizarre use of punctuation that to a normal human makes things, you know, hard to read.*
I don't, because I'm lazy, and I like to live dangerously.
* As John Siracusa said in a recent (and awesome) episode of Debug: "Well, that backslash is in front of them. I mean, \n, you know... It's not an 'N' it's a Special N." (Around the 1:11:00 mark.)