<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1" -->
<rss version="0.92">
<channel>
	<title>onezero</title>
	<link>http://onezero.org</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2009 20:40:53 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Immutability In C#</title>
		<description>
I've struggled with how to allow immutable
objects in object-oriented languages like C#, Java, and C++,
either at the application level or with new language features.
Here are a few thoughts.



It's not so clear that immutable instances should be created in the constructor.  For example, if an application has a complicated List ...</description>
		<link>http://onezero.org/blog/archives/51</link>
			</item>
	<item>
		<title>The System.Random Class Should Have an Abstract Base Class or Interface</title>
		<description>
The base class library has a significant flaw with respect to System.Random: there is no abstract base class or interface for random number generators with the same interface as System.Random.
(The System.Security.Cryptography namespace does have the RandomNumberGenerator base class, but that type's interface differs from  System.Random's.)



The situation is as though ...</description>
		<link>http://onezero.org/blog/archives/50</link>
			</item>
	<item>
		<title>C# 64-Bit Array.Clear</title>
		<description>
In version 3.5 of the NET framework, and possibly in earlier releases, there are variants of Array.Copy that accept 64-bit values for index and length.  Unfortunately, Array.Clear has no such variant.  This seems to leave only bad options for clearing an array using 64-bit indexes and lengths.


One option ...</description>
		<link>http://onezero.org/blog/archives/46</link>
			</item>
	<item>
		<title>Performance Tip: Prefer (((Object) x)== null) to Object.ReferenceEquals(x,null)</title>
		<description>
What's the best way in C# to test for a null reference?  It turns out that there are a few different ways of doing this correctly, and that they have different speed and code size characteristics.



Consider overloading the == operator for some class Thing.  A natural first attempt ...</description>
		<link>http://onezero.org/blog/archives/45</link>
			</item>
	<item>
		<title>Shorter Construction Syntax</title>
		<description>
Did you ever notice the redundancy that's forced by C#'s syntax for invoking and defining constructors?



using System.Collections.Generic;

class Thing
{
  Thing(int x, int y)
    { ... }

  public static void Main()
  {
     Thing a = new Thing(3,2);
     Dictionary ...</description>
		<link>http://onezero.org/blog/archives/14</link>
			</item>
	<item>
		<title>Links and Page URIs that Resist Link Rot</title>
		<description>
The essential ideas of using permalinks to avoid link rot have been around much longer than since the term permalink came into common use.  The term permalink appears to have originated around the year 2000, and was widely used only after that.  Tim Berners-Lee wrote an 
article
about the ...</description>
		<link>http://onezero.org/blog/archives/35</link>
			</item>
	<item>
		<title>The &#8220;Structs Should Always be Immutable&#8221; Guideline</title>
		<description>
Sometimes one comes across the following guideline for C# structs:



All structs should be immutable.



The results of searching the web for justification for this are not very satisfying.



One argument sometimes advanced is that an immutable struct is usually simpler to understand than a mutable struct. This argument is true, but it ...</description>
		<link>http://onezero.org/blog/archives/13</link>
			</item>
	<item>
		<title>A non-Obvious Benefit of Replacing Boolean Arguments with Enumerations</title>
		<description>
When a method takes a boolean argument, it is sometimes better to restructure the method so that it takes an enumeration argument. In this article we show that the real benefit of this is not obvious and is often misunderstood.



Consider the following method and one of its clients:




void search(bool useCaseSensitiveSearch)
 ...</description>
		<link>http://onezero.org/blog/archives/8</link>
			</item>
	<item>
		<title>Origin of the Name onezero.org</title>
		<description>
People sometimes wonder about the origin of my domain name onezero.org. Here's how I chose it.



Some time around when I left grad school, I realized that it was good to have one's own domain instead of relying on a school or company or something else to store it.



I spent the ...</description>
		<link>http://onezero.org/blog/archives/7</link>
			</item>
	<item>
		<title>C# 2.0: 3f.Equals(3) != 3.Equals(3f)</title>
		<description>
In C#, it is good practice to make the Equals method commute.  But even the Base Class Library fails to do this sometimes.  It's possible to have a.Equals(b) != b.Equals(a) even with primitive types, e.g, when a is a Single (a float) and b is an Int32.



http://blogs.msdn.com/jmstall/archive/2005/03/23/401038.aspx
 </description>
		<link>http://onezero.org/blog/archives/6</link>
			</item>
</channel>
</rss>
