News for hackers. Stuff that matters.
Re:Ask HN: What programming language are you currently learn... by swolchok on Saturday July 04, 2009 @07:51PM (#687738)
I would not advise this style of programming, because it creates a very tight binding between the application logic and the interface. In fact, it's exactly the problematic style caused by GUI builders that generate event handlers and ask you to fill them in.
Re:Ask HN: What programming language are you currently learn... by radu_floricica on Sunday July 05, 2009 @03:37AM (#688026)
I think clojure's use of higher order functions is very well suited for this. With only a "#" in front the code becomes a lambda function. This pretty much makes the whole concept of handler functions void - or at least trivial.

But I'm not sure if it will work out in the end... and I mixed this with liberal use of metadata and thrown away SQL too... mostly I try to go as far as I can and see where I trip. It's fun.

And it does make for some terse code. This for example is the code for changing the person responsible for a brief:

    (html-select (cons {:id 0 :name "- No account -"} 
		       (filter #(:is-account %) @users))
      :selected (:account brief)
      :onchangefn #(do
		     (passoc briefs (:brief %) 
                             :account (Integer/parseInt (:value %)))
		     (return-from briefs (:brief %))
      :onchangeparams (str "&brief=" (:id brief)))
And this really is all of it. No html, no sql, nothing.
Re:Ask HN: What programming language are you currently learn... by swolchok on Sunday July 05, 2009 @02:15PM (#688528)
OK, now you want to develop a desktop version of your application with a snazzy graphical interface. Good luck.