Skip to Main Skip to Footer
Back to Header Skip to Footer
← zurück zum Blog

The Tale Of The Little Red Riding Hood Told By A Software Developer

skip to Article →
Veröffentlicht: 15.12.2016
Anzahl Wörter: 286
Lesedauer: 1 min

What happens when a software developer tells her kid a bedtime story?

For all those who do not “speak” JavaScript I included a little bit of comments. Enjoy.

function TheTellOfRedRidingHood()
    var RedRidingHood = new Person();
    RedRidingHood.cloth = { 
        type: 'hood',
        color: 'red'

    var mom = RedRidingHood.getMother();

    var basket = mom.pack(['wine', 'bread', 'cake']);

    var granny = mom.getMother();

    granny.adress = 'in the woods';

    // after this continue with Person.visit

Person.visit = function(whom)
    var RedRidingHood = this;

    if (!whom)

    var granny = whom;

    var forest = new Woods();

    var wolf = new Animal();

    RedRidingHood.go(forest).meet(wolf).chat(wolf, tellTooMuch);

    // after this continue with Animal.visit

    // after this continue with Person.ask
    .ask(wolf, 'What big eyes you have!')
    .ask(wolf, 'What large hands you have!')
    .ask(wolf, 'What a terrible big mouth you have!')

    var huntsman = new Person();[RedRidingHood, granny]);

    return RedRidingHood;

Person.ask = function(whom, what)
    if (!whom || !what)
        return null;

    // after this continue with Animal.answer

    return this;

Animal.visit = function(whom)
    var wolf = this;

    if (!whom)

    var granny = whom;;

Animal.answer = function(question)
    if (!question)
        return '???';

    if ('What big eyes you have!' === question)
        return 'All the better to see you with';
    else if ('What large hands you have!' === question)
        return 'All the better to hug you with';
    else if ('What a terrible big mouth you have!' === question)
        return 'All the better to eat you with';

Yes, I know we software developers are considered to by … uhm … nerdy. Then again you know every now and then I need to be able to do crazy things to stay sane.


Mira Alexander

Sie haben eine Anmerkung oder eine Anregung zu diesem Artikel? Ich freue mich über Ihren .