Hacker News new | ask | show | jobs
by zura 3803 days ago
Looking at ToC, the odd thing about Clojure for the Brave and True is that the very last chapter is:

Chapter 13: Creating and Extending Abstractions with Multimethods, Protocols, and Records

... This chapter serves as an introduction to the world of creating and implementing your own abstractions.

Wouldn't it make more sense to introduce tools for creating your abstractions at least in the first part of the book?

1 comments

No because the topics in that chapter are advanced.
Multimethods - maybe, but I think Records should be introduced much earlier, and probably Protocols as well.

Creating abstractions shouldn't be the most advanced topic in the language.

EDIT: One interesting observation (from the outsider's perspective) - As I see, Clojure encourages use of primitive/language-provided data structures such as maps, lists, etc.. instead of creating your own abstractions and "inventing languages" (this is mentioned in a negative context, in Clojure docs). This is radically different approach compared to e.g. SICP, where creating many mini languages is actually encouraged. I personally find Clojure approach messy and unstructured (Also browsing a code in the wild). Anyway, as I can tell, Clojure has enough support to create well structured abstractions.