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

> Clojure is much, much less complex then Scala and it is functional and OO.

Until you need to decipher someone else's code full of NIH macros.



For the most part macros make most code much, much easier to read. The clojure compunity is also really fixed in its way, how and when macros are written.

Take one example, core.match. Now in a language that does not have pattern matching code that can be easly written with pattern matching is very hard to read. In clojure its very easy to read.

Now one might argue that a 'good' langauge should have support for pattern matching. To that I say, the language creators can never have all the features everybody wants, it will slow down devlopment of the language and increase complexity.

I would rather read one or two nice clojure macros that reduce tons of boilerplate as you would need in other languages. The same happens in other languages, for exmaple rust. I really enjoy using macros there as well. Give me a language with macros 100%, it improves read and write ability in the waste majority of cases.


I do like macros and Clojure.

My point is that there are many types of code complexity and abusing macros for your in-house DSL is one of them.

This happens a lot in many Lisp shops.




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

Search: