Advice to newbie on learning Lisp/Clojure(learningclojure.com) |
Advice to newbie on learning Lisp/Clojure(learningclojure.com) |
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?
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 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.
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.
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.
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).
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
https://groups.google.com/d/topic/clojure/9JufDYgE8DQ/overvi...
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.
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.
Someone needs to do a SICP: The Web Dev Edition
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."
So take it with a grain of salt, I guess.
Try this search on Google: http://www.google.co.uk/search?q=clojure
The very first hit is: http://clojure.org/
From that site, the home site of Clojure, we get:
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.So I hope that's been useful and constructive.
At the very top, in the zero-click info box: "Clojure is a recent dialect of the Lisp programming language."
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.
- the basis of how the classpath works
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.
http://news.ycombinator.com/item?id=1057275
You may think it's witty, but I think it's just a touch nasty, and I would prefer to give a clear explanation.
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...
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.