Rosetta Code:Add a Task: Difference between revisions

→‎Things to avoid: "Code Golf:" prefix
(Delete entire section about 'semantic annotations'. Bad example of semantic markup. Page ((Delegates)) never had such markup, and ((Property:Task concept)) exists not on this wiki.)
(→‎Things to avoid: "Code Golf:" prefix)
 
(10 intermediate revisions by 5 users not shown)
Line 8:
Examples</pre>
==Prerequisites==
===Create the page===
Come up with a title for your task (look at [[:Category:Programming Tasks|the current tasks]] to see what kind of name you should choose), type it in the search bar, and click "Go". There will be a "Create page" link on the resulting page somewhere. Click that, and you can begin editing.
 
A few guidelines for a good task title:
 
* Don't be too general; make the title closely focused on describing what the task is actually asking to do.
::If your task is "Generate the lyrics to 99 bottles of beer" for instance, a good title is "99 bottles of beer". A poor title would be "Generate song lyrics".
 
* Don't be too specific; don't include terms that are peripheral to the task, even if it is a common term.
::If your task is "Generate twin primes up to some limit"; a good title is "Twin primes", a poor title would be "Twin prime conjecture".
 
* Follow some simple capitalization rules:
:# The first character of the title should always be uppercase, even if referring to something normally lowercase.
:# The first character after a level separator ( forward solidus: / ) should always be uppercase.
:# Every other word should be lowercase except for proper nouns, names and common initialisms.
 
* Avoid including characters outside of ASCII alphanumerics. Try to make your task title easily type-able on a standard US keyboard.
 
There is substantial leeway in these rules, and some are subject to interpretation, but the closer you can come to following them, the easier it will be all-around.
 
===Draft vs non-draft===
Not all tasks are immediately ready to be thrown at the casual Rosetta Code participant. Some need a review or draft phase before they're in good shape.
* For a non-draft task, one would use [[Template:Task]] by putting {{tmpl|task}} at the top of the page.
* To note that a task is a draft, use [[Template:draft task]], by putting {{tmpl|draft task}} at the top, rather than {{tmpl|task}}. If this is your first task, you should probably just start with a draft.
 
It's up to you to decide which you start with, but another community member may choose to change your created task to a draft. If there is some question on the general suitability of the task then create a draft task and discuss the reason for it being a draft in the talk page. This will warn potential contributors that there may be substantial changes in the task description whilst still in draft status.
Line 38 ⟶ 58:
***When giving a best effort solution then state near its top, just what aspects of the task are not implemented, to avoid later editors marking the example as incorrect.
***Consider the removal of a prior partial solution to a task when adding a new full solution to the task.
* '''Avoid creating tasks seeking the smallest possible solution.''' Code golf, or the finding of the absolute most succinct expression of a solution as its own goal, is not often an idiomatic, practical or comprehensible use of the language in question, and so is difficult to justify in a demonstrative context. Strokes are not points. For now, the only exception to this rule is [[Code Golf: Code Golf]]. If there is a case to be made for another exception, please use the prefix "Code Golf:" when creating the page.
* '''Avoid creating tasks seeking the fastest possible solution.''' Optimized code is rarely easy to read, and is often exceptionally complex as something to learn from. However, provided it does not make the overall section for the language too long, users may provide a more-optimal solution as an alternative solution to a particular task so that learners can compare it to the “optimized for clarity to people” version that should be the main solution for the language. (We also do not want to see the site devolving into “my language is faster than yours” silliness.)
 
Line 47 ⟶ 67:
 
Where relevant, '''sample input''' should be included; it gives task solvers something to work with.
 
If your task requires a '''wordlist''' to be used with / tested against, it may be worthwhile specifying [[Wordlists|one of the commonly used]] ones to make it easier for other entry authors to fulfil and make results more uniform so different implementations can be more easily compared.
 
===Example code===
Line 63 ⟶ 85:
 
===Extreme Language===
Some schools, libraries and parental filters filter pages whose URLs match wordlists. This even occasionally impacts Rosetta Code's reCAPTCHA API key. We try to include this audience, so please [[wp:bowlderise|self-censor]] such content. (For an example, see the discussion page for language [[Category talk:Brainf***|Brainf***]]).
2,442

edits