The Lucid Developer

Thursday, February 09, 2006

A simple Question Mark

Simple (sim-p&l)


Inflected Form(s): sim·pler /-p(&-)l&r/; sim·plest /-p(&-)l&st/

1 : free from guile : INNOCENT
2 a : lacking in knowledge or expertise b : STUPID; especially : mentally retarded c : not socially or culturally sophisticated : NAIVE; also : CREDULOUS
3 a : SHEER, UNMIXED b : free of secondary complications < style="font-style: italic;">4 : free from elaboration or figuration
5 : not limited or restricted : UNCONDITIONAL
6 : readily understood or performed

There are things in programming that we find easy and there are things in programming we can hit our head against tell we are bleeding. Recently one of my developers had just one of those days.

So let me tell you the tell I like to call "The life of a question mark".

There once was a question mark that lived in a small warm program. He was happy there. Only on rare occasion was he asked to come out and preform some minor function or enforce some small rule. He lived a happy life. For the programmers that used him, used him sparingly. He was forgotten, but happy. Tell one day a new young developer decided to try something he had never tried before. This developer tired as he might but he just couldn't get his code to work as expected. Every time it would return the last result in line and not the first. Oh how this developer tired. Two days of sad and tiring code was written and rewritten. But at last it just wouldn't work. This developer asked the other developers around what he could add to make this cod work. But none knew. But little question mark knew his job well, he could see that the young developer needed just him. But how could he tell him. Then one after noon while looking in a book he found another developer had used the little forgotten question mark. So he figured he would give it a try. And low and behold, our little friend was the answer all along.

Perl snippet:
$var =~ /(.*)/ig; WRONG for this usage
$var =~ /(.*?)/ig; Right

3 Comments:

  • That young developer should get more sleep.

    By Anonymous Anonymous, at 10:32 AM  

  • ...man. that sounds great. I wish I was a question mark.

    By Anonymous Anonymous, at 10:50 AM  

  • com·ment n.

    1. A written note intended as an explanation, illustration, or criticism of a passage in a book or other writing; an annotation.
    2. A series of annotations or explanations.
    3. A statement of fact or opinion, especially a remark that expresses a personal reaction or attitude.
    4. An implied conclusion or judgment: a novel that is a comment on contemporary lawlessness.
    5. Talk; gossip: a divorce that caused much comment.
    6. Computer Science: A string of text in a program that does not function in the program itself but is used by the programmer to explain instructions.
    7. Linguistics: The part of a sentence that provides new information about the topic. Also called rheme.


    I find your posting style interesting. You always start with a definition. :) And you're very rhetorical. It's very entertaining.

    By Blogger WarriorWife, at 7:42 AM  

Post a Comment

<< Home