Re:Code Quarterly's Interview with Rich Hickey
by kenjackson on Friday June 10, 2011 @11:40AM
(#2641241)
I have to admit, the first line looks like better code in my eyes. The only "advantage" of the second one is that it "handles" null checking. Which really means that I still need to handle what happens when order is null, versus, the non existence of line items, or the non existence of quantity.
The only real advantage I see from the second line version is that I can write that code and run a partially completed program, that for example doesn't have a notion of orders at all -- and the program can still run. But I guess this just boils down to preferences.
Re:Code Quarterly's Interview with Rich Hickey
by calibraxis on Friday June 10, 2011 @07:33AM
(#2640456)
When I briefly used Clojure, I was very impressed with clojure.set. (Probably the "relational algebra" Hickey mentioned in the interview, with operators like project, rename, join, etc. Stuff that anyone who knows SQL will be familiar with. A good example of what such abstractness buys you.)
Re:Code Quarterly's Interview with Rich Hickey
by elmasfeo on Friday June 10, 2011 @08:16AM
(#2640562)
ClojureQL - bringing Relational Algebra back to Relational Databases
http://blog.bestinclass.dk/index.clj/2010/11/clojureql--1.0....
Contrast with the latter, where the get-in function just treats the subject as a nested associative structure. It can handle the null checking, and it doesn't care what my keys look like.