Calling Extension Methods On Null Objects

One of the gotchas for Extension Methods is that it’s legal to call them on Null References. This isn’t really surprising when you think about the feature. Boiled down to a fundamental level, extension methods are just syntactic sugar for calling a static method and automatically passing the first parameter 1. However it can catch the unwary off guard.

  1. Then again you could also claim that instance methods are just syntactic sugar for calling static methods without having to pass this/Me as the first parameter. 

Tuples In Powershell

Tuples in computer science are usually light weight record objects with simple name value pairs. In scripting languages it is very handy to create them on the fly. For quite some time I was using associative arrays in PowerShell to do just that.

Piping Elements Of A String

Quick script that will allow you to pipe each char in a String into the PowerShell pipeline.

Type Inference And Ienumerable

This is somewhat of a follow up on a previous post I did on the difference between IEnumerable(Of T) and the IEnumerable interfaces.

Autosize And Dockstyle Fill Don T Mix

The title of this post essentially says it all. AutoSize and DockStyle.Fill don’t mix well together. Both properties exist to describe the size relationship relative to the rest of the control but they do so in conflicting ways.