
Steve Yegge's foreword to Joy of Clojure - calibraxis
http://www.manning.com/fogus/excerpt_foreword.html
======
d0m
Just a word.. not that it is really relevant but I wanted to share this with
fellow hackers. To encourage the Clojure community/language, I've pre-ordered
the book Joy of Clojure on amazon. On the book's website, it is clearly stated
that you also get a free pdf of the book _before the release date_. So, I was
pretty enthusiastic about starting to read the book.

But then, I find out that you only get the pdf if you ordered from manning..
So, I email manning saying that had I know about the "order at manning instead
of amazon", I really would have bought it there and that I'd be more then
happy to blog about "Joy of Clojure" and give a link to manning's order web
page.

So, then, I receive an email saying (summarized in my word): "Fu, it's your
problem, next time buy it at manning, not amazon".

It really frustrated me.. I mean, isn't it the best way to demolish someone's
best intention? I just feel like never ever buying anything from manning;
never ever linking anything to their website, and spread the word about that
story.

Am I over-reacting? What's your thought on that, fellow HN-users?

~~~
JoachimSchipper
You gave a significant chunk of their profit to Amazon; it would be nice if
they still gave you the PDF (which is the bonus for ordering directly from
them), but not doing so is just "not nice", not rage-worthy. If you really
wanted it, you could have cancelled your Amazon order and placed your order
with manning...

~~~
d0m
The thing is, on joyofclojure.com, it says:

"[...]The Joy of Clojure can now be pre-ordered, which gives you access to the
entire book as a PDF now, plus other formats including the printed book once
they're available."

Which is misleading because you only get the pdf if it get pre-ordered FROM
MANNING.

And, yes, you are right that I give a part of their profit to amazon, but I
_still give them money_.

Maybe you are right that it is just "not nice" and not rage-worthy. Still, I
don't like the idea of a company being "not nice" to someone giving them
money.

~~~
gojomo
Yes, that should be worded clearer. But, there's still a way for you to get
the advance PDF and Manning to get what they expected in return: you can still
cancel your Amazon order and order from Manning instead.

Problem solved. If you don't want to do that, _then_ you're over-reacting.

------
euroclydon
It would be nice, when there is a thread on Clojure, if at least one person
chimed in and gave an example of a problem where this lisp dialect on JVM
helped them to solve a problem faster than using an existing language, like
Python, C#, Java, or whatever.

"Drinking through a fire hose", "understanding corner cases", and such are
just euphemisms. Where's the beef?

~~~
arohner
Here's an easy example. In some code I'm writing for my startup, I'm
attempting to build the DAG that maximizes a scoring function. I permute
through the candidates, and then run a scoring function. I perform greedy hill
climbing , and return the DAG with the best score.

Since this is Clojure, and my DAG is build from Clojure's persistent data
structures, iterating through all possible dags is easy. Clojure's "update"
functions return new structs that share structure with the original, both the
original structure and the new one exist at the same time. If I were using
mutable data structures, I'd either have to deep copy a new DAG (slower), or
write "rollback" code (buggy).

Additionally, because the Clojure data structures are purely functional, and
Clojure includes tools for multi-threaded synchronization, parallelizing this
algorithm is trivial.

A separate example: I have an existing function that can take several minutes
to an hour to run. I wanted to add a button to the web UI that says "go run
the function". Of course, you don't want multiple versions running at the same
time, so you need to queue up the function call, and you don't want the user
to queue up 5 calls when they only need 1. It took all of about 4 lines of
clojure to make the function run in a separate thread and handle all of the
above issues, and I'm guaranteed to never have multithreading bugs in that
code.

In summary

* purely functional data structures greatly simply multi-threaded programming, and make some algorithms easier to write.

* Clojure is designed from the ground up to make multi-threading easy and painless. Many multi-threading tools are built into the language, and you don't have to deal with locking and deadlock unless you drop into the Java synchronization primitives.

~~~
herdrick
Thanks for this. I didn't know about update-in. Are there other 'update'
functions?

However, it's a good thing you want a DAG, because with immutable data
structures you're hosed if you want a cyclic graph. Or at least you won't be
building them out of such structures, which means you aren't getting to use
Clojure's functions for sequences, collections and maps. Thus Clojure does not
seem to be a good tool for graphs.

~~~
arohner
Actually, when I said 'update', I meant the functions that in standard
languages that would modify the existing structure return a new one, but it's
great you found update-in. That's a beautiful function. There's also assoc-in,
which is basically just a more specialized assoc-in.

I've built cyclical graphs in Clojure. The simplest form looks like

    
    
       {:nodes #{:a :b :c}
        :edges {:a #{:b}
                :b #{:c}
                :c #{:a}}}
    

(for non-clojurians, {} is a map, and #{} is a set)

------
gtani
4.2 on the Rant-o-meter. _"fashion-driven to a degree that would
embarrass..."_ more Yegge yadda-yadda.

Not sure if i prefer "class-five tropical storm" or a fire hydrant book shoved
up. But those fire hydrant books, say,

\- Wampler / Payne's Scala book, or

\- Cesarini /Thompson's Erlang book

\- Syme/Granicz/Cisternino for F#

\- (dunno if real World Haskell is a fire hydrant; dunno which are
scheme/common Lisp fire hydrants, and ocaml doesn't have one)

are very important, not to read in their entirety, but to figure out where to
find stuff when you're hauling yourself out of intermediate developer-ness
i.e. get you up to understanding production code, and cover the edge cases so
you can figure out the corner cases and save you asking hundreds of questions
on stackoverflow. Somewhere in amazon i wrote a book review that tutorial
books cover 1 sigmas of the language, standard libs and dev environment, but
books that cover 2 sigmas are rare.

And this is that book for clojure. And clojure does have that "perfect storm"
feel

~~~
dons
> dunno if real World Haskell is a fire hydrant;

We certainly tried (and it ended up being 3x bigger than we planned):
<http://book.realworldhaskell.org/read/>

------
reinhardt
"Clojure has only been out for three years, but it’s gaining momentum at a
rate that we haven’t seen in a new language in decades"

[citation needed]

Unless the context is HN threads with "clojure" in the title.

------
JoachimSchipper
Context: [http://steve-yegge.blogspot.com/2007/02/next-big-
language.ht...](http://steve-yegge.blogspot.com/2007/02/next-big-
language.html) is/was reasonably well-known, and people have been speculating
on which language he meant ever since [EDIT: see reply by dpritchett]. Steve
Yegge doesn't quite come out and declare his preference, but...

Sadly, he's not written anything on his blog in a while.

~~~
dpritchett
Yegge has since admitted that NBL was Javascript.

Clojure hits the sweet spot between Yegge's "JVM languages shall inherit the
earth" rhetoric in the fabulous "Rhinos and Tigers" talk and his longstanding
fondness for Lisp. Clojure will probably never eclipse JS in mindshare even if
it is a wonderful language.

[http://steve-yegge.blogspot.com/2008/06/rhinos-and-
tigers.ht...](http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html)

~~~
billmcneale
> Yegge has since admitted that NBL was Javascript.

Not really, no.

I work with Steve, and he's always been saddened that nobody really understood
that the language he describes in his NBL article doesn't exist. He was hoping
that someone would invent it.

~~~
jai
During his OSCON 2007 talk, Steve does say that "NBL" is JavaScript 2. Watch
<http://blip.tv/file/319044/> around the 24:40m mark. Then again, I don't know
what's his opinion at press-time.

------
JSig
Attn MEAPs: I was notified this morning of the following:

"We are pleased to announce that The Joy of Clojure is now complete! As a MEAP
subscriber you can download your copy of the finished ebook right now! "

I was starting to wonder if I was going to ever get a final copy.

~~~
niels
I just requested a refund for MEAP for "Secrets of the JavaScript Ninja", that
I ordered almost three years ago. I didn't expect it to take that long...

~~~
jdludlow
At the risk of sounding like a broken record on this topic, I will state again
that "Joy of Clojure" is a very good book. (I'm a Clojure newbie, so I can't
judge its technical content, just that it is well written.) The Manning early-
access program is highly disappointing. We got an update in August 2010, and
then again on March 18, 2011. Nothing in between.

When I pre-order from PragProg they update their PDFs much more often, and I
can see the evolution of the book.

~~~
claesh
I just downloaded the finished ebook. Searching for "monad" returns three
hits. :lemonad, one mention to monadic and one mention of monads in the source
list. I was a little disappointed.

~~~
fogus
Because you have a fever, and the only prescription is more monad? "Monad" is
a loaded term and we didn't feel that talking about them in that way added any
value to the book.

~~~
claesh
I don't know what you imply with fever, I am not a native english speaker, but
I just paid for your book. I am also a beginner to functional programming and
curious about what monads are and I have read about them without really
understanding them.

I was reading up on monads the last two weeks, these are the good sources I
have found for Clojure: [http://onclojure.com/2009/03/05/a-monad-tutorial-for-
clojure...](http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-
programmers-part-1/) <http://intensivesystems.net/tutorials/monads_101.html>
<http://vimeo.com/20717301>

~~~
mechanical_fish
_I don't know what you imply with fever_

Let me help. The "fever" line is an offhand reference to this fairly famous
piece of American culture:

<http://en.wikipedia.org/wiki/More_cowbell>

You should obviously not feel ashamed for missing the reference completely. ;)

------
melling
Throwing down a challenge in the preface. That's a great way to sell a book to
developers.

------
vidar
Damn I miss that guy.

------
jackfoxy
Why does he mention .NET? I have not heard of Clojure being available on the
.NET stack.

~~~
fmw
Actually, there is <https://github.com/richhickey/clojure-clr>, but the JVM is
still the preferred platform for Clojure (although I'm sure the CLR version
would be picked up once someone comes around that cares enough or in the
hypothetical event that Oracle would ruin the JVM platform somehow).

------
swah
I think shoving an "hydrant up in the *" won't appear on the preface...

~~~
St-Clock
I just bought the ebook version and it appears as is on the preface.

Not that I bought the book for the preface...

------
eneveu
Looks like dpritchett was right all along :)

<http://news.ycombinator.com/item?id=1579118>

------
myth_drannon
English is not my first language but: "So nobody could be more surprised than
I that a Lisp dialect ..." shouldn't it be "than ME"

~~~
jdludlow
The rule of thumb would be to fill in the implied verb and see which one makes
sense.

"So nobody could be more surprised than I was that a Lisp dialect ..."

"So nobody could be more surprised than me was that a Lisp dialect ..."

Then it becomes clear that "I" is correct.

~~~
billmcneale
> Then it becomes clear that "I" is correct.

No, it's not.

Your sentences are correct, though, but you altered them from the original by
adding a verb, thereby requiring the presence of a subject. The original
sentence doesn't have a verb, therefore they need the object form.

In other words:

"You're stronger than I am"

"You're stronger than me"

This last sentence is the form used in the article.

~~~
jdludlow
_A pronoun in a comparison is nominative if it is the subject of a stated or
understood verb.

    
    
      Sandy writes better than I. (Than I write.)
    

\-- Strunk & White, 4th Edition, section 10. _

I realize that grammar discussions are as boring as they come, but this is a
case of someone learning English so it's important to be accurate.

~~~
ShardPhoenix
Strunk & White is frequently wrong and doesn't even follow it's own rules. For
example, what you quoted is obviously wrong - "better than me" is correct here
and is what anyone who isn't completely pretentious would write.

