Live data from Hacker News

Why I'm Productive in Clojure

yogthos.net

51–60 of 99 posts

Re: Why I'm Productive in Clojure

#51
post #26

Earlier quoted context omitted.

Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? The java world is a mess here. Leiningen is pretty great, no need to fragment the community. As far as editors go, I'm perplexed. You can use nearly any editor, why do you perceive the need to use one of these 2?

> Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? I want multiple workflows . A single build tool can accommodate that, but Leiningen can't/doesn't. For example, let's say I have a compiler called mycc. I can build something like this: mycc main.c -o main I might then combine it with an file watcher utility like entr find . -name '*.c' | entr…

> Then why do nearly all (probably 95%) Clojure devs use either Emacs or LightTable?

Why should it even be a question?!

Seeing it this way is a mistake. Most developers use tools they are comfortable with, and beginners use what they see in tutorials.

Now about why this repartition, well: Clojure allows you to work with a REPL. Therefore, it's no surprise that developers stick to the "few" editors that allow this style of development. You can see this going with Scala, too.

This said, nothing I know of in Clojure forces you to stick to those editors. Most Java developers use Eclipse or Netbeans, yet, nothing prevents you to use IntelliJ.

Re: Why I'm Productive in Clojure

#52
post #36
post #34

Earlier quoted context omitted.

You can't wrap it with your own scripting because compiling is too slow. That's the essential problem, Leiningen has to be the center of your workflow. There's no other (meaningfully productive) way. What I dislike is the need to run a background task per-project, every time I work on the project. What I would like is either: 1) Faster (sub 500ms) compile times so that I can flexibly use a workflow I prefer. 2) A "Le…

Fast JVM startup is possible with a preloader like Nailgun. A Leiningen daemon is very easy to create. lein-cljsbuild automatically generates ClojureScript so you can use any editor and refresh your browser. The JVM way of doing things is different but not inferior. You extend Leiningen with Leiningen plugins written in JVM languages, not with external tools. Yes, you can do everything you would ever want to do.

Grenchman is worth a look too: http://leiningen.org/grench.html

Re: Why I'm Productive in Clojure

#53
post #3

Earlier quoted context omitted.

> Any language that lets you spend your brainpower on the essence of the problem is a tremendous advantage and joy. This unlocks creativity and productivity. For some reason the only language that let me reach this level is Python. I tried Clojure and Common Lisp, but for some reason I could never be as efficient as I wanted with them, which I think is a shame because in some ways I think the Lisps are superior to Py…

I use Clojure a lot, and did more Python in the past. Whenever I come back to Python, I am frustrated by being unable to remember what's a plain old function and what's a method, and the differences defining functions vs classes and methods etc.. In Clojure I know it's always (except for interop) just functions on values. Some functions dispatch to an implementation based on the type of the value, as is the case with…

Objects in Python little more than glorified namespaces. I always think of methods as a function that gets the namespace where it was declared as the first argument. Yes, there is the inheritance thing, but in Python it is just a mechanism to organize code.

Re: Why I'm Productive in Clojure

#54

Earlier quoted context omitted.

I'm a strong static-typing advocate, and for years this has put me off learning Clojure. (In fact, my very first HN submission, back in 2010, was about Clojure: https://news.ycombinator.com/item?id=1453259 ). I've been coding exclusively in Clojure for the last month however, and I found it extremely enjoyable to use. Much easier to learn than Haskell, for example, because Clojure isn't purely functional. The key of…

>'s a language designed to solve real-world problems in production environments (hence the focus on concurrency, for example). It would be nice to see example(s) of clojure solving real world concurrency problems.

I learned Clojure from the book Clojure Programming (http://smile.amazon.com/Clojure-Programming-Chas-Emerick/dp/...). Once the book gets past the basics, it starts giving lots of concrete examples for how to solve real problems idiomatically in Clojure.

Re: Why I'm Productive in Clojure

#55
post #3

Earlier quoted context omitted.

> Any language that lets you spend your brainpower on the essence of the problem is a tremendous advantage and joy. This unlocks creativity and productivity. For some reason the only language that let me reach this level is Python. I tried Clojure and Common Lisp, but for some reason I could never be as efficient as I wanted with them, which I think is a shame because in some ways I think the Lisps are superior to Py…

I use Clojure a lot, and did more Python in the past. Whenever I come back to Python, I am frustrated by being unable to remember what's a plain old function and what's a method, and the differences defining functions vs classes and methods etc.. In Clojure I know it's always (except for interop) just functions on values. Some functions dispatch to an implementation based on the type of the value, as is the case with…

In general, Python method is just combination of function object and pointer to "self" namespace.

Re: Why I'm Productive in Clojure

#56

Earlier quoted context omitted.

>'s a language designed to solve real-world problems in production environments (hence the focus on concurrency, for example). It would be nice to see example(s) of clojure solving real world concurrency problems.

I learned Clojure from the book Clojure Programming ( http://smile.amazon.com/Clojure-Programming-Chas-Emerick/dp/... ). Once the book gets past the basics, it starts giving lots of concrete examples for how to solve real problems idiomatically in Clojure.

Yea but I am looking for actually field reports from people solving hard concurrency problems out in the wild with Clojure. I am yet to see one.

Re: Why I'm Productive in Clojure

#57
post #2

> What matters to me in a language is whether I can use it without thinking about it. I love this statement. It reminds me of the what it feels to be good at mathematics (not my words): "Your intuitive thinking about a problem is productive and usefully structured, wasting little time on being aimlessly puzzled." from http://www.quora.com/Mathematics/What-is-it-like-to-understa... The author also says more about math…

> Any language that lets you spend your brainpower on the essence of the problem is a tremendous advantage and joy. This unlocks creativity and productivity.

Isn't that the huge advantage of having a compiler? I can let it worry about whether I connected function input/output correctly and only care about what the function itself is doing.

Re: Why I'm Productive in Clojure

#58
post #2

> What matters to me in a language is whether I can use it without thinking about it. I love this statement. It reminds me of the what it feels to be good at mathematics (not my words): "Your intuitive thinking about a problem is productive and usefully structured, wasting little time on being aimlessly puzzled." from http://www.quora.com/Mathematics/What-is-it-like-to-understa... The author also says more about math…

Alfred North Whitehead on notation[1]:

"By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and in effect increases the mental power of the race.

"Probably nothing in the modern world would have more astonished a Greek mathematician than to learn that...the whole population of Western Europe...could perform the operation of division for the largest numbers....

"It is a profoundly erroneous truism...that we should cultivate the habit of thinking what we are doing. The precise opposite is the case. Civilization advances by extending the number of important operations which we can perform without thinking about them. Operations of thought are like cavalry charges in a battle---they are strictly limited in number, they require fresh horses, and must only be made at decisive moments."

That being said, the proper notation is very problem-dependent.

[1] http://introtologic.info/AboutLogicsite/whitehead%20Good%20N...

Re: Why I'm Productive in Clojure

#59
post #52
post #36

Earlier quoted context omitted.

Fast JVM startup is possible with a preloader like Nailgun. A Leiningen daemon is very easy to create. lein-cljsbuild automatically generates ClojureScript so you can use any editor and refresh your browser. The JVM way of doing things is different but not inferior. You extend Leiningen with Leiningen plugins written in JVM languages, not with external tools. Yes, you can do everything you would ever want to do.

Grenchman is worth a look too: http://leiningen.org/grench.html

Thanks for that! Awesome!

Re: Why I'm Productive in Clojure

#60
post #7

My biggest problem with Clojure (specifically ClojureScript) is that it's too workflow opinionated. Nearly all Clojure devs use 1 of 2 text editors. Nearly everyone uses Leiningen. Nearly everyone uses some sort of auto-builder. Nearly everyone uses hot-swapping. Clojure wasn't even optimized for this workflow, it's just the only one that works. So as much as I love the language I keep going away from it because I pr…

Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? The java world is a mess here. Leiningen is pretty great, no need to fragment the community. As far as editors go, I'm perplexed. You can use nearly any editor, why do you perceive the need to use one of these 2?

Let's not exaggerate things here ;). Java world is fine. Majority of projects are still using Maven.
Post reply on HN