ClojureBridge / curriculum

Curriculum for the ClojureBridge workshop series.
https://clojurebridge.github.io/curriculum/
482 stars 199 forks source link

Make exercises less mathy/numbers oriented #159

Open vilmibm opened 9 years ago

vilmibm commented 9 years ago

While I had a handful of students who were already very comfortable with math and didn't have an issue with things like (rem) and (mod), most of my students were a little exasperated by the numbers-based orientation of many of the exercises.

Is it appropriate to go through and re-think some of the exercises to be less numbers oriented? I'd love to see zero usage of modulo or remainder as if one isn't already math-familiar, they're just more new concepts to learn.

davidchambers commented 9 years ago

I'd love to see zero usage of modulo or remainder as if one isn't already math-familiar, they're just more new concepts to learn.

I agree.

MaxMartin commented 9 years ago

I think in addition to presenting new concepts that students have to learn, including arithmetic-heavy material also throws up lots of flags for people inexperienced with programming that say, "Math! Scary stuff! This is going to be hard!" Many students will already feel very overwhelmed and flustered by what they're encountering, and this content likely worsens the problem.

k4y3ff commented 9 years ago

Is it appropriate to go through and re-think some of the exercises to be less numbers oriented?

@nathanielksmith, yes! Please do offer suggestions for replacement exercises, if you have them.

lindboe commented 8 years ago

I agree! I was looking at the code for where mod is used, and I found

(defn leap-year?
  "Every four years, except years divisible by 100, but yes for years divisible by 400."
  [year]
  (and (zero? (mod year 4))
       (or (zero? (mod year 400))
           (not (zero? (mod year 100))))))

I think that could be replaced with a similar predicate-type function that looks for "words" that match certain conditions. Something like: returns true if number is even or zero and also is greater than 10, or if number is odd, but not if the number is 18.

(defn good-number?
"Returns true if I like this number."
[number]
(and
  (or (even? number) (= 0 number))
  (> number 10))
  (not (= 18 number)))

You could probably also replace it with a similar predicate-type function that looks for "words" that match certain conditions, but I'm having trouble working with just the functions they've already seen - since the earlier examples are also number-oriented. Something with "first", "rest", and "last" maybe.