Welcome to OdeToCode Blogs Sign in | Join | Faq

Most Recent Posts


Spike Code and Source Control

Jeremy’s post “Don’t Check In Spike Code” reminds of something I’ve advocated for years: dedicate a place in your source control repository where each developer can check in their “experimental” code. The rule of thumb is to throw away code you write...
November 17, 2008 by scott

Single Letter Variable Names Still Considered Harmful

There is a lot of humor in the Bad Variable Names entry on the c2 wiki. I like this confession from Alex: The worst of which was my counter variable names. I now use i, j, k, and so on for local counts and things like activeRowCount for the more descriptive...
November 16, 2008 by scott

Mapping with Expressions

Once you know about the magic of Expression<T>, it’s hard not to make use of it. Or perhaps, abuse it. Here is an excerpt of a class I wrote that uses Expression<T> as a reflection helper. public class PropertySpecifier<T> { ...
November 13, 2008 by scott

Expression Magic

In the last post we talked about needing some Expression<T> background. There is a lot of good information out there about Expression<T>, but if you haven’t heard – this class is pure magic. If you want a long version of the story, see “LINQ...
November 12, 2008 by scott

Fluent Interfaces and Flowcharts

In a previous post, I talked about modeling flowcharts with C# code. The flowcharts are designed, documented, and standardized  by a non-profit  organization charged with measuring the quality of patient care inside of hospitals. They do so...
November 11, 2008 by scott

The Estrangement of LINQ to SQL

Tim Mallalieu, PM of LINQ to SQL and LINQ to Entities, recently announced: “…as of .NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios.” Tim later tried to clarify the announcement in a carefully...
November 10, 2008 by scott

Modeling Flowcharts

A few months ago I worked on a system that was based on a set specifications that included some gnarly flowcharts (see pages 7 – 17 for an example). The good news was that the specs were concrete and readily available. The bad news was that the specs...
November 09, 2008 by scott

Lazy LINQ and Enumerable Objects

Someone asked me why LINQ operators return an IEnumerable<T> instead of something more useful, like a List<T>. In other words, in the following code:List<Book> books = new List<Book>(); // ... IEnumerable<Book> filteredBooks...
October 01, 2008 by scott

What’s Wrong With This Code? (#20)

Mike had to model answers. Yes or no answers, date and time answers - all sorts of answers. One catch was that any answer could be “missing” or could be “empty”. Both values had distinct meanings in the domain. An interface definition fell out of the...
September 02, 2008 by scott

Stupid LINQ Tricks

Over a month ago I did a presentation on LINQ and promised a few people I’d share the code from the session. Better late than never, eh? We warmed up by building our own filtering operator to use in a query. The operator takes an Expression<Predicate<T>>,...
September 01, 2008 by scott

Visual Studio SP1 and The Metification of REST

Metification – verb The act of adding metadata to a web service in order to facilitate tooling and discovery. The act of adding complexity to a web service in order to achieve tight coupling. Pick one. Service Pack 1 for Visual Studio 2008 has just...
August 14, 2008 by scott

Optimizing LINQ Queries

I’ve been asked a few times about how to optimize LINQ code. The first step in optimizing LINQ code is to take some measurements and make sure you really have a problem.    It turns out that optimizing LINQ code isn’t that different from...
July 14, 2008 by scott

Using an ORM? Think Objects!

I recently had some time on airplanes to read through Bitter EJB, POJOs in Action, and  Better, Faster, Lighter Java. All three books were good, but the last one was my favorite, and was recommended to me by Ian Cooper. No, I’m not planning on trading...
July 14, 2008 by scott

LINQ Deep Dive at D.C. ALT.NET Next Week

Matt Podwysocki invited me to speak at the D.C. alt.net meeting next Thursday evening (July 24th). The topic is LINQ. Matt specifically requested a code-heavy presentation, so expect two slides followed by plenty of hot lambda and Expression<T>...
July 11, 2008 by scott

Keeping LINQ Code Healthy

In the BI space I’ve seen a lot of SQL queries succumb to complexity. A data extraction query adds some joins, then some filters, then some nested SELET statements, and it becomes an unhealthy mess in short order. It’s unfortunate, but standard SQL just...
July 08, 2008 by scott

Restku

Haiku is a popular poetic form that has evolved over centuries. Restku is Haiku with a  twist. crystal pixels get brighter an abundance of excitement The twist is that the author of a Restku is restricted to using a single verb from...
July 07, 2008 by scott

Herding Code

Herding Code is a podcast about a variety of topics in technology and software development. It’s done roundtable style with myself, Scott Koon, Kevin Dente, and Jon Galloway. The conversations are a blast, and I hope informative, too. Tune in to the...
July 06, 2008 by scott

Swimming Upstream Is Hazardous

Salmon swim upstream, and look at what happens …      Every developer is familiar with the “work around”. These are the extra bits of extra code we write to overcome limitations in an API, platform, or framework. But, sometimes...
July 03, 2008 by scott

Pluralsight 2.0

Pluralsight has a new website, and the new site includes some online training options! See Fritz’s post for more details. Be sure to check out one of the newest classes - the LINQ Fundamentals course, too. ...
July 01, 2008 by scott

Rob's Not So Lazy MVC Storefront

Rob ran into some lazy load problems in his MVC Storefront and later proclaimed: "…if you set any Enumerable anything as a property, it's Count property will be accessed when you load the parent object. This negates using any deferred loading for any...
May 21, 2008 by scott

Visual Designers Don’t Scale

Microsoft has a long history of being visual. They've made quite a bit of money implementing graphical user interfaces everywhere – from operating system products to database servers, and of course, developer products. What would Visual Studio be if it...
May 19, 2008 by scott

The Power of Programming With Attributes

Nothing can compare to the Real Power of programming with attributes. Why, just one pair of square brackets and woosh – my object can be serialize to XML. Woosh – my object can persist to a database table. Woosh – there goes my object over the wire in...
May 13, 2008 by scott

Two LINQ to SQL Myths

LINQ to SQL requires you to start with a database schema. Not true – you can start with code and create mappings later. In fact, you can write plain-old CLR object like this: class Movie {     public int ID { get; set; }...
May 11, 2008 by scott

Mr. President the Programmer

Daily Standup Transcription 06 May 2008 1300 Zulu Time In 00:02:34.66 "… so, yesterday I continued the refactorafication of some classes. The job isn't easy, but I'm going to work hard and continue the collaborativity with my programming partner. Together,...
May 07, 2008 by scott

There Is Always Risk In Portability

After my last post, someone asked me if the "portable" repository pattern was really a good idea. He was referring to the fact the LINQ queries in the MVC Storefront and Background Motion applications would sometimes execute against in-memory collections...
May 06, 2008 by scott

Posts by group



Bloggers



Syndication



Opml



Powered by Community Server, by Telligent Systems