The author seems to think that Clojure has some conceptional complexity to it that is easier to overcome by doing a intermediate step with Racket. But in which way is Racket or any other Lisp an intermediate step?
I had no Lisp experience whatsoever before I started with Clojure, and the only real difficulties I experienced were (in descending order):
a) translating my imperative-style thinking into functional style - this would happen to me in Racket as well.
b) macros - but you don't need to grasp macros as a beginner, that's a topic by itself anymay.
(and NO, the bracket syntax was no problem at all)
YMMV if you have an other background.
It is true: The more programming languages you already know, the easier it will be to learn a new one (iff it doesn't conceptionally diverge too much). But if you don't have that background, why not learn the desired language right away?
My experience is very limited. I've not yet worked through all of Chapter 3 of SICP, and I've not had the opportunity to hack any real code in any lisp dialect since I implemented LispKit one weeked in 1989. However ...
I think there is merit in the simplicity, clarity and purity of Scheme in helping put someone "in the right place" for grokking the real value and real power of Clojure. On the very few occasions I've written in Clojure I've known I've not been really "getting it" and that there's more, but I've felt (pause) overwhelmed is one word ... by the completeness of Clojure. It's a proper language for proper work.
I think I've gained a lot from going back to Scheme's purity and elegance.
It's a bit like "lies to children." We know that Newtonian mechanics is wrong, but we still teach that first because it's easier to grasp, easier to do the sums, and more directly in line with our own experience. But if taught properly (and that's another story altogether) it lays the foundation for being able to do the sums and do the work "properly" in Relativity.
I think Scheme can help to create the functional mindset in an elegant way, before having to worry about real world nastiness.
YMWV, because everyone is different and comes with different skills, deficiencies and baggage.
I definitely disagree that Clojure introduces "real world nastiness" which would prevent a beginner from learning it "the clean way". Clojures data structures are very elegant and easy to grasp (e.g. you don't have to think about pointers or define equal operators, it's all there already). And you can define functions just as clean an "pure" as in Scheme.
I do agree that Clojure is very comprehensive, and can be overwhelming for a beginner. But you could buy a book, which will use only a subset of Clojure at the beginning.
And when you get to the point where you can use the basic data structures and map, filter, reduce them, this will get you very far.
To me, the "real world nastiness" is the Java cruft surrounding it. You don't have to deal with it except to get a nice programming environment running. At this point the options are much more complicated and uglier than DrScheme.
That's not what the author seems to mean though: Clojure's exceedingly cool, but to understand it you need to speak lisp
But I agree, an uncomplicated und "Java-free" IDE would be a great gain for a low-threshold start with Clojure. Clojurebox is a beginning, but it in turn burdens a starter with Emacs.
> The author seems to think that Clojure has some conceptional complexity to it that is easier to overcome by doing a intermediate step with Racket.
The sense I got is that the author believes SICP is such an excellent teaching manual that it's easier to learn Clojure-via-Scheme using SICP than it is to learn Clojure via itself using any other resource.
He's recommending to read/watch SICP and do the examples, which are in Scheme. I think it's good advice to have a Scheme REPL to follow along so that you don't have to worry about the additional overhead of translating to Clojure.
This would actually be an interesting way to learn Clojure: Follow SICP, do the examples in Scheme/Racket and immediately after that the same example in Clojure (the differences should not be abysmal).
At some point though, as Scheme and Clojure diverge, this method would start to become less useful. But at that point, I would argue, you already know enough to take off in Clojure.
This is the approach I took when learning Clojure. I started diving into the language and then stopped everything to learn Scheme. It was painful because I really wanted to be doing Clojure. When I finally got back to Clojure I think that it helped out a ton. Cons, car and cdr oh my!
I believe that doing what I did is not necessary to get started with Clojure. It seems like the choice between top-down and bottom-up design. If you choose Clojure first, you will learn concepts that will help if you should ever approach scheme.
This thread from the Clojure Google group may be of some interest: Thinking in Clojure
I don't agree with the suggestion as I fear that beginning with SICP could just demotivates a beginner and that early positive feedbacks (related to the goal to achieve) are important.
While Scheme is conceptually simpler than Clojure, Clojure remains relatively simple in its conception. Here is what makes it a little more complex:
- one needs to know a bit of Java to really use it fully. The integration with Java is so nice that it's not rare to see direct calls to Java APIs without using wrappers, for instance when there is no Clojure library to do the job.
- one needs to understand the different ways of dealing with concurrency and learn to choose the appropriate one for a given problem.
- one needs to understand how protocols work, when they are needed and when multimethods are prefered. This also implies understanding the differences between deftype, defstruct and defrecord.
That said, it remains relatively simple because you only have to deal with functions, macros and namespaces and all is rather uniform.
Here is what I would suggest to begin with Clojure:
- if you have some Lisp background just pick a book like Programming Clojure (short, nice to read and direct to the point) or Practical Clojure (also short and up to date regarding protocols)
- if you have some Java or OO background but don't find confident enough with a Lisp syntax read the first chapters of Practical Common Lisp and then one of the other books mentioned above. http://www.gigamonkeys.com/book/
This book explains really clearly the why of the Lisp syntax and also macros (better than Programming Clojure on this point but this is mostly due, I guess, to the fact that Programming Clojure is more concise).
There should be no major problem if someone knows both Java and a Lisp. Either reading Programming Clojure or Pratical Clojure should be enough to start with, or maybe this tutorial http://java.ociweb.com/mark/clojure/article.html (I didn't read it but it supposed to be good)
For somebody who don't know neither Java neither a Lisp, I would suggest to understand the following concepts in Java and the JVM before doing the suggestions in the second point (though PCL could be read before learning Java to see why Lisps are so awewome):
- collections (java.util.List, hashmap, set etc.) since each Clojure collection implements a Java interface. This is useful for interoperability.
- interfaces, inheritance and access specifiers (because then you can understand why you can not override a Java protected method from a Clojure proxy)
- some of the most common API like regular expressions, syntax for printf etc.
Can I not defer paying homage to the LISP cult until I achieve a fair amount of productivity in Clojure ?
I am learning Clojure as I work through "Clojure in Action".(Thanks to Manning's promotions-- I also have the "Joy of Clojure" ebook but I haven't opened that one yet). My complaint is that there are not enough exercises in Clojure for beginners. I recall the K&R C book -- it had exercises at the end of every chapter which were very useful. Those exercises are the reason why I can still dive in C with no fear whatsoever .
I understand Clojure's relationship to LISP ; but that doesn't have to mean that Clojure can't have its own set of programming exercises and blogs for the beginners.
But posts like OP are not helpful for beginners. And they are not helpful to Clojure ecosystem as they scare away causal learners.
I'm not sure going down the Scheme->List->Clojure path is the right way to go. First, I don't really know Clojure. But I do think Scheme to Lisp was more painful for me than I think it should have been. I also learned Scheme from SICP, but going to Lisp it seems like I tripped over every little thing.
Things like funcall had me banging my head -- as I didn't even realize that it was something that should be different.
If your goal is to learn Lisp, I'd just go straight to Lisp.
Again, I don't know Clojure, so I don't know if learning Lisp first is really necessary, but if it is, then skip Scheme.
Also, don't do all the exercises in SICP unless you feel like doing so. Some require domain knowledge that you frankly just don't need if your desire to learn these languages is web dev.
"Also, don't do all the exercises in SICP unless you feel like doing so. Some require domain knowledge that you frankly just don't need if your desire to learn these languages is web dev."
I disagree quite a bit... I think the exercises in SICP are really valuable and provide a lot of depth that just reading the text doesn't.
"Someone needs to do a SICP: The Web Dev Edition"
Why? If someone is really interested only in web development in a Lisp, they probably shouldn't go looking in SICP.
On the other hand, I believe that SICP has material that will make any programmer a better programmer, even if there are some examples that require "domain knowledge" (mostly math at the level of calculus). It's about the structure (building abstractions with procedures and data) and interpretation (how Lisp programs are actually executed by a machine) of computer programs, not "Web development with Lisp 101"
This is all from someone who recently finished reading SICP and lovingly doing as many exercises as possible, and is definitely of the same persuasion as the author of the OP, when he writes:
"That's where all the smuggest lisp weenies come from, or go eventually."
I can't work out if that was a genuine question, or a troll. But HN doesn't have many trolls, so I thought I'd answer you straight. I also thought at the same time I'd explain the downvote you got from someone. Ive upvoted you to cancel that out for now. We'll see what other people do.
Clojure is a dynamic programming language that targets
the Java Virtual Machine (and the CLR ).
...
Clojure is a dialect of Lisp, ...
See that? In one search and one click - there's the answer to your question. And the reason you got downvoted was because your question/comment added nothing of value, and it showed that you didn't do any homework.
I believe the question was honest. Someone unfamiliar with Lisp would not know it is a language with dialects. You never hear about a random language being a Java.
Look, it's the nature of text-only that doesn't capture very much of a person's "state". In order to do that with any sort of fidelity, a considerably longer post is required. Of course something short like that could be interpreted as snarky, or it could be interpreted in the spirit in which is was offered, a playful one. I understand, everything here on HN is dead serious and so trying to make a joke will go over like a lead balloon.
I guess what I find disturbing is that if people were to take that comment from a different point of view, giving me the benefit of the doubt (like the original poster was granted), I think people would not be so quick to rush to be offended.
I also don't know if all HN folks know about letmegooglethatforyou.com and I think it's kinda fun and playful.
Lastly, pg is not God, and invoking his name as if he has the "last word" is, I think, not helpful. I appreciate his opinion, but that's all it is. And he ain't perfect, as he will instantly admit. (As I will instantly admit!)
Now, I will go back to being my serious self, because, you know, everything on HN is serious! Laughing is not allowed. Apparently...
I don't agree that everything here on HN is dead serious. However, the bits that are funny also add value. the bits that are funny for funny's sake are quickly down-voted, and generally don't fit with the current sense of the community.
You could've phrased your submission as:
Don't know if people here are aware of it, but if you
were you could've replaced that entire post with <link>
Then it would've been informative as well, and, in my experience, less likely to be downvoted.
Now, I will go back to being my serious self ...
Laughing is not allowed. Apparently...
HN is a multi-cultural place, and the potential for misunderstandings abounds. I've been in countries where what I thought of as a completely innocent remark has been regarded as a serious insult. I don't know how familiar you are with other cultures, but levity is frequently heavily culturally based, and getting it wrong can make you look like a complete jerk. People here usually appreciate the respectful nature of the site.
There is humor here, it's just of a different kind.
Clojure is a Lisp! From Clojure's website: "Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system".
I had no Lisp experience whatsoever before I started with Clojure, and the only real difficulties I experienced were (in descending order):
a) translating my imperative-style thinking into functional style - this would happen to me in Racket as well.
b) macros - but you don't need to grasp macros as a beginner, that's a topic by itself anymay.
(and NO, the bracket syntax was no problem at all)
YMMV if you have an other background. It is true: The more programming languages you already know, the easier it will be to learn a new one (iff it doesn't conceptionally diverge too much). But if you don't have that background, why not learn the desired language right away?