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

Man. I know Lispers hate hearing about it, but I was so on board with this until the sample ClojureScript code and all the parens. I just… don't wanna write code like that.


Something that may make it easier to accept all the parens is that that very thing is part of what enables some of the good stuff. You're essentially writing your programs directly as an AST (abstract syntax tree, http://en.wikipedia.org/wiki/Abstract_syntax_tree). That is what makes it so natural to write macros that manipulate your own code on the same level that a compiler does.

That realization may not make the code any easier to read at first, but it may make it easier to accept it.


I felt the same way as you until I actually tried Clojure. In a few hours all my rejection of the parens dissapeared because I finally understood.

Try solving a small problem in Clojure (a code Kata, or a problem from Project Euler) and you'll see those aprehensions against the parens will go away.

Nowadays I'm having trouble to accept the syntax of other languages, eg. Scala :-)


Everything in life a tradeoff. You should watch this video: http://www.infoq.com/presentations/Simple-Made-Easy

The parens are annoying, until:

a) You build that fully composable library that you always wished you could have written in X language, but it neeeeever quite worked the way you wanted.

b) You realize that by keeping your data immutable, it allows you to write less tests, be more confident in your code, and you stop worrying "is that value is what I think it is?"

c) By building on top of the JVM, you are able to use java interop to save yourself a day of coding a custom library for something that exists and is well tested.

d) Deployment becomes a breeze because you just export a jar/war file and load it up into any of the existing app servers.

e) You get phenomenal speed increases for "free" if you're coming from dynamic languages like ruby/python/PHP

f) When you need to dip into async code, you can write your async code, in a synchronous fashion, which (for me) is much easier to think about then keeping track of callbacks in my head.

Good luck, if you decide to give it a shot, I think you might realize the parens isn't such a big deal in the long run!




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

Search: