211

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) (6)

288 accepted
Do {
    Have();
    Hold();
} Until (Death == True);
216

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. :)

205
if (wife.allowsCodeOnCake)
{
    this(nerd).hasFoundTrueLove = true;
}
194

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.

126
public class Girlfriend {
   public virtual bool sex() { return true; }
}

public class Wife : Girlfriend {
   public override bool sex() { return false; }
}
104
/*
* No need anymore, but plz do NOT erase
*
* class Singleton {...}
*/
90

A nice little marital crontab:

# DO NOT EDIT THIS FILE - until death
# (/marriage/crontab.XXX installed on Sat Apr  4 11:26:10 2009)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
0 21 * * * unzip; strip; touch; grep; finger; mount; fsck; more; yes; umount; sleep
75
if(husband.take(wife) && wife.take(husband)){
  while(!death){
    love();
    honor();
    cherish();
  }
  part();
}
73

I'd simply have On Error Resume Next

66
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.

58

while( true ) love++;

50

It isn't technically code but I would put simply:

F1

41

Be careful when trying to cast a girlfriend as a wife. There are several interfaces supported by iGirlFriend that aren't supported by iWife.

40
while (!husband.isDead() && !wife.isDead()) {
    try {
        marriage();
    } catch (DisagreementException e) {
        continue;
    }
}
23

What about some Python?


if ' love '.join("Bob", "Tiff") :
   eatThatDamnCake(datetime.datetime.now())
21

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

[fetches coat]

19
while(isAlive) continue;
18
double GetBankAccountBalance()
{
   if (isMarried)
   {
      return 0.0;
   }
   else
   {
      return lifeSavings;
   }
}
18
// Variables Robert & Tiffany are integer representations
// of the actual people.
(Robert ^ Tiffany) == uint.MaxValue;

In case you don't get this one it is essentially saying that Tiffany is the perfect complement to Robert.

15
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);
   }
15

girlfriend attacks you:
  save -vs- marriage...roll:2
You are now marred.

13
const bool devotion = true;
12

abort();

Only joking of course ;)

12

If I was you, I would think about what a big, stinky nerd I was being and not go through with this :). Leave coding at home on your wedding day, your wife (and all the guests) will thank you.

11
Wife Tiffany=new Wife();
Mistress Jenny=new Mistress();
if (! Tiffany.isAround()) Jenny.kiss();
else Tv.watch();
11

I had the following on my grooms cake back in 2006. I think they changed their tab sizes halfway through it though.

alt text

9
// 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;
    }
  }
}
9
wife++;
while (stillMarried)
{
    bankBalance--;
}
8
#define cake 3.1415

#undef cake          // (cake = lie if you didn't get it)
8

GAME OVER

:-)

5

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>
5

no COBOL code? how about some brainfuck? :D

i'd go with a simple java method

public static int howLongIWillLoveYou() {
   int time = 0;    
   while (true) {
     time++;
   }
   return time;
}

cheesy, yes, but it can also be your homage to this site. ^_^

congratulations btw

5
if(Love())  
  {
  Marriage();
  }

Compiler Error M0001: Love is unconditional.

5
$husband = argument ? right : happy
4

Some in Java...

import highschool.BoyFriend;
import highschool.GirlFriend;

public class Husband extends BoyFriend {

    private long member;
    private class Wife extends GirlFriend {};

    public long get(Object girl) {
        if (isintance(girl, Husband.Wife))
            return this.member;
        return 0l;
    }
}
4

while(true) Robert.Love(Tiffany);

3

Not quite code, but might appeal to a wider audience:

From: This Day
To: Have, Hold, Love, Cherish
For: Better, Worse, Richer, Poorer
In: Sickness, Health
Date: 2009-04-09

Subject: Robert & Tiffany
Congratulations!

Attachment:
Content-Type: "application/octet-stream"; name="Celebrant-v1.0"

-- Generated by cake.php
3

Your wife is just the coolest!!

    While(true){
RobertLoveToTiffany++;}
3
Person robert = new Person("Robert");
Person tiffany = new Person("Tiffany");
robert.Heart.BelongsTo(tiffany, new TimeSpan("Always"));
3
int i, love, u;

for (i=1; i<u ; i++) love=u++;

Obviously it is an infinite love.

3

How about one of the classics, that more people have a chance of recognising / understanding?

10 LOVE
20 GOTO 10

Someone can probably come up with something better for that first line...

3
Person robert = new Person();
Person tiffany = new Person();
if( robert.take( tiffany ) && tiffany.take( robert ) ) {
  this.eat()
  while( !( robert.death || tiffany.death ) ) {
    liveHappily( robert, tiffany );
  }
  part( robert, tiffany );
}
3

Here's my Java version:

while (death != true) {
    try {
        goodTimes();
        badTimes();
        haveKids();
        growOld();
    }
    catch (ReconcilableException e) {
        makeUp();
        continue;
    }
    catch (UnreconcilableException e) {
        if (counsuling())
            continue;
        else 
            divorce();
    }
}

Yea, it's more than 4 lines.

2

echo "prenup"

2
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 :-)).

2
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.

2

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

2
while (True)
  try:
    love+=2
  except:
    love+=2
  finally:
    love+=2
2
#include <stdio.h>

int
main(void)
{
        printf("Hello, world!\n");
}
2
Husband h = new Husband("Robert");
Wife w = new Wife("Tiffany");
new Priest().Marry(h, w);
List<Child> children = new List<Child>();
children.Add(h.Reproduce(w));
2

I've found this on failblog.

I guess the cake was text/plain

alt text

1
for account in BankAccounts:

    happiness{"wife"} += 1
    snobbiness{"wife"} += 1
    livingStandardInFiveYears -= 10
    hairLossPerMinute{"male"} += 20
1

while(!(death=together))

or

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

1

love = true

1

class Married extends Dating{

while(death != true){

super.Love()

super.Cherish()

super.Have_and_Hold()

}

I know, I know, bad pseudocode, but it gets the point across (there's no reason those would need to be implemented in Dating but it looked odd otherwise)

1

fork while fork

1
std::map<std::string, std::string> soulMate;
soulMate["Robert"] = "Tiffany";
1
public class Past
{
  public virtual bool freeNow()
  {return true;}
}

public class Present: Past
{
  public override bool freeNow()
  { return false;}
}
1
try
{
 var g = Girls.Single(x=>x.equals("Tiffany"));
}
catch(MultipleGirls ex)
{
  //Problems here...
}

I like this...

1

This one is in Ruby:

puts "Goodbye, Cruel World!"
File.unlink $0

Note: unlink removes the file $0 which is the file of the program being executed.

1

Or you could have a simple

me++;
1

My future wife has agreed to let me have actual code on top of the wedding cake. Woot!

Robert, do you even realize the full long-term repercussions of accepting such a "permission"? You do understand this will come back to haunt you for the rest of your marriage, right? I would think twice before getting involved with any decisions affecting anything that will/can show up in the wedding video or pictures. :)

Congratulations!

1

Here's my jQuery version:

$("#altar").bind("vows", function () {
    $("#marriage").append("#Robert").append("#Tiffany");
});
1
C:\Run Freedom.exe /destination:theHills /nostop /noturnback /headphonesOn
1

Transaction.Rollback();

0
(function Marriage (love, happiness)  {
    var life = this.HolyMatrimony({
        husband: "yourname", wife: "hername"
    });
    return life.of(love,happiness);
}).bind(vicor,100,100)()
0

import life
life.do(man, woman)

0

from RobertLovesTiffany import *

0

mmm..

<!DOCTYPE HTML PUBLIC "-//RobertAndTiffany//DTD HTML 9.01//EN" "http://www.NoW3.org/TR/html9/ThereAreNotStandartsForOurLove.dtd" >

or simply

GiveEternalLove ( document.getElementById('TiffanyHeart'), document.getElementById('robert') )

or better:

assert(TiffanyLove && RobertLove, false);
/* ASSERTION FAILED */
0

In Ruby:

>> marriage = Marriage.new :husband_id => params[:robert_id], 
                           :wife_id => params[:tiffany_id]
>> marriage.save
=> true
>> marriage.freeze
0

make clean

0
child = 'robert'.toMan.marriage('tiffany'.toWoman)
child.setAge(27).must.makingCake('Roses Are #FF0000.. Violeta..') if child != null
0
using(Health h = Sickness | Healthy)
using(Wealth w = Rich | Poor)
{
    Tiffany.LoveAndCherish(Robert);
    Robert.LoveAndCherish(Tiffany);        
    Robert.Kiss(Tiffany);
}
0

This is my first time here, and I just happened to come across this site while looking for some kind of creative SQL code to put on my hubby's birthday cake. I know that I'm kind of going off the topic here but, if anyone can help me out, I'd greatly appreciate it - there were so many good wedding cake ideas here!

-1
if(Man.Value = Man.Value + Woman) 
{
    throw new FormatException("What was I thinking?");
    exit sub;

}
-2

Take some gold from her family, melt it with some gold from yours. Make rings for both of you. Melts her heart too. Worked well for me. :)

-3

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