Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 6,260 | Comments: 46,597

filter by tags archive

Design Question: The Ubiquitous Property

time to read 2 min | 294 words

I'm currently refactoring SchemaEditor (NHibernate Query Analyzer Hbm.Xml Editor, if you prefer ;-) ), and I encounter a strange case in designing the API. I want to be able to set a field without caring what is the backing store, whatever it is an array or a regular field. The problem is that sometimes when you are assigning an array to a field which is an array, the whole array should be replaced.

It should look like the following;

public object Value
{
   get { return val; }
   set 
   {
       if(valType==value.GetType())
            val = value;
       else if (valType.IsArray && valType.GetElementType()==value.GetType())
            AddToArray(val,value);
       else
           throw new InvalidTypeException();
    }
}

This just strike me as ugly, no matter the reasons for this (trasperant data manupulation without caring for the backing store).

Any suggestions?

When Tests Tell You To Look Deeper

time to read 1 min | 183 words

Well, I've been able to find the reason that my tests were failing outside VS.Net, they were running on the Framework 1.0, and not Framework 1.1, as in VS.Net. Very simple, but it had me stumped for quite a while. Oh, and the current directory thing, it's true as well, there is a bug is there, which, to my shame, was in the tests themselfs :-{.

I added a test fixture called DeploymentTests, and added a test for the framework version. I think it's a good idea to cover all the basic stuff that can go wrong, for that reason, I currently have three tests in the deplotment tests, one for the framework version, one to ensure that all the required assemblies does indeed exist and the last one to make sure that files required for the testing exist.

Right now I'm green again :-D

I also got to a 35% test coverage, which is pretty good from 0% :-),

       happy joy happy joy

Trivial Properties and Syntactic Sugar

time to read 1 min | 137 words

I just read this article "Write Faster Code with the Modern Language Features of Visual C++ 2005", and one thing that caught my eyes, other than the far nicer C++.Net syntax was trivial properties:

See here for an example:

// trivial property
// compiler can generate accessors and backing store
property String^ Name;

Is there any reason that we can't get that in C#? It's a really conveniant feature that would save quite a bit of needless typing.

 

MSNSearch Wish

time to read 1 min | 93 words

Here are more stuff about MSN Search and IE abilities, but I don't want more tricks, I just want to be able to do a simple file name search, however, something as simple as "calc.exeor "filename:calc.exe" is not working. And MSNSearch is configure to index all my Hard Drives.

I sometime knows what the name of the file is, but can't find it. Why should I use the old ways? Isn't this a viable scenario?

When is that going to be fixed?

When Tests Lie

time to read 1 min | 133 words

I'm in VS.Net, writing tests, crunching code; all tests pass, I'm in the green zone, ready to Refactor. Then I decide to drop to Nant and see how my test coverage is. And the tests doesn't work. I've a couple of tests (the ones exersizing the most complex part of the code, naturally) that pass in VS.Net, but fail in NAnt, or when I use them with the console / gui test tool.

Only in Visual Studio.Net + TestDriven.Net they are working. I can't really figure out the reason for this, as far as I can tell, it's has something to do with the currently directory. I'm going to write some tests to change the current directory in VS.Net and see if this makes any difference.

Refactoring NHibernateQueryAnalyzer to glory

time to read 2 min | 235 words

When I created NHibernateQueryAnalyzer I was well aware of TDD design principles and core idea, but I created NQA mainly as a way to familiarize myself with NHiberate's plumbing. Because of that, I didn't bother to write any tests, and did the least amount of work that was required to get the point across.

Shortly after I released it, I found out that people were actually making use of this tool in the wild. I decided that I want to turn that into a real application, and not just demo code. This meant that I need to turn a prototype into an application, without falling into the usual pitfalls. To me, that meant writing tests, and refactoring toward a testable design. NQA is not a large application by any means, but I was not willing to write it from scratch, in this I share Joel's opinion in the matter. There are quite a bit of knowledge there that I would loose if I would write it from scratch.

So I refactored, and keep on doing this. The application currently compile but does not work, and I sort of doing open heart surgery in order to fix some of the bigger Crimes Against Good Design that were commited there.

You can check the wiki page for all of the gory details.

Wiki

time to read 1 min | 122 words

I'm created a Wiki for NHibernate Query Analyzer, which can be reached at http://www.ayende.com/NHibernateWiki/

The main idea is that I'll finally have some place to write documentation when I'm stuck with writing code. As well a place where I can just pour out technical details that are too spesific for the blog.

Currently the most interesting pages will probably be: 

 

Best Firefox Extention for Web Developers

time to read 2 min | 216 words

, it's not the Web Developer Toolbar, although that is very useful by itself. I'm talking about ColorZilla. This is an extention that does quite a bit, but the most important thing that it does to me is that it allows me to point at a part of the page and get it's color (but that is not the reason I like it) and it's class / id identity. Why is this so important, you might ask? In a world of CSS design, this mean that you know what that element is, instead of having to search for it.

complex pages, with complex CSS, porting a site's design is very hard. Take for example my own site, I've a very spesific color scheme that I use, which dictate the use of the following colors: #FDF6E9;#993300; #FFEAAA; #FFEAC0; #FF9933 , etc. When I want to use a web application on my site, I need to convert that to this color scheme. ColorZilla make this porting trivial even in the most complex cases. I'm using it to change FlexWiki's color scheme, and that is a >1000 lines of CSS that I can just jump in and modify thanks to ColorZilla.

Dicology*: The Study Of Names

time to read 2 min | 325 words

I've been reading  Corporate Blogging Guidelines, Draft #2 when I realized that I violate rule #2, I'm using a pseudonym1 for so long that I often forget that I do. :-)

The name originated in my Wheel of Time days, it was in 1997/8 that I started to use this pseudonym2. In the Old Tongue that is used in the Wheel Of Time, The meaning of the name is:

Ayende - Freedom, Rahien - Dawn

So my name is actually "Dawn of Freedom", or "Freedom's Dawn", it was funny at the time. Right now I got so used to that name that whenever I'm on a computer, I am using this name everywhere.

I just did a search my computer, I've 50 items (mostly from purchases I made) under my name in Hebrew, and 30 under my name in English. Searching for 'Ayende', on the other hand, result in 5,536 items3. The last time I installed an OS on my main machine was 2 years and 9 months ago, btw.

And on completely other venue: Only 0 years, 4 months, and 18 days to go.

1A much better word than a nick, and probably the reason that I'm writing this post, so I can remeber it the next time I want to talk about my pseudonym.

2Before I was Barid Bel Medar and published several stories under this name. I can't recall now why I changed the pseudonym, probably I grew tired of it.

3The searches were conducted using MSN Desktop Search.

#Dicology Defination: A made up word consisting of dico - name in Latin and logy - study of.

[Listening to: When You Walk in the Room - Agnetha Faltskog - My Colouring Book(03:36)]

FUTURE POSTS

  1. Implementing low level trie: Part I - one day from now
  2. Implementing low level trie: Part II - 4 days from now
  3. A different sort of cross platform bug - 5 days from now
  4. The edge case is in the timing - 6 days from now

There are posts all the way to Dec 14, 2016

RECENT SERIES

  1. The performance regression in the optimization (2):
    01 Dec 2016 - Part II
  2. Digging into the CoreCLR (4):
    25 Nov 2016 - Some bashing on the cost of hashing
  3. Making code faster (10):
    24 Nov 2016 - Micro optimizations and parallel work
  4. Optimizing read transaction startup time (7):
    31 Oct 2016 - Racy data structures
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats