Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> You will feel handicapped. You will be confused.

For anyone who wants to learn Clojure (or any Lisp) from scratch, here's my advice:

Don't try to learn it by reading books. What I mean: don't try to mentally parse and analyze printed code written in Clojure. For uninitiated Clojure code may look like unreadable gibberish. If you try to understand Clojure code by merely staring at it, it may feel very exhausting.

Remember: Unlike most other languages where the code is "dead" until you compile it an run it, Clojure code is a "living thing," analyzing its "static" properties without evaluating that code makes little sense.

Get an editor/IDE that supports "structural editing." Learn basic structural editing commands - slurp, barf, transpose. Learn/set a keybinding that allows you to evaluate the expression at the cursor.

And then eval your expressions and sub-expressions. That would make it much easier to learn. And would bring joy to the experience.



How is printed clojure code from regular clojure code? Sounds like a maintenance nightmare if the code can't be understood just by reading it.


I should've probably clarified: It is difficult to grok Clojure code only in the beginning - when you are new to the language. To many beginners, Clojure code at first may not look very intuitive. That is why I'm suggesting to learn it by "breathing it" - try changing it in an editor/IDE that supports structural editing and connected to a REPL - change an expression, eval it - see the results, expand, eval again, move onto the outer/inner level expression, eval, and so on. That way you quickly get the insight and learn how the language works. And it won't take too long to learn how to comfortably read and mentally parse "static" Clojure code.

After some time it becomes clear - Lisp is not harder to read. For some people, it's the other way around - going back to languages with C-like syntax may feel awkward.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: