An example instead of an adjective

An input, an output and a ban are stronger than the word "correct".

An example pins down the meaning. "Normalize the name" could mean trimming spaces, changing case or dropping a hyphen. "For the input Ann return Ann. Do not accept an empty string after trimming." There is nothing to argue about here: you and the model are looking at the same thing.

Next to a success example you need a rejection example, if rejection exists. Otherwise the model invents its own: it returns an empty string, throws an exception or substitutes the word user. Write which rejection you want to see. For a training check it is often a short string; in a service it is a status code and a message without a stack trace.

Do not ask to "handle all edge cases" without a list. Edge cases are your knowledge of the domain: an age below zero, a leap day, a double click, an empty file. Name the two or three that matter. You will add the rest in the next piece, once these are already checked.

The example in the request later becomes a test almost word for word. If you cannot be bothered to write an example, you will not be bothered to check the answer either. That is a sign the task is still raw, not that the assistant should guess.

Practice

  1. What to use instead of "properly"

    You need to agree on what the function does with spaces around a name. What do you write in the request?

    • Do it properly
    • Input: spaces and Ann; output: Ann
    • As is standard in the industry
    • Choose the best format yourself
  2. The second example

    Besides success, what else is worth showing if bad input must be turned down? A rejection or a log line?

  3. Which examples help

    Select the examples worth putting into the request.

    • A concrete successful input and output
    • Make it optimal
    • Your own edge case, for example an empty name
    • Cover every case you can find