106 points · by tosh · 9y ago · 66 comments
Clojure is declarative, you tell what you want, not how you want it. It uses immutable data structures and functional programming. It teaches you a sane, safe and beautiful way of working on the problems rather than working against/around/because of your language (e.g building OOP design patterns rather than just solving the problem at hand).
Some people might disagree, but Clojure is a very hands-on and practical language. There's not much syntax or quirks to learn; just a big standard library of very useful functions for processing and transforming data.
Clojure's developer ergonomics have spoiled me: I love the repl! And since its stacktraces were the first type of error reporting I was exposed to, I don't think they are as bad as other people make them out to be. Certainly worth the tradeoff considering all the other benefits you get.
Every time I read function first (let's include lisp, scheme or lambda calc way of doing) I get clarity of mind, and spectacular zen attitude to approach problems.
I don't "love" clojure, but I so wish more people started with it.
The biggest pain point is both languages couple objects to polymorphism. Now if i want runtime dispatch, i have to create an instance of an object and push data inside of it.
https://www.youtube.com/watch?v=G8X-yvDWClc
The ideas were great, but it all went horribly wrong with C++ and never fully recovered. Modern OOP has few benefits of the original vision, while introducing a lot of pitfalls that need to be constantly avoided.
Except if you don't know Java.
It won't hurt to know something about the underlying environment you work with but you don't have to.
If it is a dealbreaker you can always stick to ClojureScript, but then you need to know the ins and outs of JavaScript.
"Productive" seems to be the right word here.
http://docs.racket-lang.org/furtle/index.html?q=turtle#%28de...
And today, whenever one of these teaching-kids-to-program language/environments comes out, I always wonder, "is a real language really beyond the 8-10 year old's grasp?" More importantly, wouldn't using something real be more interesting to kids? The excitement of computers was, for me, about what you could do with them, and if that meant having to learn some scary looking "computer language" then—By God—I would! And it would be exciting!
The turtle did nothing for me except count the minutes before I could go and do something else. Thankfully we had a public library that had computer books. They weren't the best, but they were about real computer things.
I wish someone had introduced me to Lisp as a child. It's so fundamental. I remember thinking in similar terms, and would have had my mind blown on so many different levels if someone had introduced me to Lisp when I was 8-10, or even younger.
> And today, whenever one of these teaching-kids-to-program language/environments comes out, I always wonder, "is a real language really beyond the 8-10 year old's grasp?"
> I wish someone had introduced me to Lisp as a child. It's so fundamental. I remember thinking in similar terms, and would have had my mind blown on so many different levels if someone had introduced me to Lisp when I was 8-10, or even younger.
Logo is a real language, and it is extremely similar to Lisp; a lot of people even just refer to it as a Lisp dialect. There's a lot more to Logo than turtle graphics, the same way there's a lot more to Racket or Python or any other language that has a turtle graphics package.
Basically, you were more or less introduced to Lisp when you were a kid, and having to use it in school made you feel like the world viewed you as a lobotomy victim.
The problem you encountered probably stems less from Logo and more from being taught Logo by teachers who barely knew it themselves, and who didn't care about or understand anything beyond turtle graphics, so that's all they're able to teach to students.
Here's a good introduction to Logo by Brian Harvey with an emphasis on symbolic computation: https://mitpress.mit.edu/books/computer-science-logo-style
You quoted my question about teaching-kids-to-program languages, but didn't really address it. Are they necessary? Might they not be detrimental? A kid who's interested in programming: wouldn't they be a lot more excited by, say, HTML and JavaScript—which brings the ability to make websites (!!) —than say, moving a robot, virtual or real.
Then again, it is inherently hugely fun to interact with computers in a REPL-style manner, too. I just never felt inspired by the turtle and only kind of resented it. I wanted to learn about bits and bytes and to understand computers.
Want to know why Lego Mindstorms exists? Well...
https://www.amazon.com/Mindstorms-Children-Computers-Powerfu...
That's the work you need to read - but really, learn about the man, learn about Logo. As others have noted, it's more than just turtle graphics - so much more. Unfortunately, educators still have not grasped his ideas fully, and if you look closely, what is often touted out there for teaching children and others programming - is essentially his ideas, reimplemented poorly.
He has written more on the subject than that one book; and his thoughts and ideas (and Logo itself) aren't really about teaching children programming, but teaching children how to think computationally, algorithmically. He saw how and where things were heading long before many others, and he worked to try to get people prepared. Sadly, all people grasped was turtle graphics, but not the larger picture.
I often wonder where we'd be today had more people truly understood and implemented his (and, to be honest, his "muse" / "mentor" / "inspiration", if you will, in Piaget) methods and thoughts on teaching. Most likely in a much better position as a society...
https://dspace.mit.edu/bitstream/handle/1721.1/5836/AIM-248....
or stitching patterns
might be more engaging
> This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.
#1 reason for a hacker to not work for Google, you could program "Hello, World" and they wouldn't sign off on it.
This is just not true. If you want to write code that isn't owned by the company, you just ask [1]. It takes about 2 minutes to fill out the form.
For one of my projects, the approval came almost insultingly quickly - as if they were saying "please DO NOT associate Google with that idea".
Why should everyone support everything they open-source as an official product? I contest everything you say. This is not the #1 reason. It's not even _a_ reason.
According to law if there is no such clause the developer may claim ownership of code he wrote even if he was employed. The contract protects the company from that but also applies to any code written by employees generally (not a nice thing but prevalent).
https://github.com/google/clojure-turtle/blob/master/src/clj...
https://github.com/google/clojure-turtle/blob/master/src/clj...
The CLJS-macro story is still a little tricky -- CLJS targets the JS runtime, but you can't easily define macros in a self-hosted CLJS REPL (ex: one that you'd embed in a webpage). Lmk if there is a cleaner way now.
https://dspace.mit.edu/bitstream/handle/1721.1/5836/AIM-248....
<smug-mode> On the other hand it also means we will thus be able to one-up Google by using Common Lisp... </smug-mode>
During the time of that Logo class, I tried writing a BASIC program for a programming competition with my new-found confidence. But it was such a spectacular fail that my 11-year old self was literally crying.
I find both Logo and Clojure are profound, simple, and powerful in their own ways. A friend and I are working to take the next step with this project and make this a little more accessible/usable. ;)
I have to say that when I learned Scratch it reminded me of my old Logo days.
More seriously, everything which made MIT to switch from Scheme to Python in the fundamental CS courses.