exercism / clojure

Exercism exercises in Clojure.
https://exercism.org/tracks/clojure
MIT License
161 stars 155 forks source link

[v3] Template for Exercises #305

Open cstby opened 4 years ago

cstby commented 4 years ago

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:

Suggestion

I propose the following changes:

The result woud look something like this:

(defn armstrong?
  "Returns true if `num` is an armstrong number."
  [num]
  ;; function body
  )
cstby commented 4 years ago

@porkostomus @bemself Forgot to tag your two when creating the issue!

bemself commented 4 years ago

@cstby Nice template! I like the docstring addition, I myself also forgot to add docstring in my example script for concept list, I will add it later. thanks a lot for pointing it out.

For other suggestions, I have only one concern, for a fresh starter, before he touches the function concept, he might not know [] is for arglist.

Remove the single line comment referencing the function argument. Learners who get past the "function" concept will know that arguments are provided here.

bobbicodes commented 4 years ago

Totally agree! I always encourage students to prefer docstrings, for these reasons and with the additional benefit that then your library can be consumed by tools like cljdoc :)

bobbicodes commented 4 years ago

Regarding the prerequisite of understanding basic syntax (like arglist), I'm sure that will be covered by a functions exercise, which will likewise depend upon vectors.

That's 2 more concepts right there - I'll go ahead and make issues for them while this is fresh in my mind.