vote up 78 vote down
star
53

I'm getting married on April 4th, 2009. My future wife has agreed to let me have actual code on top of the wedding cake. Woot!

There isn't very much room, four, maybe five lines (it's only a 6" cake because the main cake is a bunch of cupcakes).

Any language is okay, Java, JavaScript, XML.

A lot of the people attending the wedding have coded before, so they'll "get it".

My name is 'Robert' and her name is 'Tiffany', some sort of creative use of those names would be cool.

What code would you have on your wedding cake?

More code cakes (1) (2) (3) (4) (5)

offensive?
comments (95)

60 Answers:

1 2 next
vote up 148 vote down
Do {
    Have();
    Hold();
} Until Death.Part(Us);
link|offensive?
comments (68)
vote up 12 vote down
while(isAlive) continue;
link|offensive?
add comment
vote up 0 vote down
(function Marriage (love, happiness)  {
    var life = this.HolyMatrimony({
        husband: "yourname", wife: "hername"
    });
    return life.of(love,happiness);
}).bind(vicor,100,100)()
link|offensive?
comments (1)
vote up 112 vote down

You can keep it simple also, and just have:

for( ; ; );

I don't even think you need to say more than that. It's simple and gets the point across. :)

link|offensive?
comments (5)
vote up 43 vote down
if(husband.take(wife) && wife.take(husband)){
  while(!death){
    love();
    honor();
    cherish();
  }
  part();
}
link|offensive?
comments (11)
vote up 69 vote down

What's a wife ? :)

Pesto:

It's a subclass of girlfriend that has unlimited access to your private members but doesn't make good use of it, hogs all available resources, and spawns child processes that you aren't allowed to kill off.

link|offensive?
comments (14)
vote up -4 vote down

$self->birth()->age()->die();

link|offensive?
add comment
vote up 5 vote down

Don't have an answer for you wedding cake, but your 40th anniversary cake code should be in Ruby...

[fetches coat]

link|offensive?
add comment
vote up -3 vote down
Wife Tiffany=new Wife();
Mistress Jenny=new Mistress();
if (! Tiffany.isAround()) Jenny.kiss();
else Tv.watch();
link|offensive?
comments (4)
vote up 23 vote down
while (!husband.isDead() && !wife.isDead()) {
    try {
        marriage();
    } catch (DisagreementException e) {
        continue;
    }
}
link|offensive?
comments (5)
vote up 2 vote down

echo "prenup"

link|offensive?
add comment
vote up 105 vote down
if (wife.allowsCodeOnCake)
{
    this(nerd).hasFoundTrueLove = true;
}
link|offensive?
comments (10)
vote up 8 vote down
double GetBankAccountBalance()
{
   if (isMarried)
   {
      return 0.0;
   }
   else
   {
      return lifeSavings;
   }
}
link|offensive?
add comment
vote up 29 vote down
SELECT wife FROM women WHERE 
  looks=gorgeous AND idealman LIKE 'Robert'
UNION
SELECT husband FROM men WHERE
  job=geek AND loves=Tiffany

OK, so I've got no idea about SQL, but someone with knowledge must be able to knock something up with the rather appropriate keywords like SELECT, JOIN, UNION, LIKE etc.

link|offensive?
comments (3)
vote up 7 vote down
void Relationship.doMarriage(Minister aMinister) {
  Bride lBride = (Bride)self.female;
  Groom lGroom = (Groom)self.male; 

  lBride.walkDownAisle(new WeddingMusic("Arrival of the Queen of Sheba"));

  aMinister.BeginService(WeddingService.Traditional);

  try {
    lGroom.makeVows();
    lBride.makeVows();

    lGroom.Rings++;
    lBride.Rings++;

    self.IsMarried = true;

    lGroom.kiss(lBride);
  } finally {
    aMinister.EndService();
  }
}

Or if that's too long:

Relationship.doMarriage() {
      Groom.makeVows();
      Bride.makeVows();

      self.IsMarried = true;
      Groom.kiss(Bride);
   }
link|offensive?
comments (4)
vote up 2 vote down
private int patienceLevel = 100;
void LiveMarriage()
{
    if (MessageBox.Show("Want to divorce?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
        return;

    //keep on trying
    Thread.Sleep(patienceLevel);
    LiveMarriage();
}

The loads of opportunities to avoid a stackoverflow will come under the concept of a divorce (a meta-joke :-)).

link|offensive?
add comment
vote up 50 vote down
/*
* No need anymore, but plz do NOT erase
*
* class Singleton {...}
*/
link|offensive?
comments (4)
vote up 0 vote down
for account in BankAccounts:

    happiness{"wife"} += 1
    snobbiness{"wife"} += 1
    livingStandardInFiveYears -= 10
    hairLossPerMinute{"male"} += 20
link|offensive?
comments (1)
vote up 10 vote down

What about some Python?


if ' love '.join("Bob", "Tiff") :
   eatThatDamnCake(datetime.datetime.now())
link|offensive?
comments (3)
vote up 6 vote down
#define cake 3.1415

#undef cake          // (cake = lie if you didn't get it)
link|offensive?
comments (2)
vote up 6 vote down
const bool devotion = true;
link|offensive?
comments (2)
vote up 0 vote down

Some in Java...

class Wife extends Girlfriend {}

class Husband extends  Boyfriend {
    private member;
    def get(self, girl) {
        if (isintance(girl, Wife)
            return this.member;
        return null;
    }
}
link|offensive?
comments (3)
vote up 9 vote down

abort();

Only joking of course ;)

link|offensive?
comments (1)
vote up 1 vote down
Do

 love();

 honor();

 cherish();

Loop Until (tiffany.age >= 49 or tiffany.trustfund < 0 or smokingHotOfficeBabe.hookups > 0 )

if (smokingHotOfficeBabe.hookups > 0) return TotalAssets / 2


Sorry, could not resist.

link|offensive?
add comment
vote up 5 vote down
// Java-ish pseudocode
public Happiness marriage(husband, wife) {
  while (true) {
    husband.love(wife);
    wife.love(husband);
    if (bedrooms.size() > family.size() && savings > 0) {
       newChild = fork();
       family.add(newChild);
       savings = 0;
    }
  }
}
link|offensive?
comments (1)
vote up 0 vote down

while(!(death=together))

or

use Marriage;
our $Marriage = Marriage->new(Wife => 'Tiffany', Husband => 'Robert');
do {
   $Marriage;
} until ($death);

link|offensive?
add comment
vote up 36 vote down
public class Girfriend {
   public virtual bool sex() { return true; }
}

public class Wife : Girlfriend {
   public override bool sex() { return false; }
}
link|offensive?
comments (5)
vote up 2 vote down

I speak from experience. Good marriage like good code design employs separation of concerns and proper modularity. I therefore suggest a AOP framework like spring:

<beans default-autowire="byName">
    <bean id="Robert" class="husband" singleton="false">
    	<constructor-arg name="wife">
    		<ref bean="Tiffany" />
    	</constructor-arg>
    </bean>
    <bean id="Tiffany" class="wife" singleton="false">
    	<constructor-arg name="husband">
    		<ref bean="Robert" />
    	</constructor-arg>
    </bean>
</beans>
link|offensive?
comments (3)
vote up 0 vote down

love = true

link|offensive?
add comment
vote up 2 vote down

void* temp; printf("%d", *temp);

link|offensive?
add comment
1 2 next

Your Answer:

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.