Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,582
|
Comments: 51,212
Privacy Policy · Terms
filter by tags archive

Cecil is cool

time to read 1 min | 143 words

The more I read about it, the more I like it. Now I need to make it work correctly. Take a look at the FAQ, awesome stuff.

Although some minor problems can waste some time here and there. Spot the differences:

definition.FullName //Cecil object
"Rhino.Query.Tests.RhinoQueryTests/<>c__DisplayClass1"
type.FullName // Reflection object
"Rhino.Query.Tests.RhinoQueryTests+<>c__DisplayClass1"

The hashtable indexer didn't had any trouble spotting them.

time to read 1 min | 84 words

Can someone explain to me why the VS.Net S&R doesn't use the standard regular expressions library that ships with .Net? I can understand the need to create one when it didn't exist, but why force us to learn both how VS.Net S&R regex engine works, and the standard .Net one. There are some very cool stuff there that I use all the time (:i, for instance), but it would be easy to add it the the engine just for this, why fork it? Historical reasons?

time to read 1 min | 123 words

Linking an Oracle database to a SQL Server one seems to be a deeply spiritual experience that involves a lot of meditation, playing with Oracle's client, using regsvr32 indiscriminately and then finding out that the queries aren't working. It gets more interesting when you're trying to run the queries, check out the syntax:

SELECT * FROM X..SYS.ALL OBJECTS;

As you can see, the syntax is obvious. And I'll say nothing about how I arrived to this after a lot of frustrations where it just couldn't find the proper tables. In the end, it was actually simplicity itself, of course that the query will be case sensitive (where both SQL Server & Oracle aren't).

time to read 1 min | 86 words

It's very rarely that I get to see so many UI crimes in one application. Usage of non standard dialogs, not respecting common idioms in Windows, not bothering to make sure that the text is not clipped on the buttons, etc.

<Irony>

I must say, it's no wonder that Oracle is the most popular database around, those guys probably work hard, and since they definitely didn't work very hard on their installer, the database itself probably got all the attention.

</Irony>

time to read 1 min | 106 words

I was listening to DotNetRocks #157, which talk about BitTorrent, and something just went "click" when I heard them talking. In Starship Titanic one of the characters rave about the inefficiencies inherent to modern traffic system (check outside at ~8:30AM each morning and you'll see what he is talking about).

One of the things he said there went on like this (from memory and translating to English): "You shouldn't build a system that works slower the more people use it. A proper system work faster the more people use it."

BitTorrent is a proper system J

time to read 2 min | 309 words

I just saw Sahil's post SSIS, and I couldn't help but cringe at the last words of the post. While in theory you can write code that will write an SSIS package for you, you really don't want to do that. The issue is that the whole thing is completely under documented, uses COM interop in the strangest way (sometimes you've a managed wrapper, sometimes you don't, there are things that you can't do from the COM interfaces, so you need the managed wrapper, and things that you can't do from the COM interfaces).

I present to you, in its entirely the MSDN code to create a package:

class CreatingAPackage { Package package; public CreatingAPackage() { package = new Package(); } }

I'm not sure who wrote this masterpiece, but I wouldn't call it documenting the code. I need to write code that would handle loads of table, I want to be able to create a dataflow object and programmatically generate output columns from the input columns, and shoving things there after I did some transformation on them.

No go. Oh, it's certainly possible, I'm sure. But I've no idea where to start writing such a thing. I looked at the examples, and I read the blogs, I searched in Google and I Reflectored till my eyes crossed. I'm not going to spent a couple of weeks becoming an expert on SSIS just so I could save a couple of days of one-off manual work, which is a pity.

 

time to read 3 min | 574 words

I sometimes run into situations where people think that ORM is a magic word for no-work-required. This is especially true when they tend to realize that a few hours (on a small project, or a few hours here and there on a larger one) in front of an XML editor and some really simple classes, can more or less eliminate the need of a DAL.

It's tempting, I can write a functional DAL very quickly, but I also need to make sure that I test it. The problem is that you may be tempted to leave it like that, and that is where the danger lies. Let's imagine a very simple blog, where you've a many to one connection beteen posts and a blog, and you want to work with it. I can create the code for that in under ten minutes, in notepad, from memory alone (and no, it's not a boast, it's proof to how good the whole toolset is). But what then? Take a look at this code:

Blog blog = new Blog("My"); 
Blog.Posts.Add(new Post("noise")); 
blog.Save();
using(new SessionScope())//for lazy loading 
{
  Blog fromDB = Blog.FindWithId(blog.Id);//verify save works

  //for each field, verify that the correct value was returned 
  //this is VERY important if you're going to play typing games, such as saving 
  //bool to tinyint columm, saving enums, etc...
  Assert.AreEquals("My", fromDb.Name);

  bool isLoaded = NHibernateUtil.IsInitialized(fromDb.Posts);
  Assert.IsFalse(isLoaded);//verify lazy loading

  int count = fromDb.Posts.Count;// loads the lazy collection, also 
  Assert.AreEqual(1, count);// Verify that cascade works from blogs to poss

  Post postFromDb = Collection.First(fromDb.Posts);
  Assert.AreEquals("noise", postFromDb.Content);//verify that saving a post works
}

This is one of the simplest possible tests, and check out how many failure point it has. You have to have this kind of coverage over all your entities (although I hate this word). If you don't, you can very easily get into a situation where the most minor change will break you code, and you'll not understand why this is happening.

time to read 2 min | 361 words

I think that anybody who ever done some serious development was in the Zone, that place where you can see the whole system in your head, and can see what would happen if you make this change. It's a happy place, and you can easily lose track of time (or meetings :-)) when you're there. It's also highly annoying to be taken out of it suddenly (phone ring, for instance).

So, given all that, why does pairing work? In the last couple of months I had a chance to pair with several people, some of them were better than me, some where worse (in the technology that we were writing with). Sometimes the difference were pretty big. Nevertheless, I think that I consistently find that I work faster, and actually have a lot more fun when paring. I recently had to do some math work with a friend, and the same thing happened there, I think that together we were three or four times faster than each of us on his own.

And we don't spend all the time developing, or solving math problems, we talk, argue, call each other stupid because of cource you can see that it does this because of that, etc. So, I can get why I'm productive when I'm in the Zone, but I never get the chance to get into something even remotedly similar to this when pairing with someone.

I think that this is in part because when you work with someone else you need to explain yourself to the other person as you go along, and as a part of that you explain to yourself. I can't really count the number of times that I've explained a piece of code (that I just sweated hours on) to a co-worker, and suddenly I take a piece of paper and start writing scenarios that I didn't even see before. I know that doing math problems it certainly was like that. I knew some stuff and the other guy knew some stuff, and by mutual argument we reached to the (possibly, at least 95.454%) answer.

FUTURE POSTS

  1. fsync()-ing a directory on Linux (and not Windows) - about one day from now

There are posts all the way to Jun 09, 2025

RECENT SERIES

  1. Webinar (7):
    05 Jun 2025 - Think inside the database
  2. Recording (16):
    29 May 2025 - RavenDB's Upcoming Optimizations Deep Dive
  3. RavenDB News (2):
    02 May 2025 - May 2025
  4. Production Postmortem (52):
    07 Apr 2025 - The race condition in the interlock
  5. RavenDB (13):
    02 Apr 2025 - .NET Aspire integration
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats
}