So I was musing the other day on the idea of 'fluent interfaces'. The purpose of a fluent interface is to make it easy to write a line of code that accomplishes a sequence of related tasks, usually by allowing you to chain together a series of method calls on the same object. Often, discussion of such interfaces is muddied by specious claims that the resulting code 'reads just like English', or that such an API constitutes a domain-specific-language, or DSL - even terminology god Martin Fowler says "in many ways the two terms are synonyms". But then it usually degenerates into...
The most viewed blog post I've written by far is Don't use GetType() with Page.ClientScript.RegisterClientScriptBlock(). It's attracted a few comments, so it seems ripe for a followup post. Commenter Sander asked "Page.ClientScript.IsClientScriptBlockRegistered()comes with two overloaded variants. One is without type and other is with type. Any idea how this IsClientScriptBlockRegistered(key) cheks if script is registered?" Good question - easily resolved with Lutz Roeder's invaluable Reflector (although if you're squeamish about license conditions regarding decompilation of .NET assemblies - or you work on the Mono codebase - you may want to look away now). The overload of IsClientScriptBlockRegistered without a Type parameter calls the other...