
ClojureScript Koans: Learn ClojureScript from inside your browser - lazerwalker
http://clojurescriptkoans.com
======
MBlume
There are some good criticisms here about some of the discontinuities in
difficulty, but first and foremost I really want to congratulate OP for doing
something to address the instant gratification problem in learning to program.
You can open this site in your browser and immediately start interacting with
code rather than trying to get your java environment/editor/etc. set up, and
that's _fantastic_ , we really need more tools like this.

------
resu_nimda
I like this, but it seems too cryptic for a true novice to actually learn
from, _especially_ if they've never been exposed to Lisp syntax. Who is the
intended audience?

I see that it's something of a port of the Clojure Koans, has there been much
feedback on that as to whether people are able to truly learn the language
this way? I'm intrigued by new methods of instruction, but this seems like it
would be a very frustrating trial-and-error game to a beginner, as there is
virtually zero actual teaching. We're supposed to be making programming more
accessible, not less. It seems like this kind of thing ends up as a fun
toy/experiment for people who already know most of it.

It _is_ very nice though.

~~~
lazerwalker
Creator here.

You're totally right it's not a good way to learn the language in isolation. A
little context: this is the first project I've built in any Lisp, so learning
Clojure/ClojureScript from scratch is still very fresh in my mind.

When I worked through the original Clojure Koans, I had a REPL open and made
judicious use of online resources to figure out each answer. As an experienced
programmer who was brand new to Lisp, treating the koans as a sort of 'open-
book exam' was very effective for me. Perhaps explicitly suggesting that
workflow on the home page would be a simple but worthwhile addition.

~~~
mbubb
Really fun! Reminds me of "little Schemer"* in the sense that there are no
'instructions' so you are encouraged to try various things out.

In my opinion this way of doing it is good. It works for me.

* [http://mitpress.mit.edu/books/little-schemer](http://mitpress.mit.edu/books/little-schemer)

------
terhechte
This goes from easy/novice up to advanced level in a short amount of time. I
did some koans until I arrived at functions/9 which is:

(= 25 ( ___ (fn [n] (* n n))))

I found this one to be not so trivial, granted I'm still a novice clojure
user, but I still think that it went up rather steeply here.

I think if they really want to introduce new people to ClojureScript, then the
koans need a friendly help system and the ability to show the solution and
have it explained to you.

It should also have a short introduction in Lisp that explains prefix notation
/ s-expressions. I think that would make things a lot easier.

~~~
DoggettCK
(fn [f] (f 5))

I do love the format, but what I like a bit better about Clojure Koans is that
you can see the previous ones for a bit of a reminder.

Maybe for each section, they could leave up the ones you'd successfully
completed so you could refer to them.

Other than that minor nitpick, I love this.

~~~
scottdw
Or the threading macro #(-> 5 %)

~~~
chrismonsanto
Or (fn [f] 25)

~~~
danneu

        (constantly 25)

------
michaelsbradley
Very nice!

Would like to see it feature a ToC so one can easily move between the koan
categories.

~~~
lazerwalker
Thanks! (Creator here.)

I came _this_ close to delaying the site launch so I could build in a table of
contents, but figured it wasn't 100% essential to shipping. Given the great
response I've gotten to the koans, I'll probably add one in very soon.

~~~
eaurouge
I'm working thru it in order. I didn't feel the need to jump around, but it
would be nice to know how much longer I have to go, i.e. how many more
screens.

------
__float
This reminds me of [http://4clojure.com](http://4clojure.com) with a simpler
[nicer?] (but less featureful) UI.

I want to add a slightly off-topic remark, but 4clojure actually runs the
tests in a sandbox on the server. This is compiling to ClojureScript, and I
have to wonder if it's "good enough" or whether down the line some koans might
run into problems being ClojureScript instead of the real Clojure on the JVM.

~~~
agumonkey
Indeed. I like the non visible UI. Almost Brett Victorian.

------
krcz
#5 in sequence comprehensions part doesn't seem to work for me. I've checked
my solution in console clojure interpreter and it evaluates to true there.

~~~
graue
Same here. After checking in a local ClojureScript REPL, I just changed the
URL to sequence-comprehensions/6 and went on.

------
koanita
I was playing with this, but is a little long and I wanted to know if the end
is near, so add a percentage bar also it would be useful to have an index of
topics.

------
TallboyOne
Lots more Koans:
[http://pineapple.io/tags/koans](http://pineapple.io/tags/koans)

------
blossoms
[http://clojurescriptkoans.com/#higher-order-
functions/10](http://clojurescriptkoans.com/#higher-order-functions/10) got me
good. Why is it one needs to use `(count a) (count b)` instead of just `a b`
like worked when comparing string lengths in a previous ClojureScript Koan?

~~~
jamii
The `<` function only works on numbers but, unlike java, it will correctly
coerce numbers with different representations.

    
    
        (< 1 ;; Long
           1.5 ;; Double
           2N ;; BigInt
           )
    

If you want java-style comparisons use `compare` instead.

EDIT: Ooops, this is cljs, not clojure. The correct answer is that string
comparison is lexicographic in js:

    
    
        "is" < "length" < "word"

------
graue
Awesome site!

Having done a few Clojure projects lately, I got most of these right
immediately, but there were a few I messed up. It would be cool if you could
go through these flashcard-style: one try for each koan in a category, then
re-show the ones you got wrong, and repeat until you get them all right.

~~~
taivare
Anki, has Clojure flash-cards.

------
tonetheman
Really interesting way to learn. I made it into vectors and then got
completely stuck on subslice. Maybe a hint text or something or a way to skip
it or get the answer if I have not got it after a few tries.

I might be typical but once I hit that screen and could not go further I
closed it.

Still really good work!

------
nemo1618
I chuckled when I realized you could just copy and paste the expression and it
will pass the equality test. Obviously you don't learn anything this way, but
I'll admit I used it once or twice when I got stumped.

------
agentultra
Interesting... I would second adding some hints after _n_ failed attempts. You
could just expect the user to go off to google but it'd be a nice touch to get
a small hint in-place.

------
gotofritz
Nice, but needs help / clues

