Kael Rowan

Foundations of Elegant Code

Posts
  • Kael Rowan

    ArithmeticConverter

    • 0 Comments
    Using a declarative language like XAML to define a UI feels like the right thing to do, but it has its drawbacks. I appreciate that disallowing procedural code eliminates race conditions and side effects, but what about purely functional operations like...
  • Kael Rowan

    Presentation.More

    • 0 Comments
    In the same vein as System.More , I've also created a Windows Presentation Foundation counterpart called Presentation.More.  And just like System.More defines classes in the same System namespaces as System.dll and System.Core.dll, Presentation.More...
  • Kael Rowan

    MathExtensions

    • 0 Comments
    Fluent programming is cool, and with extension methods you can make your code much more elegant.  I’ve been programming for years, but I still have to squint when I see an expression like Math .Min(z, Math .Max(y, Math .Pow(x, Math .Sqrt(x)))) . ...
  • Kael Rowan

    System.More

    • 1 Comments
    I, like most developers out there, have accumulated a set of classes and utility functions that have been used repeatedly in multiple projects throughout my career.  This code has followed me around in various forms; sometimes by copying the files...
  • Kael Rowan

    Comparator

    • 0 Comments
    I recently wrote a generic PriorityQueue class which can treat any type of object as the priority (not just integers). Specifically, the class looked like this: public class PriorityQueue <T, TPriority> { public PriorityQueue() : this ( false...
  • Kael Rowan

    SynchronizationCallback

    • 4 Comments
    It's common for user interface frameworks (such as Windows Forms applications or Visual Studio packages) to restrict API calls to a single thread; specifically the "UI" thread that is usually the original or "main" thread in the process. This means that...
  • Kael Rowan

    ThreadQueue

    • 0 Comments
    I was writing an application the other day that required serializing objects to a set of files on a network share as a user is entering data. The writing is done “live” (instead of waiting until the user closes the application) because there are other...
  • Kael Rowan

    IndentedTextWriter

    • 0 Comments
    There's a very useful class called IndentedTextWriter in the System.CodeDom.Compiler namespace that automatically adds whitespace before each line depending on its Indent property. This works great when you have code with several nested (or recursive...
  • Kael Rowan

    PriorityQueue

    • 1 Comments
    I’m implementing a single-source multiple-target version of Dijkstra's shortest path algorithm that stops when it reaches a requested number of targets.  In order to do this, I’m using a priority queue where target vertices are prioritized by shortest...
  • Kael Rowan

    Hello, World!

    • 14 Comments
    My name is Kael Rowan. I am a Software Design Engineer at Microsoft, and this is my first blog.
Page 2 of 2 (35 items) 12