Recipe for Designing Functions in programming languages

Recipe for Designing Functions:

1. Examples
    What should your function do?
    Type a couple of examples calls.
    Pick a name (often a verb or verb phrase):
    What is a short answer to “What does your functions do?”
2. Type Contract
    What are the parameter types?
    What type of value is returned?
3. Header
    Pick meaningfull parameters names.
4. Description
    Mention every parameter in your descriptions.
    Describe the return value.
5. Body
6. Test
    Run the examples
   

Advertisements

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