Skip to content

Instantly share code, notes, and snippets.

@arlobelshee
arlobelshee / gist:1293201
Created October 17, 2011 17:35
Oct CTP geospatial provider sample
using System.Collections.Generic;
using System.Data.Services;
using System.Data.Services.Common;
using System.Linq;
using System.Spatial;
namespace AllTheNews
{
[DataServiceKey("BusinessId")]
public class Business
@arlobelshee
arlobelshee / Car.cs
Last active October 2, 2015 17:32
Combine 2 methods into one with a discriminator variable
// Goal: Restore Drive method to all operate at one level of abstraction.
// Refactorings performed: Extract Method x 3
// Hand-edits made: update comment
// Why: A method with multiple levels of abstraction is harder to reason about. Drive
// was calling a method to do some of its work, then doing direct field operations later.
// That causes readers to distrust the one method that was called and have to read it to
// understand the whole.
//
// Now Drive is written entirely in terms of intent. They can choose
// to read it and trust all sub-methods. After they accept Drive, they can choose to read