Help:Adding a new programming task: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Task Template: Added directions for the new category argument)
(Redirect.)
 
Line 1: Line 1:
#redirect [[Rosetta Code:Add a Task]]
[[Category:Adding Content]]

Adding a new programming task is tricky. Not because it's technically difficult, but because it's difficult to do properly.

==Defining Your Criteria==

A programming task needs to have a set of criteria, or things that subsequent programming examples need to accomplish. One example might be, ''Display the string "Goodbye World!"'' Another example might be ''Read the contents of one file, and place it in a new file.''

The criteria you set should not be so tight as to be language-specific. After all, that defeats the founding point of Rosetta Code. However, the criteria should not be so vague as to have multiple interpretations. Removing code from the wiki would be the tragic result. Situations where the appropriateness of a programming example hinges on the interpretation of the tasks' criteria should be avoided as much as possible.

Also, keep in mind that it will be very difficult to change the criteria once a few programming examples have been supplied. For every change, the code examples need to be reviewed to ensure they still satisfy the criteria. That's time consuming and difficult to do, as not everyone will have access to all the tools used to create and test the original examples.

If you're unsure about how to define your criteria, bring up your idea on the [[Help:Request a new programming task|request page]] for programming tasks.

===Modularization===

'''Modularization''', as it applies to Rosetta Code, is simply an implementation of the KISS philosophy: Keep It Simple, Silly. Tasks that cover too many areas of programming tend to get disjointed and convoluted, and may unnecessarily exclude programming languages capable of solving some portions of the task.

It's also important to keep tasks modularized in order to maintain a good association between the name of the task and what it accomplishes. If someone wanders into Rosetta Code looking for information on how to create a compound data type, they may get lost if the task titled "Compound Data Type" contains mountains of information on things like byte position and order.

==Creating the page==

''You may want to do this in a separate window, if you intend to keep reading this page as you work.''

Once you've settled on criteria, the rest is easy. To create the task page, you need to navigate to where the page should be. The easiest way to do that is to type the name for your programming task in the Search box on the left, and click Go.

Click on "Create this article".

===Task Template===

The first line of any Programming Task should be the task template. The task template describes the page as a programming task, and gives cursory instructions on how to add a programming example. It also adds the page to the Programming Tasks category, so that Rosetta Code users who wish to see all of Rosetta Code's programming tasks may navigate to the Programming Tasks category index page.

To add the task template to your page, add the text <nowiki>{{task}}</nowiki> to the top.

The task template can also accept an argument for the name of the subcategory it should go in. For example, adding <nowiki>{{task|Mathematical operations}}</nowiki> will put this task in the [[:Category:Mathematical operations|Mathematical operations category]]. This helps to keep the Solutions by Programming Task page organized. Only one task template is needed (you don't need to add <nowiki>{{task}} and {{task|Mathematical operations}}</nowiki>). If your task should go in more than one category, add the first one as an argument to the task template and add the rest like normal category links.

===Task Body, First Example===

Once you've added the programming task, you need to include the task criteria. Go ahead, type them in. Following that, you should include a programming example that satisfies your criteria. This does two things.

First, it prevents Rosetta Code from filling up with incomplete tasks. Most visitors to Rosetta Code don't actually add content; they're only here to look. If all they find are empty tasks, they won't take much interest in the site.

Second, it clarifies your criteria. In the case that your criteria weren't clear enough already, having a programming example gives other programmers a template to work with.

===Conclusion===

At this point, you're ready to see how your page will look. Click Preview Page, and you'll see what the page looks like, complete with the template at the top descibing the page as a programming task.

Once you're satisfied, you may click Save Page, to finish the creation of the programming task. At this point, you're looking at the programming task as it appears to all the other Rosetta Code users.

Thank you for showing an interest in contributing to Rosetta Code!

Latest revision as of 03:01, 27 October 2010