Personal Homepage

My resume


Are you doing cool stuff? If so, you need to communicate how cool it is, with demo apps, exciting examples, articles, talks, and seminars. I love to bring the best new technologies into the public eye. I'm especially a fan of innovative programming tools and mobility software (Tablet PC, SmartPhone, and .NET Compact Framework). Contact me: Click here to send an email to larry.



Free .NET Tools

Knowing .NET

Code, industry analysis, and miscellaneous cross-links from Larry O'Brien, the former editor of Computer Language and Software Development magazines.

To receive an occasional announcement message regarding my seminars or publications, please subscribe to my mailing list.

Email:

Friday, March 12, 2004


Inspired by Jon Udell's link to a New York Times article on network maps of polarized political books, I wrote a similar program in C# and mapped the polarization between readers of "The C# Programming Language" by Hejlsberg et al. and "The Java Programming Language" by Arnold et al. It's really fun to watch when the network is just a couple of hundred nodes.

Unfortunately.... even with 2000 nodes, the books aren't connected! Amazing. I don't know what to do... maybe work outward from suspected "connectors" like "Design Patterns," and "Design Patterns in C#" and "Design Patterns in Java." Anyway, my SpringEmbedderPanel doesn't zoom out, so it's impossible to generate a readable universe of connected books in a single image. Here are two images, one from early in the run with the complete network in play(with "C# Programming Language" on the left and "Java Programming Language" on the right), and another showing a portion of the display when the network is only around 200 books.

It's a fun program; I can't release it yet because it's all in C# 2.0 (with typesafe generics for which I'm very grateful!).


5:25:17 PM    comment []   trackback []

Bruce has an interesting discussion entitled “Generics Aren't”. It's primarily about the new support for generics in Java, but it has a lot of “generic generic” material as well.  via [Eric Gunnerson's C# Compendium]

The argument applies to C# generics, but dismisses type-safe data structures as only of concern to collections classes, but that's a narrow view. Using an interface loses type information (pace loose-typing discussion!). Consider the following, in which there's a desire not to allow Cats, Dogs, and Horses to interbreed :

interface BreedingAnimal
{
 BreedingAnimal Breed(BreedingAnimal spouse);
}
class Dog: BreedingAnimal
{
 public BreedingAnimal Breed(BreedingAnimal spouse)
 {
  return new Dog();
 }
}
class Cat: BreedingAnimal
{
 public BreedingAnimal Breed(BreedingAnimal spouse)
 {
  return new Cat();
 }
}
class Horse: BreedingAnimal
{
 public BreedingAnimal Breed(BreedingAnimal spouse)
 {
  return new Horse();
 }
}
class TypeSafeBreeder<T> where T:BreedingAnimal
{
 public T Reproduce(T aParent, T anotherParent)
 {
  return (T) aParent.Breed(anotherParent);
 }
}
class TypeSafeGenericsAreUseful
{
 public static void Main()
 {
  Dog lassie = new Dog();
  Dog rintintin = new Dog();
  Cat garfield = new Cat();
  
  TypeSafeBreeder<Dog> kennel = new TypeSafeBreeder<Dog>();
  Dog puppy = kennel.Reproduce(lassie, rintintin); //Isn't that nice?
  // Dog x = kennel.Reproduce(lassie, garfield);   //Won't compile. Isn't that nice?
  Horse flicker = (Horse) garfield.Breed(lassie); //<;- Compiles clean, runtime error. Darn you, type unsafe code!
 }
}

(exercise for the reader: as an interface BreedingAnimal.Breed is necessarily public, allowing access to the Breed() method without using a TypeSafeBreeder<T>. Change the design so that such a threat would only apply to classes in the assembly where these classes are defined.) 


11:39:46 AM    comment []   trackback []

March 2004
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Feb   Apr


Recent code:

Genetic algorithm in C#


Recent writing:

The REST is Salient

A Perfect Demo

Is InfoPath the New Excel?

The Joy of XML

No Reservations About .NET

Review of Borland's C# Builder 1.0

Java Eye for the .NET Guy

Waiting for Whidbey

Academic Issues

Netscape, We Hardly Knew Ye

Recommended .NET Programming Books

Programming Sabre with Java, C#, and XML

Bayesian Spam-Filtering

Best Practices for .NET Architecture

Windows Server 2003 as an Application Server


Toolroll:

Motion Computing M1200 Tablet PC

Compaq Evo N400c

XP Pro

Outlook 2003

Word 2003

Visio Enterprise Architect 10

Radio Userland 8

Visual Studio 2003 Enterprise Architect

Visual SlickEdit 6

Adobe Photoshop 6

Windows Journal 1

Microsoft Snippet 1

NewsGator 1.2

SpamBayes 1.0a2

Adobe Acrobat Professional 5

Groove 2.5

SQL Server 2000

WinCVS 1.3

IntelliJ IDEA 3

NUnit 2

Rational Rose Enterprise Edition 7

TimeTTracker 7

XMLSpy 5 Enterprise Edition

T Mobile Pocket PC Phone Edition


Subscribe to "Knowing .NET" in Radio UserLand.
Click to see the XML version of this web page.
Click here to send an email to the editor of this weblog.
[foaf]