Evanescent Thoughts

Evanescent Thoughts

Code Idioms

leave a comment »


These are the few idioms tht i found interesting in the net… have fun…

// Idiom 1

var location = getLocation();
if (location == ‘rome’) {
do( location.getCitizen() );
}

// Idiom 2
injury += insult;

// Idiom 3
if (bird[1].feather == bird[2].feather) {
bird[1].flock(bird[2]);
}

// Idiom 4
a = getThickness(‘blood’);
b = getThickness(‘water’);
assert(a > b);

// Idiom 5
a_spade_a_spade();

// Idiom 6
take(salt * .01);

// Idiom 7
if (i == 2) {
tango();
}

// Idiom 8
function tunnel() {
var dark;
for (i = 0; i < 10; i++) {
dark = true;
}
dark = !dark;
return dark;
}

// Idiom 9
if ( monkey.inLineOfSight(it.x, it.y) ) monkey.do(it);

// Idiom 10
return way.my || way.high;

// Idiom 11
function getGain(pain) {
return pain >= 1;
}

// Idiom 12
if (cooks >= 3) {
broth = null;
}

// Idiom 13
if (a != ‘cake’) a.eat();

// Idiom 14
days = 365;
for (day = 1; day <= days; day++) {
if ( random(0,100) <= 50 ) apple++;
}

if (apple <= days) doctor();

Advertisements

Written by Sathya Narayanan

April 13, 2008 at 9:37 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: