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

I just read through most of O'Reilly's new Clojure book and implemented a simple Clojure app (a web-based tic-tac-toe game). The analogy to making friends in a new language is really good -- it was full of moments like "I'm sure somewhere in this dictionary is the perfect word for what I'm thinking" and "you have a word for that?!" and "I never would have thought of putting things that way!"

The primary consequence was to improve my use of my native language, Python -- I'm much more likely to use all() and any() and map() and reduce() and set() where they make sense, to think of my functions in terms of composability, etc. I'm not sure that I'll ever put in the time to be fluent in Clojure, but I'm glad I spent some time stumbling through it.



Slightly off-topic: In Python you will also benefit from using the sorted and reverse functions to avoid mutability. Generator functions are a nice way to build collections without using explicit append:

  def collection ():
    list = []
    while someLoopCondition ():
      while someOtherLoopCondition ():
        list.append (someStuff ())
    return list
vs

  def collection2():
    while someCondition ():
      while someOtherLoopCondition ():
        yield someStuff ()




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

Search: