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

It is odd that in the third screenshot there is no visual differentiation between the true and false blocks of an if statement. That's one place where I still kind of regret the genericness of Lisp syntax.

Perhaps place a green outline around the true block, a red outline around the false block (if any), and indent them both slightly or otherwise connect them to the predicate block so that the connections are clear.

Of course one issue with treating constructs like if specially is that in Lisp you can create your own macros that act just like if but then don't get the special visual treatment.



Emacs indents the true and false forms differently:

    (if (foo-condition-p)
        bar  ;; then
      baz    ;; else
      quux)  ;; else
You can also declare the indentation style of arbitrary macros, ensuring that "if" is not just some special case.


This is an emacs lisp-only convention, most likely stemming from the fact that elisp allows multiple else forms (most other lisps don't, which at least for me also solves the problem of visually parsing ifs).


(Following on from the last paragraph) I guess the thing to do is to have a little DSL declaring how to prettyize any sort of block (which I assume already exists for this project to work at all), and then allow the user to customize it to add his/her own.




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

Search: