Fork me on GitHub

Why is 'callback hell' considered to be so bad? "Reagent + functiknal reactive programming + js callback hell", in my experience, is easier to debug than core.async.


a bit late on this, but you can see Rich explaining it here:


It usually leads to reverse composition, basically; a difficult-to-read and verbose flow. Nothing inherently wrong, but when you combine it with Javascript and typical JS devs, you get... call(1, 2, 3, function(a, b) { c = a + b; call2(4, 5, 6, function(d, e) { ...


In-line ad hoc nesting


ad infinitum because all they want is procedural code


@qqq i’m starting to wonder the same thing myself. core.async is particularly hard to debug on cljs since it shears off your stack trace. i’ve been meaning to play around to see if clojurescript is inherently flexible enough to do what i need (which isn’t much) without having the indentation hell


@fellshard: maybe my cljs code isn't complicated enough, but it rately gets that level. most of the time it goes:

register_js_handler() {
  stuff that modifies an atom;
then, that atom is reactive, so changing that atom triggers re-reners via reagent/react


I'm speaking mostly of why callback hell gets a bad rap; doesn't mean it must be bad, and in languages designed for it, it works perfectly well. It's a combination of Javascript itself having horrid lambda syntax and the immaturity of many JS devs that gives it that bad rap.


for me, i often have 3 or 4 async things in a row. if you use call backs, the indentation gets pushed right, or you write a bunch of functions with strained names and they have to be written backwards in time. I feel like there must be some sort of threading macro like magic that will fix this for me, but it might not really be possible without better language support

☝️ 4

Hence why it requires languages designed for it. Works extremely well with currying or pipelines.


Anyone know why CounterClockwise (Eclipse) or EnClojure (Netbeans) never took off?


ccw was quite popular back in the days. I guess cursive just ate its marketshare over time.


I would assume as much as there are people that dislike the JVM because its "clunky" they even dislike eclipse more, because its "bloated and slow".


@sveri: Interesting, I didn't realize there was a significant portion of Java users that hate Eclipse.


@qqq while there surely are java users that hate eclipse I was talking more of users of different programming languages that come to clojure.


@gklijs I have a DelayedFn I use:

public class DelayedFn implements IFn {

  private final String namespace;
  private final String name;
  private volatile IFn delegate = null;

  public DelayedFn(String namespace, String name) {
    this.namespace = namespace; = name;

  public Object invoke() {
    return getDelegate().invoke();

  public Object invoke(Object o) {
    return getDelegate().invoke(o);

  ... etc etc ...

  public Object applyTo(ISeq iSeq) {
    return getDelegate().applyTo(iSeq);

  public Object call() throws Exception {
    return getDelegate().call();

  public void run() {

  private IFn getDelegate() {
    // See 
    IFn result = delegate;
    if (result == null) {
      synchronized (this) {
        result = delegate;
        if (result == null) {
          if (!"clojure.core".equals(namespace)) {

          delegate = var(namespace, name);
          result = delegate;
    return result;


Then I have a static function which constructs them, so I use:

val callClojure = delay("my.namespace", "some-var")


val result = callClojure.invoke(a, b, c) as Something


@cfleming thanks I just have one namespace, and a couple of functions, but when I start using more, DelayedFn is nice.


new is reserved by clojure for java interop; is there a three letter word meaning something similar ?`


sow is my favourite.


What is the obsession of Eclipse, Netbeans, JetBrains with XMLconfig files? It seems like I can not build a plugin in any of them without lots of xml files and lots of Java wrappers.


same in Clojure, it's just that XML is a bit more verbose


anyone here use Kotlin? bsides the lack of s-expr syntax, the language looks really nice


Kotlin is very similar to Swift, almost identical in many respects.


Much of the syntax is indistinguishable


I'm trying to put something together using spring, to compare to clojure.


Kotlin is a nice language, succinct and expressive. But, as a lot of other languages, it lacks a good REPL. Or any REPL. Some complain about the REPL startup time, but miss that most web frameworks on the JVM have a longer deploy time for every change than the startup time of the REPL.


For me this is the killer and the main reason I stick with clojure for my private stuff vs. kotlin.


It's pretty solid; I think it's got a feature bloat issue, perhaps, but it does a pretty good job at tackling a lot of very long-standing irritations with writing regular Java. I personally treat it kinda like Java++.