January 2008 - Posts
Most projects use "Warnings as Errors" project-level setting together with the "XML documentation file" so that you can spot early on which areas of your public APIs are not documented or have broken links etc. in it. I've come to rely on it, especially in the face of refactoring, which even in VS2008 still doesn't refactor code documentation references.
If the refactoring engine can't fix documentation references for me, I want to get compilation errors at least.
Turns out that unlike the paramref and typeparam tags, typeparamref is not validated and will NOT issue warnings when it's out of sync with your codebase (i.e. you renamed a type parameter from a function or type)....
Read full article
Inspired by Pipelines Using Fibers in Ruby 1.9, I set to explore what could be done with C# 3.0 in the same area. I'll also follow that article's overall structure.
Building a pipeline is all about chaining together simple reusable commands so that the output of one is the input of the next. Same principle PowerShell uses, as well most other command-line shells.
Reusing the commands allows you to focus on simpler primitives and achieve more complicated tasks via their composition through the pipeline....
Read full article
Build a coma-separated list of the string representation of an array of objects, rendering null values as "null", string values with quotes ( i.e. 15, true, "foo", null ) and everything else using object.ToString():
foreach:
List<string> values = new List<string>(invocation.Arguments.Length);
foreach (var x in invocation.Arguments)
{
values.Add(x == null ?
"null" :
x is string ?
"\"" + (string)x + "\"" :
x.ToString()
);
}
string ...
Read full article
More Posts