Oren Eini

aka Ayende Rahien

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,578
|
Comments: 51,203

Copyright ©️ Ayende Rahien 2004 — 2025

Privacy Policy · Terms
filter by tags archive
stack view grid view
  • architecture (608) rss
  • bugs (450) rss
  • challanges (123) rss
  • community (378) rss
  • databases (481) rss
  • design (894) rss
  • development (640) rss
  • hibernating-practices (71) rss
  • miscellaneous (592) rss
  • performance (397) rss
  • programming (1085) rss
  • raven (1445) rss
  • ravendb.net (529) rss
  • reviews (184) rss
  • 2025
    • May (10)
    • April (10)
    • March (10)
    • February (7)
    • January (12)
  • 2024
    • December (3)
    • November (2)
    • October (1)
    • September (3)
    • August (5)
    • July (10)
    • June (4)
    • May (6)
    • April (2)
    • March (8)
    • February (2)
    • January (14)
  • 2023
    • December (4)
    • October (4)
    • September (6)
    • August (12)
    • July (5)
    • June (15)
    • May (3)
    • April (11)
    • March (5)
    • February (5)
    • January (8)
  • 2022
    • December (5)
    • November (7)
    • October (7)
    • September (9)
    • August (10)
    • July (15)
    • June (12)
    • May (9)
    • April (14)
    • March (15)
    • February (13)
    • January (16)
  • 2021
    • December (23)
    • November (20)
    • October (16)
    • September (6)
    • August (16)
    • July (11)
    • June (16)
    • May (4)
    • April (10)
    • March (11)
    • February (15)
    • January (14)
  • 2020
    • December (10)
    • November (13)
    • October (15)
    • September (6)
    • August (9)
    • July (9)
    • June (17)
    • May (15)
    • April (14)
    • March (21)
    • February (16)
    • January (13)
  • 2019
    • December (17)
    • November (14)
    • October (16)
    • September (10)
    • August (8)
    • July (16)
    • June (11)
    • May (13)
    • April (18)
    • March (12)
    • February (19)
    • January (23)
  • 2018
    • December (15)
    • November (14)
    • October (19)
    • September (18)
    • August (23)
    • July (20)
    • June (20)
    • May (23)
    • April (15)
    • March (23)
    • February (19)
    • January (23)
  • 2017
    • December (21)
    • November (24)
    • October (22)
    • September (21)
    • August (23)
    • July (21)
    • June (24)
    • May (21)
    • April (21)
    • March (23)
    • February (20)
    • January (23)
  • 2016
    • December (17)
    • November (18)
    • October (22)
    • September (18)
    • August (23)
    • July (22)
    • June (17)
    • May (24)
    • April (16)
    • March (16)
    • February (21)
    • January (21)
  • 2015
    • December (5)
    • November (10)
    • October (9)
    • September (17)
    • August (20)
    • July (17)
    • June (4)
    • May (12)
    • April (9)
    • March (8)
    • February (25)
    • January (17)
  • 2014
    • December (22)
    • November (19)
    • October (21)
    • September (37)
    • August (24)
    • July (23)
    • June (13)
    • May (19)
    • April (24)
    • March (23)
    • February (21)
    • January (24)
  • 2013
    • December (23)
    • November (29)
    • October (27)
    • September (26)
    • August (24)
    • July (24)
    • June (23)
    • May (25)
    • April (26)
    • March (24)
    • February (24)
    • January (21)
  • 2012
    • December (19)
    • November (22)
    • October (27)
    • September (24)
    • August (30)
    • July (23)
    • June (25)
    • May (23)
    • April (25)
    • March (25)
    • February (28)
    • January (24)
  • 2011
    • December (17)
    • November (14)
    • October (24)
    • September (28)
    • August (27)
    • July (30)
    • June (19)
    • May (16)
    • April (30)
    • March (23)
    • February (11)
    • January (26)
  • 2010
    • December (29)
    • November (28)
    • October (35)
    • September (33)
    • August (44)
    • July (17)
    • June (20)
    • May (53)
    • April (29)
    • March (35)
    • February (33)
    • January (36)
  • 2009
    • December (37)
    • November (35)
    • October (53)
    • September (60)
    • August (66)
    • July (29)
    • June (24)
    • May (52)
    • April (63)
    • March (35)
    • February (53)
    • January (50)
  • 2008
    • December (58)
    • November (65)
    • October (46)
    • September (48)
    • August (96)
    • July (87)
    • June (45)
    • May (51)
    • April (52)
    • March (70)
    • February (43)
    • January (49)
  • 2007
    • December (100)
    • November (52)
    • October (109)
    • September (68)
    • August (80)
    • July (56)
    • June (150)
    • May (115)
    • April (73)
    • March (124)
    • February (102)
    • January (68)
  • 2006
    • December (95)
    • November (53)
    • October (120)
    • September (57)
    • August (88)
    • July (54)
    • June (103)
    • May (89)
    • April (84)
    • March (143)
    • February (78)
    • January (64)
  • 2005
    • December (70)
    • November (97)
    • October (91)
    • September (61)
    • August (74)
    • July (92)
    • June (100)
    • May (53)
    • April (42)
    • March (41)
    • February (84)
    • January (31)
  • 2004
    • December (49)
    • November (26)
    • October (26)
    • September (6)
    • April (10)
Deep Dive into RavenDB webinars
  previous post next post  
Jun 16 2008

I understand that naming matters, so...

time to read 1 min | 28 words

Which should I use?

This:

image

Or this:

image

Tweet Share Share 44 comments
Tags:
  • Design

  previous post next post  

Comments

Peter Ritchie
16 Jun 2008
14:02 PM
Peter Ritchie

I would avoid IIgnoreFilesSpecification to avoid confusing it with a Specification pattern implementation.

Guy
16 Jun 2008
14:35 PM
Guy

How about "IIgnorable"?

Jack
16 Jun 2008
14:35 PM
Jack

I'd go with the first one, seeing the 2 I's next to each other gives me a headache. :)

jonnii
16 Jun 2008
14:35 PM
jonnii

public interface IFileFilter{

bool ShouldProcess(bool file);

}

??

Rik Hemsley
16 Jun 2008
14:36 PM
Rik Hemsley

Using the 'I' at the beginning of an interface name as the first person singular personal pronoun is not a naming convention I recognise so I'd prefer the latter.

Drakiula
16 Jun 2008
14:37 PM
Drakiula

What about 'public interface IIgnoredFilesRecognizer'?

Rik Hemsley
16 Jun 2008
14:37 PM
Rik Hemsley

Oh and I agree with jonnii - that's a much better name.

Tuna Toksoz
16 Jun 2008
14:38 PM
Tuna Toksoz

Both sounded weird to me.

IIgnorableFileSpecifier? maybe?

Mike D
16 Jun 2008
14:43 PM
Mike D

IFileFilter gets my vote

Julian Birch
16 Jun 2008
14:48 PM
Julian Birch

I agree naming is important, but how about Predicate<string>?

Ayende Rahien
16 Jun 2008
14:52 PM
Ayende Rahien

Predicate is useless, it doesn't tell me what it does.

orcmid
16 Jun 2008
15:02 PM
orcmid

We are trapped in the world of having to name a method and a class to get it right. Wonderful. There are days when I wonder whether we should bring back pure functions and maybe namespaces.

Without more context, this is difficult, but the first one seems to provide information and the second is simply a mystery (requiring far more context to be sensible).

IFileFilter seems too broad and IIgnorable seems even more so.

What I don't get about this interface is (1) that it is an interface but (2) we have to provide a file name. So what kind of object has that interface?

Juliano Nunes
16 Jun 2008
15:03 PM
Juliano Nunes

IFileFilter or IFileContract

Ayende Rahien
16 Jun 2008
15:06 PM
Ayende Rahien

public class OldSvnBridgeFilesSpecification : IIgnoreFilesSpecification

{

public bool ShouldBeIgnored(string file)

{

    return Path.GetExtension(file) == ".svnbridge";

}

}

Julian Birch
16 Jun 2008
15:13 PM
Julian Birch

Well, you still get to name the variable...

Predicate<string> ignoreFilesSpecification = new OldSvnBridgeFilesSpecification().ShouldBeIgnored;

For instance.

But it really depends on how you're using the class, which I guess has always been the point.

Josh
16 Jun 2008
15:15 PM
Josh

+1 for jonnii

Steve
16 Jun 2008
15:29 PM
Steve

I like descriptive names, even if longer.

Mike
16 Jun 2008
15:33 PM
Mike

I like prefer ending with 'Specification' for naming standard purposes...It helps too if I need to do a resharper Ctl+N with "*Specification" .

I would actually use IDisregardFilesSpecification or IIneligibleFilesSpecification naming.

Shaun
16 Jun 2008
15:39 PM
Shaun

I like IFileFilter

Keith Elder
16 Jun 2008
16:01 PM
Keith Elder

This reminds me of ICanLayEggs and IEggable! :)

http://deepfriedbytes.com/podcast/episode-2-interview-war-stories/

David Buksbaum
16 Jun 2008
16:55 PM
David Buksbaum

+1 for the IFileFilter by jonnii

I think this makes it specific enough for the meaning to be understood, and general enough to promote reuse beyond the current context.

One other thing, is to possibly make this work in a chain, such that a series of IFileFilter's could be applied to jointly decide if the file should be ignored.

David

Shawn Neal
16 Jun 2008
16:59 PM
Shawn Neal

Why do we love to talk about naming conventions/names so much?

Tobin Harris
16 Jun 2008
17:23 PM
Tobin Harris

public interface Ignorant

{

bool Ignores(string test);

}

:-)

Raja Nadar
16 Jun 2008
18:25 PM
Raja Nadar

how about IIgnoreFiles? [IVerbNoun since IAdjective (IIgnorable) doesn't sound good]

Alex Simkin
16 Jun 2008
19:56 PM
Alex Simkin

IDisregarding<T> or IDisregardable<T> or IPayingNoAttentionTo<T>

Avish
16 Jun 2008
20:00 PM
Avish

If that interfaces is only used to recognize the SCM's meta-files (or whatever you call the .svnbridge folders), call it by that name and use it in that way:

IMetaFileLocator.IsMetaFile(string filename)

If it's supposed to be used to identify all files that should be ignored (during what? that's a key question), then I think the notion of an "excluder" -- that is, something that excludes files from general filespecs -- will work better:

IFileExcluder.ShouldExclude(string filename)

This suits the scenario where it makes sense to combine several of these, for example the default one that excludes meta-files, another one that excludes files based on svn:ignore properties, etc.

If there's no need to combine exclusions, then jonnii's FileFilter suggestion -- making the interface say which files should be processed, rather than which files should not be processed -- is slightly more intuitive IMO.

Alex Simkin
16 Jun 2008
20:15 PM
Alex Simkin

One more:

IPicky with method Refuse

Kenneth LeFebvre
16 Jun 2008
20:45 PM
Kenneth LeFebvre

For what it's worth, I like your idea of using the "I" as a first-person pronoun!

I tend to not use an "I" at all on my interfaces, rather ending my interface names with "Interface" or "Contract". But, I am also a big fan of active voice in my names (actually, in all of my writing, really) so if I used the Hungarian Eye naming convention for interfaces, I would probably go with your first proposal...

John Rayner
16 Jun 2008
22:37 PM
John Rayner

I prefer method names to be verbs in the present tense. So I'd be similar to jonnii:

public interface IFileFilter

{

bool ShouldIgnore( string filename );

}

firefly
17 Jun 2008
01:21 AM
firefly

IAmWhateverYouAndYourTeam can understand and agree on is good enough. I wouldn't stress over some name. Some XML documentation wouldn't hurt either.

Ken Egozi
17 Jun 2008
06:17 AM
Ken Egozi

Started my comment here, moved it to my blog:

http://www.kenegozi.com/Blog/2008/06/17/naming-interfaces.aspx

In short - be specific. Either of Ayende's offers are good, IFileFilter is not my preference.

Sidar Ok
17 Jun 2008
09:00 AM
Sidar Ok

ICanIgnoreFiles :)

Patrik
17 Jun 2008
13:18 PM
Patrik

Depending on where this is used there's a good chance that I'd go with something like this:

public delegate bool FileFilter(string fileName);

If not that I'd go with the IFileFilter-interface.

Alessandro Riolo
17 Jun 2008
14:05 PM
Alessandro Riolo

I agree with Ken about the name of the interface.

That said, in English "should" doesn't convey the meaning of absolute necessity. In example, as per RFT 2119, "SHOULD .. mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.", while "MUST .. " ( or "REQUIRED" or "SHALL") ".. mean that the definition is an absolute requirement of the specification.", thus I would advice care also on the naming of the method. In layman's terms, is really ShouldBeIgnored or should be MustBeIgnored?.

Jeff Tucker
17 Jun 2008
18:35 PM
Jeff Tucker

So should the chicken class implement ILayable or ICanLayEggs then?

Mats Helander
18 Jun 2008
05:02 AM
Mats Helander

IFilesThatNeedToBeIgnoredRecognizer?

/Mats

Marc Wrobel
18 Jun 2008
06:07 AM
Marc Wrobel

The first one, since IIgnoreFileSpecification doesn't talk to me very much.

Steve Freeman
18 Jun 2008
18:24 PM
Steve Freeman

Surely it depends on the context in which the interface is to be used?

  • using the 'I' wart to refer to the object just seems wrong to me. We should do everything we can to ignore this unnecessary noise.

  • since it's a string, that's a "filename" or "pathname", not a "file".

Benny Thomas
19 Jun 2008
13:46 PM
Benny Thomas

IFileIgnoranceRule

Steve Campbell
19 Jun 2008
13:55 PM
Steve Campbell

An interface with a single method is generally part of a strategy pattern. Given that, I would choose option 1, because it is indicative of what the strategy is for (recognizing files that need to be ignored). I can use the name of the option 1 interface in a conversation and its purpose will be clear.

Option 2 has a more concrete (implementation) feel to it (FileSpecification). It also uses "Ignore" as a verb, which in my interpretation is not what it does (it does not actually do the ignoring, only the recognition).

Ray
19 Jun 2008
20:25 PM
Ray

IIgnorantFile :-)

Back on a serious note, I think IFileIgnore is best suggested name. Altho, I prefer Exclude instead of Ignore.

Kirill Osenkov
22 Jun 2008
00:48 AM
Kirill Osenkov

I agree with Julian, a delegate can be nicer than an interface here. Just think of all the benefits you can get with lambdas.

If you don't like that Predicate<T> is too generic (sic!), you can define your own:

public delegate bool FileFilter(string fileName);

Also, let us know what was your final decision. I'd be curious :)

Daniel Kolman
24 Jun 2008
13:09 PM
Daniel Kolman

+1 for the IFileFilter by jonnii

But IMHO this discussion is great example of a fact that solving any problem without context is waste of time.

Ohad Aston
25 Jun 2008
07:33 AM
Ohad Aston

The class that implement this interface should RECOGNIZE IF A FILE SHOULD BE IGNORED why calling it IFileFilter?

Call it IDoSomething and you solve the problem

Comment preview

Comments have been closed on this topic.

Markdown formatting

ESC to close

Markdown turns plain text formatting into fancy HTML formatting.

Phrase Emphasis

*italic*   **bold**
_italic_   __bold__

Links

Inline:

An [example](http://url.com/ "Title")

Reference-style labels (titles are optional):

An [example][id]. Then, anywhere
else in the doc, define the link:
  [id]: http://example.com/  "Title"

Images

Inline (titles are optional):

![alt text](/path/img.jpg "Title")

Reference-style:

![alt text][id]
[id]: /url/to/img.jpg "Title"

Headers

Setext-style:

Header 1
========
Header 2
--------

atx-style (closing #'s are optional):

# Header 1 #
## Header 2 ##
###### Header 6

Lists

Ordered, without paragraphs:

1.  Foo
2.  Bar

Unordered, with paragraphs:

*   A list item.
    With multiple paragraphs.
*   Bar

You can nest them:

*   Abacus
    * answer
*   Bubbles
    1.  bunk
    2.  bupkis
        * BELITTLER
    3. burper
*   Cunning

Blockquotes

> Email-style angle brackets
> are used for blockquotes.
> > And, they can be nested.
> #### Headers in blockquotes
> 
> * You can quote a list.
> * Etc.

Horizontal Rules

Three or more dashes or asterisks:

---
* * *
- - - - 

Manual Line Breaks

End a line with two or more spaces:

Roses are red,   
Violets are blue.

Fenced Code Blocks

Code blocks delimited by 3 or more backticks or tildas:

```
This is a preformatted
code block
```

Header IDs

Set the id of headings with {#<id>} at end of heading line:

## My Heading {#myheading}

Tables

Fruit    |Color
---------|----------
Apples   |Red
Pears	 |Green
Bananas  |Yellow

Definition Lists

Term 1
: Definition 1
Term 2
: Definition 2

Footnotes

Body text with a footnote [^1]
[^1]: Footnote text here

Abbreviations

MDD <- will have title
*[MDD]: MarkdownDeep

 

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. Recording (16):
    29 May 2025 - RavenDB's Upcoming Optimizations Deep Dive
  2. Webinar (6):
    27 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

RECENT COMMENTS

  • What a massive presentation! As a person who spent some time with a db written in .NET I can strongly relate to some points. ...
    By Scooletz on Recording: RavenDB's Upcoming Optimizations Deep Dive
  • I’d love to learn your thoughts on SPANN https://arxiv.org/abs/2111.08566 that with centroids and keeping the posting lists s...
    By Scooletz on Comparing DiskANN in SQL Server & HNSW in RavenDB
  • Joel, The DiskANN paper talks about it being viable for more than a billion vectors datasets.  In such a scenario, it would ...
    By Oren Eini on Comparing DiskANN in SQL Server & HNSW in RavenDB
  • Do you know why they chose DiskANN? These things are usually about tradeoffs but it seems DiskANN is just worse in every way.
    By Joel on Comparing DiskANN in SQL Server & HNSW in RavenDB
  • Scooletz, Yes, we look at other stuff. Most of those are _not_ allowing you to build themselves incrementally nor are they...
    By Oren Eini on Scaling HNSW in RavenDB: Optimizing for inadequate hardware

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats
}