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)
RavenDB Workshops - Deep dive into practical use of Document Data Modeling
  previous post next post  
Nov 07 2008

Joking in Code

time to read 1 min | 61 words

People has started to use the comments of the previous post for putting programming jokes. Let us make this formal. I want to see code that is funny, or jokes in code.

The condition is that it has to be production worthy code. No perl poetry or things that you can do with the language just because you can.

Tweet Share Share 13 comments
Tags:
  • Humor

  previous post next post  

Comments

josh
07 Nov 2008
01:35 AM
josh

This was in some very old VB6 COM+ production code, that I yanked when I found it. The dev was in a bad mood at having to learn xml:

Do Until InStr(1, sXML_Input, " <question", vbTextCompare) = 0

i = i + 1

sXML_Input = Replace(sXML_Input, "

<question", "Bah!", 1, 1, vbTextCompare)

Loop

Do Until InStr(1, sXML_Input, "Bah!", vbTextCompare) = 0

sXML_Input = Replace(sXML_Input, "Bah!", "

<question", 1, 1, vbTextCompare)

Loop

This was the best his code was riddled with string manipulation on an XML string (splitting into an array on >< and then loading each element into a dom), that is just to pathetic and sad to post. But any time I need a morale boost I just go reread his old crud;-)

Ken Sykora
07 Nov 2008
03:34 AM
Ken Sykora

You should check out the daily wtf (thedailywtf.com). All kinds of gold in that mine.

Francois Germain
07 Nov 2008
04:29 AM
Francois Germain

We used to joke a lot around the office when I found out that one of my peer was actually trimming the length of the recordcount property of ADO recordsets all over our import and export back end.

dim rstTest as adodb.recordset

set rstTest = library.sqlserver.getrecordset(strsql)

if len(trim(rstTest.recordcount)) = 0 then

'Do some work

End if

I was so happy when this guy left... :)

xenolinguist
07 Nov 2008
05:23 AM
xenolinguist

Once upon a time, I saw this in some production C code:

define THEISM_BLIGHTS_HUMANITY 1

...

while (THEISM_BLIGHTS_HUMANITY) 

/* obviously, this is always true */

{

    ...

} 
Benny Thomas
07 Nov 2008
07:47 AM
Benny Thomas

@Francois Germain

Code like that was in 2 big productionsystems written by a coworker of mine.

One other big issue I had with his codingstyle was his argument for writing long transactional scripts because he liked to see everthing the code did.

He invented his own law to. There should never be more then 3 method steps in code before you find the code that writes the data to the database. His coding was not PI can you say.

Needless to say, I left that company.

Remco
07 Nov 2008
12:38 PM
Remco

Taken from thedailywtf.com/.../...er_Friday_Smorgasbord_.aspx

Scott Stanchfield was tasked with optimizing memory usage in a Java application and found a way to shave a few bytes left in by an intern with a sense of humor ...

public class ValidationMessage

{

//internal members

string messageId;

string messageText;

string helpLink;

/* ... */

double cheeseburger;

char broiled;

long time;

//helper functions

/* ... */

}

Will
07 Nov 2008
15:01 PM
Will

It's been a while and since I don't work there anymore I won't be entirely accurate on the method name. But...

At a former company we were doing a code review. I came across a method that looked a little fishy:

private bool ThisIsNotTheContactWeAreLookingFor(...){ ... }

Of course, I raised question of if we should be injecting Jedi mind tricks into our code.

Jesse
07 Nov 2008
17:16 PM
Jesse

I have been reviewing an application written by some folks off-site. They took a convention of prefixing classes, methods, members, etc with a common two or three letter prefix related to the business function that the class/method/member supported.

One of the main components of the application deals with 'Assessments', and for some reason they chose to use 'ass' as the prefix. This obviously made for some pretty funny method names, but my favorite so far is a method that loads assessments on the screen, aptly called:

'Private Sub AssLoad()'

Frank Quednau
07 Nov 2008
19:15 PM
Frank Quednau

In VB Code I always wrote "On Error Goto Hell". We quite liked the idea in java of writing "throws Shit".

Back in the days when I was in full Procedural steam and wrote a massive servlet handling all sorts of web forms, I used an ASCII-art of the Simpsons Family to separate two sections of the file. Suffice to say, the customer at some point got their hands on the code (also finding the comment "this *** is a dealer" and the int "my***index").

Back then I had to apologize to the customer. What a bunch of humourless saps. I think that's when I got traumatized. Now I only write the bare minimum of code that will do the trick. Oh, and the files are smaller. Reduces the pain.

Yoni Shalom
08 Nov 2008
16:43 PM
Yoni Shalom

An autocomplete function :

public List <isearchresult ISpyWithMyLittleEyeSomethingThatStartsWith(string prefix) {...}.

:)

Yoni Shalom
08 Nov 2008
16:50 PM
Yoni Shalom

Racist code is sometimes nice too, if taken in right proportions :

function :

public void StartTransfer(IList <object objects);

test code :

IList <object palestinians = /* initialization... */;

StartTransfer(palestinians);

Mike Minutillo
09 Nov 2008
00:06 AM
Mike Minutillo

The other day for a demonstration of extension methods I got to write:

public static bool IsIn <t(this T wally, IEnumerable <t crowd )

{

return crowd.Contains( wally );

}

I'm also a big fan of naming things correctly but not getting hung up on it if you can't think of a good name (after all we have refactoring tools) so for a while I had a system with repositories that implemented ICanGetYouA <t>

Karl
13 Nov 2008
12:48 PM
Karl

string body = message.Body.ToString();

string [] bodyparts = body.Split(',');

string head = bodyparts[0]

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
}