August
7

I’ll be heading out to the first Alt.NET conference in Israel in an hour or so, I’m really excited about the Alt.NET movement forming up in Israel.

I hope to learn some stuff I just never get around to, such as:

  • Domain Driven Design,
  • Behavior Driven Development,
  • Domain Specific Languages.

I don’t think I’ll be able to share any knowledge, since I’m positive that I will be stunned by the high-level knowledge of the people there.

So I’m off to stare and drool. See you there!

0
July
10

Several months have passed since people starting using C# 3.0 out there. I, however, was busy with linear algebra, discrete math and such at that time.

I did, however, try to keep up and see what’s the fuss about extension methods, but I never got it. I mean, this is anti-encapsulation at it best - break into any type, do whatever you feel like. Total chaos.

So I gave it some time. I didn’t force it into any of my projects until the time was right. Then I finally got it - extension methods are ideal for little pieces of code which you need, but creating a utility class for them feels wrong.

For example, I was implementing a new feature for Regionerate a couple of days ago in which I had to sort a list, split it into distinct values and recursively sort it again.

Its a reflection-based sort and it has quite a bit of logic in it, so it had a class & unit tests just for it. I had to take care of the splitting thingy, but it felt wrong to add it as a method in the sort class, as it operates on lists. It really feels like a method that should run on IList<T>.

Subclassing List<T> for the job feels wrong - c’mon, how would you pitch such a class? “It’s a list that you can split!”. Unpersuasive.

That’s how I got it: If IList<T> was built especially for Regionerate, it would have had a reflection-based Split function, but since its not, I should implement it as an extension method.

Took me 2 minutes and works like a charm.

   1:  public static IDictionary<object, IList<T>> Slice<T>(
   2:          this IList<T> list, PropertyInfo propertyInfo)
   3:  {
   4:      IDictionary<object, IList<T>> slices = 
   5:          new Dictionary<object, IList<T>>();
   6:      foreach (T t in list)
   7:      {
   8:          // Get the value of propertyInfo.
   9:          object value = propertyInfo.GetValue(t, null);
  10:   
  11:          // Add it to slices.
  12:          if (slices.Keys.Contains(value))
  13:          {
  14:              // slices already has a slice for this value.
  15:              slices[value].Add(t);
  16:          }
  17:          else
  18:          {
  19:              // there is no slice for this value 
  20:              // inside slices, create a new slice.
  21:              IList<T> newSlice = new List<T>();
  22:              newSlice.Add(t);
  23:              slices.Add(value, newSlice);
  24:          }
  25:      }
  26:   
  27:      return slices;
  28:  }

A fully documented, well-aligned version of this extension method is freely available here.

kick it on DotNetKicks.com

0
May
21

It’s been a rough day for us tweeters, May 20th had a longer Twitter downtime period. The bright side is that it helped me understand how pathetic we are. See for yourself.

Note: yes, this post should have been a tweet, but I’m Twitterless.
1
April
16

fdg Krzysztof Cwalina, author of the book Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries has released a second revision of the Framework Design Guidelines Digest.

I’ve read Framework Design Guidelines a couple of years back and learned a whole lot from it. It definitely makes it to my top 5.

However, I’ve had problems convincing my staff members to read it, as it contains~400 pages of design tips, which are quite hard to read in succession.

The Framework Design Guidelines Digest narrows the basics down to 9 pages. I recommend everyone to download and read it every once in a while.

Quoting Krzysztof:

This document is a distillation and a simplification of the most basic guidelines described in detail in a book titled Framework Design Guidelines by Krzysztof Cwalina and Brad Abrams. Framework Design Guidelines were created in the early days of .NET Framework development. They started as a small set of naming and design conventions but have been enhanced, scrutinized, and refined to a point where they are generally considered the canonical way to design frameworks at Microsoft. They carry the experience and cumulative wisdom of thousands of developer hours over several versions of the .NET Framework.

Get it here.

0
April
5

SWI: Day II Summary

Posted In: 3DayStartup by rauchy

Yesterday was pretty great. We are building a web 2.0 app (surprise surprise) for time and service exchange.

We split to several teams - development, marketing, user experience etc’. Over at the development team we split to front and back end teams.

I wrote a YouTube adapter yesterday for uploading and displaying YouTube videos, hope to post about it later on.

Looks like I’ll be doing some NHibernate today.

Can’t really write too much as I’m late, again, for day III, but:

  1. Some pretty great guys out there, its always nice to reach outside your circle of colleagues.
  2. People are smart.
  3. People are stupid.

The only important things I’ve learned from talking to a nice gentleman from marketing is that if you plan to release a killer app in a domain which has already been harvested, your chance to succeed aren’t that big. Most successful application we see today recognized an un-harvested domain and conquered it.

Keep following on Twitter, I’m off!

0