Hacker News new | past | comments | ask | show | jobs | submit login

My point was "even" and "filter" can be built by someone, just to be fair about the whole readability. If "even" is already built into the language, then that's a given.

Readability and language understanding are not separable. I for one have a hard time actually understand what the code does above (although I can guess it). But I am not sure how ^ translate into [true false false true true true false false false false ...] sequence because, I thought we were calculating oddity of 1000 numbers.

[1 2 3 4 5 6 7 8 9 10 ...] ==> [T F T T F T F T T T ]

Perhaps the lack of understanding Clojure syntax to comprehend what the code is doing.




Exactly the point. In many other languages, every programmer can write their own "even" and "filter" with their own idiosyncrasy. However, in Clojure, every one uses the same set of high level functions in the standard library, because they are sufficiently rich to express most of the programming concepts, without having to roll your own.

In Clojure, readability is obtained through standardization. Every Clojure programmer instantly knows what the functions in the standard library do. Because there's not much syntax in a Lisp, code is very easy to read once one knows the functions.


> In many other languages, every programmer can write their own "even" and "filter" with their own idiosyncrasy.

"filter" is incredibly useful, and most modern languages (including Java 8) have it built in.

"even?" is sometimes useful, and languages are kind of hit-and-miss about it, but its usually small enough to inline, and the biggest cost of not having it built-in is probably things like people using modulus rather than first-bit testing in Java which, IIRC, produces somewhat slower code for that check.


It's part of the std lib. But yeah you're basically on the same page as me. Java doesn't have the ability to be extended in the ways that clojure or python can.

Python also allows for functional programming to a certain degree, but clojure is a lot more powerful when it comes to language extensions.

Threads as a library (for js environments) for clojure. https://github.com/clojure/core.async

Logic programming for clojure. https://github.com/clojure/core.logic

Declarative UI building, with dataflow semantics. http://reagent-project.github.io

Additionally immutability makes your life a lot easier. Parallel computing in clojure is a no brainer, you just change your map to pmap, and that's it.


Thank you. I will look at the immutability part. I remember taking Racket in school a few years ago and that was a major thing about FPL like Racket / Lisp.

I have always wanted to look at building something again in one of the popular FPLs.




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

Search: