PC#1: A solution
So, when I initially posed the programming challenge #1 I stated: … since I intended to output HTML, ASP.NET seemed a logical choice. But I was amazed at the amount of code required for such a...
View ArticleC# abuse of the day: SwitchOnType
Today I encountered a situation where I wanted to switch based on a type. Maybe I stayed up a little too late reading Foundations of F#, last night. While this is certainly no pattern matching, it...
View ArticleHello, world!
Jonas Adam Carpenter; born June 4th @ 6 lbs. 3 oz., 19 in. (Sorry for the entirely non-technical post. I’ll be blogging more C# again, soon.)
View Article.Any overload
Nice: if (folderPaths.Any(path => !Directory.Exists(path))) throw new DirectoryNotFoundException(); Nicer: string pathNotFound; if (folderPaths.Any(path => !Directory.Exists(path), out...
View ArticleStrange Framework design decision of the day…
Today I encountered the strangest .NET Framework design decision I’ve seen in recent times: HashSet<T>’s GetEnumerator method returns a public struct HashSet<T>.Enumerator. Let’s count how...
View ArticleC# reminder of the day
Static data is not shared among constructed generic types. That is, the final line of output from the following program: using System; class Program { static void Main() { NonGeneric.PrintCount(); //...
View ArticleC# compiler eccentricity of the day: throwing lambda
Here at work (gratuitous link; oh yeah, and we’re hiring), we have a Verify helper class. Verify lets you succinctly validate (or verify, if you will) various method invariants. For instance,...
View ArticleGoogle Reader Tip
Sorry to break a long hiatus with such a lame, non-programming post. But, here’s a tip for Google Reader users: A coworker of mine appears in my google talk list, but was not able to see my shared...
View ArticleReading large xml files
I’m a huge fan of System.Xml.Linq or “LINQ to XML”. However, some documents really are just too large to efficiently process with an in-memory representation like XDocument. For such documents, we need...
View ArticleHello Roslyn
using System; using Roslyn.Compilers.CSharp; namespace HelloRoslyn { class Program { static void Main() { string program = Syntax.CompilationUnit( usings: Syntax.List(Syntax.UsingDirective(name:...
View Article
More Pages to Explore .....