Ayende @ Rahien

Oren Eini aka Ayende Rahien CEO of Hibernating Rhinos LTD, which develops RavenDB, a NoSQL Open Source Document Database.

Get in touch with me:


+972 52-548-6969

Posts: 7,322 | Comments: 50,640

Privacy Policy Terms
filter by tags archive
time to read 1 min | 158 words

I just finished watching DNR TV #16, in which Carl is talking about async programming.
Some of the best DotNetRocks episode was with Carl and the host of the moment just goofing around and talking tech, so I had high expectations of this.
I'm not a VB programmer, and it's interesting to see how a VB guy works, and it even includes commentry.

One thing that I don't understand is this construct:

    ' do something that can throw
End Try

Isn't this a no op?

This video reminds me of a Joel On Software article about how hard it is to write a function that copies a file.
There is a lot of commentry on some ancient VB stuff along the way, since Carl often compare the way it was done right now and in VB6 and previous versions.
It is a nice show.

Great DNR Quote

time to read 1 min | 100 words

I was listening to DNR #170 and Tim Huckaby (Am I the only one who read tha Huckleberry?).

There was a moment there when Tim said: "Microsoft is never going to ship..." and there was a pause where I thought "WTF?!" and then he continues "another product as bad as Windows ME".

This sentiment goes a round of appluase from the crowd (which include Me and I, incidently). I keep recalling a quote: "No one will remember if you were late, but they will remember if you were bad."

time to read 2 min | 279 words

I listened to the rest of the DotNetRocks episode 169 with Rocky Lhotka. This time, I wanted to comment about the part where Rocky talks about ORM. Before everything else, I would like to comment on something he said about Microsoft and O/RM.

He said that most O/RM are using Reflection, and that only Microsoft can solve this issue, because the can modify the CLR to allow direct access to private fields.

I wanted to note that there is already such a thing in .Net 2.0, and it is called LCG (Lightwieght Code Generation), and it basically means that you can inject a method into a class, which will have full access to all the class' members, regardless of visibility (just as any class on the object does). There is a patch for NHibernate that allows it to use this functionality in .Net 2.0, so you don't need to me Microsoft to use this.

I would also like to comment that NHibernte is already avoiding Reflection whenever possible, relying on runtime code generation to read and write to public properties / fields. 

I want to address another part of what he said, where he said that O/RM assumes that objects are structure the same way as the database is. Only the simplest O/RM assumes this. One of the important charactaristics of objects is not the data they contain, but what type of object you have, and what relations it has to other objects. A good O/RM will know to map the schema of a database to your object structure without impacting the design of the object.

In fact, I would go as far as to say that this is the criteria of good O/RM.

time to read 5 min | 926 words

I was listening yesterday to DotNetRocks episode 169 with Rocky Lhotka, and I was muttering "WTF??!!" throughout the first part of the show.

The issue that I had was Rocky talking about TDD and saying stuff that simply didn't match the reality, not by a long shot. Jeffery Palermo post about it as well, by the way.

Rocky's main objections seem to be:

When you are working Test First, you don't get intelli sense for classes and methods that don't exists, and that seem to hurt his development style.

First, what is the problem. You just created a class, why do you need intelli sense for something that you'll write in a few minutes? Yes, it is convient, but the rate of creating new methods / classes in my code is not high enough that I will forget that I created that class 3 minutes ago and need to think about the interfce I want to give it.

Second, good enough tools like the wonderful ReSharper or VS.Net 2005 (far less powerful) will gladly create classes and method for you on the fly when you refer to something that do not exist. This is not an issue.

Test First require that you will first write the test, and then write the code. Doesn't mesh well with programming by the wizards.

Considerring that most of the wizards have to do with UI in the first place, and considerring the big problems in testing UI, I would say that this is a non issue. If I think that I need something that doesn't work directly in the UI, I can't see how the wizards and the tools will help me any. I am aware that other people feels just the opposite.

That said, do you really think that you can trust the code that the wizard generates? Or are you going to run it through it paces a few times, just to make sure it works? If you intend to check it yourself, you need a test for this (or several). You will change this part of the code, and you need it covered. I would also argue that you get far better design and working experiance when working in TDD fashion that you do with all the wizards.

You write a bunch of tests, and then you've to write the code to make them work, which is hard.

You know what, he is right on this one, which is why you never write a bunch of tests and then try to implement them. You write one test, then you make it work, then you write another test, etc.

On a large system, it is hard to test one method at a time.

This is possible, and it indicate a design problem in the code, fix it. Check out "Working Effectively With Legacy Code" for the details. I can't imagine trying to change something in a large system without tests. How do I know that I didn't break anything?

If he is talking that it is hard to TDD a feature with small increments, than he is right, it takes some work. The end result is worth it since you got a decoupled design you know is working.

Ater writing a test, developers fear to refactor the system, since it will break the test.

I was literally ranting at this point, and this one is really over the top. If I have ever heard a falser statement... TDD is made up of three things: "Red, Green, Refactor". If you don't do all three, you are not doing TDD. What he calls refactoring is not that, it's random code movement through the code, with the prevent wishes of the developer that he isn't breaking anything. Thanks, but "Code and Pray" are not for me.

It's easy to write your own test harness in a couple of lines.

Yes, it is easy, but you are only running one test that you keep changing, you are not check other parts of the code, can't add it to the build process, etc. In essense, this "test harness" is merely a way to execute the code as it would be on the production system, so you could debug the problems. I would rather not debug at all, and get a nice warm blanket of tests telling me where I am doing wrong.

time to read 2 min | 201 words

If you're not familiar with the term, Pwop Ambassadors are geeks that donate bandwidth to distribue the files that Pwop produce using bittorrent. And Pwop is the company that produce shows like:

This means that I spent a couple of hours setting it up, and now whenever I see an annoucement for a new show being released, I can head to my Hard Disk, and voila, it is there already. Talk about immediate gratification.

In return, I'm sharing those files, of course, so this mean that if you are in Israel, you really should try downloading those shows (all of them are excellent, by the way) via BitTorrent, since you've a local source nearby, serving them.


time to read 2 min | 290 words

Fact: DotNetRocks makes you a better programmer.

Boo makes you a  great programmer.

What happens when you combine them together? The entire dot net rocks archive!

I keep going to the Dot Net Rocks site for more stuff, but because I listen faster than they record (except during the road trip {Hi, when is the next one due :-)}), I've started to dig into their archives. But they are lots of shows, and there doesn't seem to be any torrent for all of the files. After downloading a single show for the tenth time, I decide to put some code into action, instead of clicking on links like an idiot.

Here is the result:

  1. import System.IO
  2. import System.Net
  3. import System.Text.RegularExpressions
  5. link_url = """http://perseus\.franklins\.net/[\d\w]+\.mp3"""
  7. for i in range(1,157):
  8.         base_url = "http://www.dotnetrocks.com/default.aspx?showID=${i}"
  9.         print "echo Trying to connect to: ${base_url}"
  10.         using response=WebRequest.Create(base_url).GetResponse():              
  11.                 match = Regex(link_url).Match(StreamReader(response.GetResponseStream()).ReadToEnd());
  12.                 print "wget ${match.Value}"
This is just 12 lines of code (with some spaces) to create a script that would download all the shows. You can get wget here and from there, just pipe it to a batch file, and have fun listening.
I really like the way that Boo just stepped out of the way nicely to let me do it.


No future posts left, oh my!


  1. Challenge (66):
    06 May 2022 - Spot the optimization–solution
  2. Production postmortem (37):
    29 Apr 2022 - Deduplicating replication speed
  3. Recording (3):
    11 Apr 2022 - Clean Architecture with RavenDB
  4. Answer (10):
    07 Apr 2022 - Why is this code broken?
  5. Request for comments (2):
    10 Mar 2022 - Removing graph queries from RavenDB
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats