-
-
Notifications
You must be signed in to change notification settings - Fork 162
Closed
Description
Rationale
As we write new concept exercises to v3, we can better set up learners for success by changing the exercise template.
Issue
Here is an example of the current template:
(defn armstrong? [num] ;; <- arglist goes here
;; your code goes here
)
This creates a few problems:
- Many learners do not remove these comments before turning in their solution.
- Learners get into the habit of writing functions without docstrings.
- Learners are led to believe that the arglist should go on the same line as the function name. Many learners who later try to add docstrings will add them after the function arguments.
Suggestion
I propose the following changes:
- Add a docstring below the function name. This accomplishes a few goals.
- Learners become aware of become aware of docstrings.
- The template is more representative of idiomatic Clojure.
- Learners are exposed to high-quality examples of how docstrings should be formatted and written.
- Remove the single line comment referencing the function argument. Learners who get past the "function" concept will know that arguments are provided here.
- Change "your code goes here" to be more descriptive. Something like "add function body here" or just "function body" more accurately describe what the learner needs to do.
The result woud look something like this:
(defn armstrong?
"Returns true if `num` is an armstrong number."
[num]
;; function body
)
baskeboler and miridius
Metadata
Metadata
Assignees
Labels
No labels