12 comments

[ 2.8 ms ] story [ 46.2 ms ] thread
This being reddit, I expected the top voted post to be "I don't recommend using Clojure for more than 2 years, because going even a week without sleep is fatal." I was disappointed.
Personally, Given teams writing in java, python, go, or Clojure, I wouldn't join the Clojure team. It looks too painful...

https://github.com/clojurebook/ClojureProgramming/blob/maste...

I don't honestly see anything out right incorrect or difficult about the code you posted other than it's clojure. Mind expanding on that?
The one roadblock I run into whenever I write functional is the ridiculous number of functions that result. Don't get me wrong, it's great that everything can be abstracted away and easily tested as pure functions, but a kitchen sink of thousands of functions is difficult to remember, let alone introduce someone else to. Namespaces help, but not everything fits into an obvious namespace.

Admittedly this is mostly a personal organization issue, but when writing object-oriented code, in my experience it encourages better encapsulation. That being said, I like functional more. :)

> but a kitchen sink of thousands of functions is difficult to remember, let alone introduce someone else to

That's pretty much the point: You don't have to remember what the function does, just read its name (and function signature, if your language is statically typed).

This is a "best practice" in imperative land as well.

I can't remember a thousand function signatures, and pulling up the list of function names and args is a huge pain if you have to browse through it every single time to find the one function that meets your specific transform, whereas you may as well just write it yourself in half the time.

In imperative land, I find that I have to write fewer functions, for better or for worse. As a result, this is not as much of an issue.

> and pulling up the list of function names and args is a huge pain if you have to browse through it every single time to find the one function that meets your specific transform

Not a problem in Haskell and Idris, at least. With the :search REPL command it will give you all the functions that match the signature you give it as an argument.

And really, you can have "longer functions" in any functional language, and they're used all the time: let..in...where, piping transforms (with the |> pipe operator or the . function composition), and of course, the do-notation which resembles imperative programming while being just syntax sugar for nested monadic operations.

How about UNREADABLE
Forget it, this module is "flawless".. relatively to a majority of module you can find in codebases. It's tiny, has less than 5 global vars, a few private functions and a few public ones. 100 LoC.

A few years ago I checked out the most used wordpress plugin for social network buttons, it was 4, if not 8 I lost track, pages of imperative loops over god knows how many mutable globals and 3 level deep adhoc dicts.

It's worth pointing out that this code snippet is over five years old and the Clojure style and community tools have evolved since then.

That said, if your objection is because it's a lisp and lisps are unfamiliar, then that still remains.

I'm mildly comfortable with clojure, but haven't used it in a number of years. The code linked here looked pretty typical to me; could you possibly elaborate on the differences between this and some more modern clojure, or maybe a reputable link to a blog post outlining the ways the language has changed?
Can you please elaborate how doing a project in Python (I have less experience with Java and am not familiar with Go) is less 'painful' than doing it in Clojure?

Every time when I am trying to switch back from Clojure to Python, I expect to find a (maybe slightly more verbose) language with mature infrastructure, extensive documentation and tons of accumulated knowledge on StackOverflow and elsewhere. Every time, I find out that the dependency system is strange at best, there are still a lot of poorly documented libraries where the features I need have not yet made it into the release for several years.