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,565
|
Comments: 51,185
Privacy Policy · Terms
filter by tags archive
time to read 2 min | 254 words

As long as I am talking about reducing pain, here is a sample from a very secret project that I am woring on. I have a lot of parameters for the build script, and it got to be a PITA to try to manage them manually. There are several kinds of builds that I can do here, test, production, DB rebuilds, deploy, etc.

This quick (and very dirty) solution took about an hour of coding to build properly, and I just added some minor details after the intial build, enough to make it even more useful.

It is a build parameters UI for MSBuild, which basically display all the PropertyGroup elements, and apply simple heuristics for trying to figure out what the values are. For instnace, it can discover boolean values (and display check boxes), and clicking on the "..." buttons will display an Open File, Browse Folder, or Connection String dialogs, as appropriate.

As I said, it took about an hour (I wanted to leave it to my team-mates when I was at DevTeach), and it paid back in time, effort and sheer pleasure many times since. 

If you are a developr and you have some pain points, fix them, it will be well worth it.

(Yes, Roy, I know that Final Builder has a prettier interface :-) )

BuildEditor.png

 

time to read 2 min | 349 words

Well, when the wheel is a square, of course:

© Performance Management Company, 1993 
Square Wheels® is a registered trademark of Performance Management Company

Adi asks about my seemingly inconsistent behavior regarding when to roll your own, and when to use the stuff that is already there:

I find it difficult to understand Oren. Sometimes he'd rather write his own code from scratch (Rhino mocks), but he keeps preaching the use of known OSS solutions, such as Rails, NHibernate, or the Castle project.

What can I say, I have a Pavlovian conditioning with regards to software, I tend to avoid software that cause me pain. Let me quote David Hayden about the CAB and SCSF:

I have never had the pleasure of working with the Composite Application Block ( CAB ) or Smart Client Software Factory ( SCSF )

That is quite telling. And I don't think that anyone can say that David is not very well familiar with the CAB/SCSF.

Why do I promote OSS solutions such as NHibernate, Castle?

  • Those solutions are (nearly) painless. In fact, they are often elegant and fun to work with. As an example, I worked with a team member today, introducing him to NHibernate Query Generator, he was very happy about it. Talk about painless persistence.

Why did I decide to write my own Mocking Framework instead of using the standard one (at the time)?

  • NMock, the mocking framework that I used at the time (2005), was annoying as hell for the agile developer. Bad support for overloads, no way to Lean On The Compiler and No ReSharper. It was a pain to use. I wrote my own, and I like using it. Incidently, it looks like a lot of other people are liking it, but that isn't why I wrote it.

Removing pain points will make you a better developer, period.

Oh, and I do enjoy the discussion, although I wouldn't call it a post war.

time to read 1 min | 85 words

Right now Brail has no 1st class support for generating XML, like RoR's rxml. I just run into BooML, and it looks like a really great way to handle this issue. MonoRail doesn't (yet) has the notion of multiply DSLs, just standard templates and JS generation. Looks like that is the way I would go when I next need to support XML with MonoRail.

I knew there was a reason why I liked Boo so much :-)

time to read 8 min | 1508 words

On Castle Dev, Chris has asked the following question, how can you build the common "empty" template with Brail? NVelocity makes it very easy:

#foreach $item in $items

#each

      $item

#nodata

      No Data!

#end

But Brail makes it more cumbersome. There are solutions using view components, but they are too much, all too often. So, can we find an elegant solution to the problem?

As it turn out, yes (otherwise I probably wouldn't write this post :-) ). Brail is based on Boo, and Boo has extension methods... Another concept that Brail has is "Common Scripts", a set of helper methods that can be used across all the views in the application. Here is the script that I put in /Views/CommonScripts/extensions.brail:

[Boo.Lang.ExtensionAttribute]

static def IsEmpty(val as object) as bool:

      if val isa System.Collections.ICollection:

            return cast(System.Collections.ICollection,val).Count == 0

      end

      return true

end

Now you have extended all the objects in the application, so we can use it like this:

<%

    for item in items:

        output item

    end

    output "No Data" if items.IsEmpty

%>

I like that :-) The notion can be extended to more complex issues, naturally, such as ToXml extension method, etc. In fact, you can even forward calls to C# code, so that makes it even more powerful (I assume (and suggest against) that you aren't going to write a lot of code in the extensions).

time to read 1 min | 93 words

So I can eat it (No Scott, I will not go to that resturant again, I know they can probably serve both, but the salad scares me). Appernatly CodePlex is adding Subversion support. What I would really like to know if it would have the same integration that the TFS backend would have as well.

At any rate, I would like to take this opportunity to apologize to the CodePlex team, I would have never believed that you would do it, way to go!

time to read 5 min | 812 words

I have several ways of categorizing code. Production quality, test, demo, and utilities. When I am talking about utilities, I am talking about little programs that I use to do all sorts of small tasks. There I rarely worry about maintainability, and today there was a gem here:

public delegate Control BuildSpecialCase(TextBox textbox);

private BuildSpecialCase GetSpecialCaseControl(string name)
{
 if (name.IndexOf("ConnectionString", StringComparison.InvariantCultureIgnoreCase) != -1)
 {
  return delegate(TextBox t)
  {
   Button change = new Button();
   change.Click += delegate { t.Text = PromptForConnectionString(t.Text); };
   change.Dock = DockStyle.Right;
   change.Text = "...";
   change.Width = 30;
   return change;
  };
 }
 if (name.IndexOf("File", StringComparison.InvariantCultureIgnoreCase) != -1)
 {
  return delegate(TextBox t)
  {
   Button change = new Button();
   change.Click += delegate
   {
    OpenFileDialog dialog = new OpenFileDialog();
    dialog.Multiselect = false;
    dialog.FileName = t.Text;
    if (dialog.ShowDialog(this) == DialogResult.OK)
    {
     t.Text = dialog.FileName;
    }
   };
   change.Dock = DockStyle.Right;
   change.Text = "...";
   change.Width = 30;
   return change;
  };
 }
 if (name.IndexOf("Folder", StringComparison.InvariantCultureIgnoreCase) != -1 ||
  name.IndexOf("Dir", StringComparison.InvariantCultureIgnoreCase) != -1)
 {
  return delegate(TextBox t)
  {
   Button change = new Button();
   change.Click += delegate
   {
    FolderBrowserDialog dialog = new FolderBrowserDialog();
    dialog.SelectedPath = t.Text;
    if (dialog.ShowDialog(this) == DialogResult.OK)
    {
     t.Text = dialog.SelectedPath;
    }
   };
   change.Dock = DockStyle.Right;
   change.Text = "...";
   change.Width = 30;
   return change;
  };
 }
 return null;
}

Can you figure out what is going on?

As long as we are talking about unmaintainable code, here an example from code meant for production that I just wrote:

IDictionary<Customer, IDictionary<string, IList<Policy>>> namedPoliciesByCustomers = new ...;

But for that I have tests :-)

time to read 2 min | 363 words

Scott Hanselman has a post titled: Is Microsoft losing the Alpha Geeks?

The collective group in the discussion at RailsConf seemed to agree that Microsoft should make not just the DLR source available, but actually create a non-profit organization, ala Mozilla, and transfer the developers over to that company. They should allow commits to the code from the outside, which should help get around some of the vagaries of the GPL/LGPL licensed Ruby Test Suites. "IronRuby" should be collectively owned by the community.

In general, I would think that such an organization would be a Good Thing, but it is completely irrelevant to bring the OSS issue into the discussion.

The reason that the "Alpha Geeks" are moving (moved?) from the Microsoft's stuff is very simple. Microsoft's stuff doesn't scale. It doesn't scale for development, it doesn't scale for ease of use, it doesn't scale for elegance.

Microsoft is very focused on the creation of software, but much less focused on working with software. This means that a lot of the issues that arise from working with a large code base over a long period of time have no answer from Microsoft except starting anew. Putting stuff out as OSS wouldn't change that as long as this is the overruling mindset at Microsoft.

Most of the OSS project has a very different mindset than that, but Microsoft is basically just making the source repository public, not OSSing projects. (To be rather exact, they don't work on OSS with the same mindset that other OSS project has, which is highly constrained resources).

I think that part of the problem is that MS is listening to Big customers, which may want what they are supplying, lot of wizards == cheap programmers. By doing so, they are losing the entire Long Tail, and almost by definition, the Alpha Geeks are at the head of the long tail.

time to read 1 min | 144 words

This seems like an obvious way, but it is worth mentioning. I was reviewing the search phrases people use to get to my site, and I found some... extremely explicit ones. Not what you would expect on this site. Repeating the search in google brought me a to a post that had several spam comments of the more nasty side. That gave me the idea of trying:

site:ayende.com explicit-word-or-phrase

I found a lot of those, sadly, and I was able to remove ~50 or so spam comments fairly easily. The main issue with spam is separating the chaff from grain, google made it very easy to find the bad stuff.

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. Production Postmortem (52):
    07 Apr 2025 - The race condition in the interlock
  2. RavenDB (13):
    02 Apr 2025 - .NET Aspire integration
  3. RavenDB 7.1 (6):
    18 Mar 2025 - One IO Ring to rule them all
  4. RavenDB 7.0 Released (4):
    07 Mar 2025 - Moving to NLog
  5. Challenge (77):
    03 Feb 2025 - Giving file system developer ulcer
View all series

RECENT COMMENTS

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats
}