Ayende @ Rahien

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


+972 52-548-6969

, @ Q c

Posts: 6,026 | Comments: 44,842

filter by tags archive


Frank Quednau

I tend to say that the best line of code is the one you never wrote, but this is the next best thing.

Kelly Stuard

So obviously that means it does 30% less now. Or that you put 30% of the code on one line. Oh, I know ... the curley braces are no longer on their own line! Because, of course, there is no way to get rid of or refactor code.

Kelly Stuard

BTW: not liking that I have to fire up an alternate browser to IE8 to post comments - not even compat mode works

Kelly Stuard

Oh, and there was a tag at the end of the first post; but I guess it got eaten.


YUICompressor for CSharp :-)


Clearly this:

class SqlStatement { public string Whatever { get { return whatever; } set { whatever = value; } } private string whatever; ... }

is much better than this:

class SqlStatement {

public string Whatever {

  get {

     return whatever;


  set {

     whatever = value;



private string whatever;



Jeremy Wiebe

So did some of the functionality move to other classes or were you really able to remove ~300 lines and maintain similar functionality?

Erik van Brakel


Sometimes, putting stuff on one line makes the whole more readable. I often use that with properties, to cut down on the curly-braces-porn that's going on in there:

public string Whatever { get { return whatever; } set { whatever = value; } }

public string Whenever { get { return whenever; } set { whenever = value; } }

public string However { get { return however; } set { however = value; } }

Or, if you don't like it like that:

public string Whatever


get { return whatever; }

set { whatever = value; }


En then continue using proper spacing in the rest of the code. Those properties are SO obvious that you don't really need to space it out over 8 lines.

Either way, I don't think Ayende just removed whitespace, else he wouldn't be so happy with it ;-)

Ian Nelson

Admit it Ayende, you moved 300+ lines of code to static methods in a SqlStatementHelper class? ;-)

Ayende Rahien


I create a separate class for handling that

Ayende Rahien


Almost, it is called SqlStatementProcessor, and it is a command object

Jeremy Wiebe

Ah, so the refactoring was geting SqlStatement to be more focused. I'm always a big fan of those types of refactorings. :-)


So you didn't just randomly comment lines out and cross your fingers when hitting compile?

I remember going from a prototype to a 'v0.1' the code was about a fifth the size, was faster, easier to program against and was far more extensible..

I don't think thats so uncommon for a prototype to be 'obese' but it was really nice that its evolution was so much smaller and yet tons better.

(usual day for a dev right? I always enjoy that feeling anyway, I do a lap around the office for high fives borat style).

Comment preview

Comments have been closed on this topic.


No future posts left, oh my!


  1. Technical observations from my wife (3):
    13 Nov 2015 - Production issues
  2. Production postmortem (13):
    13 Nov 2015 - The case of the “it is slow on that machine (only)”
  3. Speaking (5):
    09 Nov 2015 - Community talk in Kiev, Ukraine–What does it take to be a good developer
  4. Find the bug (5):
    11 Sep 2015 - The concurrent memory buster
  5. Buffer allocation strategies (3):
    09 Sep 2015 - Bad usage patterns
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats