Hacker News Comments on
The Little Schemer - 4th Edition
Hacker News Stories and CommentsAll the comments and stories posted to Hacker News that reference this book.
Start with The Little Schemer  as a prequel to SICP. If you're going to read SICP, look at the beautiful (and unofficial) typeset version .
I'm currently taking another stab at lispy-languages. I've tried it a few times in the past and I've always had a hard time coming back to it when something else intervenes. Usually self-inflicted because of some complex and unecessary environment setup involved.
I've lately had some success using vanilla emacs, Geiser and Guile (or MIT) Scheme. If you want to work through sicp, the little schemer , or my current favorite "Essentials of Programming Languages", then that's the perfect setup. Racket will work too, but if you're using emacs anyway then it's just as easy to get going with Guile or MIT.
I'd recommend getting familiar with largely vanilla emacs rather than a curated kit, but it will require a little bit of additional investment. Additionally, you'll be getting acquainted with emacs-lisp (elisp), so you'll be swimming in lisp languages.
I'm not a fan of VS Code and only use it for work when I have to (and then only when I can't use vim). I'm sure it'd work, vim too, but there are an awful lot of emacs/lisp resources out there and it's helpful to take advantage of what's available.
The Little Schemer by Friedman is a good choice.
This paper, "Programming by Numbers: A Programming Method for Novices", presents a recipe of how to design recursive functions:
And the "The Little Schemer" book has a series of exercises that expose recursive thinking:
Hope this helps!
I really feel like they should teach LISP in elementary school. It has extremely simple rules to get started and helps people intuitively understand programming concepts. Maybe an updated The Little Schemer style curriculum:
⬐ todd8I've programmed for a very long time, and I've rather incidentally taught and tutored programmers at many levels of ability over the years including some friends that were trying to learn LISP. I see very little benefit in teaching elementary school kids to program in LISP.
My daughter took her first programming course in college and used the excellent book (HTDP), see , intended for beginners that used Racket as the programming language. By the end of the semester she was able to make a simple graphical game. I thought the course was very good and she liked it and still has a fondness for Racket although I believe that she has only used Java, C++, and Python since that class (she is now a CS major).
Learning Racket (which is Scheme and very closely related to LISP) worked out well for my daughter, so why would I say that LISP in elementary school isn't a good choice? Several reasons:
• Lisp isn't a popular language, ranking 28th on the TIOBE list of programming languages so there is far less opportunities to make use of programming ability in LISP than in other languages.
• Lisp isn't easy. The Common Lisp Standard is well over 1000 pages long. It lists over 1000 functions. Take a look at the basic iteration constructs, the most general is LOOP and has a whole chapter, see , in Peter Seibel's excellent Practical Common Lisp, but even the simpler DO construct is no cake walk.
• Recursion for elementary students... LOL
• Smart people have tried introducing LISP based programming to youngsters already and it didn't seem to take off. See Papert's LOGO language from the 80's. I've actually written some programs in it, but I don't remember where I got to use the language. (Perhaps it ran on the PLATO system?). I agree with a number of his insights.
Elementary school children don't understand functions and they really don't even understand basic math. The problem with LISP is that while it has an abstract simplicity that I find appealing and really quite beautiful, it's abstract nature is going to make it difficult for children. Less abstract systems like ALICE or SCRATCH seem a better fit if we insist on teaching kids to code.
I personally don't see the need to teach kids to code. Why not teach them math first. Why would programming come before understanding how to divide fractions or how polynomials work or what simple logical operations mean?⬐ SomeHacker44I did teach my son Racket at age 8, as his first programming language. He was able to make a number guessing game in it. I think we used "Realm of Racket," but I don't recall, as it was some years ago. He's now midway through high school and not a single course at his STEM middle school or high school has come close to teaching him as much as he learned at age 8.⬐ gowld⬐ jhbadgerThat difference is more because classes are designed to be extremely slow and low paced so the worst student can pass. Learning anything with a personal tutor is much more efficient.In a way they did. in the 1980s, Logo was popularly taught in elementary schools, and while lacking sexps, it was clearly inspired by Lisp in the way it was a functional language in the way the other popular teaching language BASIC clearly wasn't.⬐ qznc⬐ haolezThe point of Logo is not to teach programming but to teach geometry. At least that is what I took from the Paperts Mindstorms book. I never had Logo in school myself.⬐ kamaal⬐ bitwalkerYup. Turtle Geometry is a great book on this.
However if you dig deeper geometry is just the beginning eventual goal is to teach you to simulate movement of insects around light, predator-hunted scenarios etc.Yeah, I learned Logo in elementary school and it was something that stuck with me until I actually started programming later on in school. I particularly remember having to write a program to navigate a maze, it was a blast!⬐ perl4everLogo may have more potential than it seemed at the time, but as it was presented in my school, there was not much to it, and I never investigated further after turning to BASIC and then compiled languages like Pascal and C.
With parental guidance, a 7 year old could totally do this. Figuring out how to handle the stack will be the trickiest part, and there are a few examples online of this, so if you nudge them in the direction of others' work, they should be able to get it pretty quickly. They'd finish it by the time they're 8, at least.Forth would be great too. I think there's value in learning a stack based language. That being said I suspect LISP is more practical.⬐ jes5199they’re practically two sides of the same coin. I keep thinking it should be possible to build a toy language that has both a forth-like mode and a lisp-like mode, that use the same standard library⬐ abecedariusThere was a language for calculators called Reverse Polish Lisp. (That's all I know about it.)
If I were to design a language matching that name, I guess it'd be basically Logo written backwards. This might be interesting for a live programming environment, because in Lisp you type a whole expression and and nothing happens till you hit enter; but on e.g. an old HP RPN calculator you see the state of the data change after every keypress. You could design an "RPL" to work that way too, though after every word instead of every key.⬐ dfoxForth is more low level, ie. there is no object memory/GC at what one would describe as implementation level. On the other hand all the Lisp Machines essentially are hardware implementations of something vaguely Forth-like with some level of hardware support for lisp-style tagged pointers.⬐ zentiggr⬐ flavio81A good way to jump over the low level implementation details is to look at Factor. Forth style but much better library and most of the low level constructs are baked in.
> Logo is a multi-paradigm adaptation and dialect of Lisp, a functional programming language.
A summary of the language: http://wla.berkeley.edu/~cs61a/fa11/61a-python/content/secti...
Or the guide for grade schoolers http://www.educa.fmf.uni-lj.si/logo/doc/Apr.96/chpt8.pdf
And yes, I remember making the snowflake back in the early 80's on an Apple ][+ in the grade school computer lab.⬐ SkyMarshalOn the subject of education, pg links to a great story on Scheme (a Lisp 1) in education  from his essay "Beating the Averages" . The story references a book, "A Schemer's Guide" that is a good Scheme/Lisp or programming learning reference .
If you know folks learning programming for the first time and maybe struggling with Java or whatever they're using, these references may help. Sometimes you just need to see things like recursion or currying in a different way for it to click.
:https://schemers.org/Documents/ (more Scheme resources)⬐ astrobe_I think being interested in programming or not is pretty much like sexual preferences: there's nothing you can do about it, and it is not their fault ;-).⬐ goatinaboatI really feel like they should teach LISP in elementary school
They used to... LOGO is a LISP.⬐ pyuser583With great simplicity comes great complexity.⬐ kyle_groveOne might not to want to teach LISP first, for the same reason I wouldn't teach explicit shot mechanics to a six year old playing basketball.⬐ VLMThe entire discussion has so far had no educational perspective.
There are only five memes to make educational curriculum decisions.
1) Most arguments for programming are from programmers who had fun learning to program and if the purpose of K12 is fun, then all kids should have mandatory enforced fun time which means learning to program. Which will not work for maybe 99% of society, although they will be subject to the curriculum. I had fun playing kickball; the purpose of school is to create an entertaining daycare like environment; therefore all kids should be forced to spend lots of time playing kickball. What about learning, or kids that don't enjoy kickball (or lisp?)
2) We have to prep our 5 year olds by teaching solely vocational skills because nothing will change in programming for the next 12-16 years. I'm old enough to remember "vocational training" that amounted to memorizing ancient versions of already obsolete Excel menus and keystrokes. Utterly useless. We like to think "Clojure K12" would be teaching Clojure, we all know its going to degenerate to drill and kill multiple choice tests about emacs keystrokes. A giant scantron test of multiple guess questions asking what C-X C-C does in emacs or what does M-f do, isn't going to help kids in the real world 30 years later. Better off teaching them welding, industry trends seem to imply TIG is a forever skill?
3) We teach critical thinking skills and frankly kids that can't conceptually understand and solve X+1=2 for X are not going to get anything out of programming that they wouldn't get better out of algebra or geometry. And what do we drop from the curriculum to add Clojure? Sorry kids you're not going to learn Trig?
4) We'll do what the cool kids do. If the cool kids district buys ipads, we need ipads. We had millions invested involving no further reasoning. Is the cool kids district using LISP? No? Well at least a third of districts won't even consider it, then.
5) The school board makes all curriculum decisions and they got and keep their job based on religion and/or politics and LISP isn't hitting the election issue hot buttons quite like a nice argument about creation science in biology class or sex ed or the new stadium for the football team.
Industry does not like LISP because is its very expressive and the programmer has the freedom to express any crazy problem solving idea they have in their head. The problem is the human condition of education for the last couple millennia shows its really kinda hard to take a hyper-customized brain dump of ... anything ... from one head into the other. So, it can do anything, any way you'd like, is too much anarchy for any shared work. How this applies to K-12 is if you think grading essays is a PITA imagine trying to grade large LISP projects.⬐ liveoneggs⬐ gowldhey my 1st grader is getting an ipad at school next month to "engage in 21st century learning"Scratch is a better introduction and wildly popular. Scheme is good middle school math classes -- it's smart but doesn't get things done easily. Python is great for getting cool stuff built once kids can handle syntax.⬐ cocktailpeanutsYou don't understand why kids would want to learn programming. At least those who do, want to learn because they can build cool things they can show off to friends.
It's not about whether a programming language is simple or not. (I actually think LISP is not as simple to understand as imperative languages, unlike most nerds think) It's about what you can build with it.
For example, my first experience with programming was to build a game. If someone had tried to force-teach me LISP, it would have actually had opposite effect on me because then it would be no different from someone trying to force teach me some boring subject I have no interest in. The best way to teach something is to provide gratification. LISP is only gratifying to nerds who marvel at its "elegance", but it has no ecosystem which has tons of cool projects like fancy graphic engine or fancy game engine. It's just a "cool" language to nerds.
Examples of educational languages would be Alice and Logo, and they're both pretty bad at actually doing anything.I learned Logo in elementary school. I thought it was required for everyone just because learning about line segments and angles are a part of the maths curriculum and Logo just fits so well.⬐ Koshkin⬐ mstA piece of paper, a pencil, a ruler, and a compass - these are the best tools to learn about geometry. (It’s like having a cat is the best way to learn about cats - vs., say, watching YouTube videos.)I do wonder now how much the fact that I had to circumvent the system security to get to the startling line made me enjoy spending my lunch break writing QBASIC at high school.⬐ ksajHere's something that might surprise you: https://ccl.northwestern.edu/netlogo/index.shtml
This provides a 2D and 3D NetLogo installation. The 3D version blows my mind. You can spend days going through the samples. When you look at the code after you watch a simulation, it's a bit of a shock how compact and readable it is. It's definitely a whole lot more than what they taught you and I alike in middle school.
> Lisp should be forbidden to young programmers, precisely so they'll go seek it out.
Unless it comes with a turtle, of course. Then they might end up writing the next greatest flocking algorithm.> You don't understand why kids would want to learn programming.
I started by typing in listings from a book (101 Basic Games). Then I'd start modifying the games. Then I'd write my own. It's how people learn.
For a famous example, look at the Beatles. They started by copying other tunes. Then they modified the copies. Then they wrote their own.⬐ chrisseaton> I actually think LISP is not as simple to understand as imperative languages
Lisp is an imperative language. The order of execution is defined and you use side effects.⬐ kickJohn Carmack seems to disagree.
https://groups.google.com/forum/#!topic/racket-users/yjRuIxy... (Make sure to look around in this thread; he has a few comments.)⬐ solipsism⬐ jacobwilliamroyI would love it if he found it endlessly fascinating and spent all day programming on his own, but he does need a bit of a push from mom and dad. He enjoys it, but given the choice, he would still rather play games than make them :-)
You didn't pick very good evidence to support the idea that picking a LISP is a great way to get kids to love programming. This only supports the idea that Carmack thinks that learning a LISP is good for his son's development.⬐ cocktailpeanutsThis is because people who are really great at something have already forgotten what they used to be like when they first started out. They just tend to think everybody would be excited about the cool thing they themselves are excited about.
In most cases, people who are masters at something tend to be the worst teachers because by becoming the master they have forgotten how to sympathize with complete newbies.⬐ kickHe successfully taught his child Lisp, in a way that caused that child to release a video game. He didn't forget anything.⬐ Gatsky⬐ threatofrainI think this only proves that you should teach your kid Lisp if you are John Carmack.⬐ erik_seaberg⬐ cocktailpeanutsOr that you should teach a kid Lisp if he is a descendent of John Carmack (or probably Paul Graham).⬐ westoncbMaybe descendants of Paul Graham should be taught C if Carmack's kids are learning Lisp.If he was given a chance to go back in time and teach his younger self to learn whatever language he wanted to make himself learn, I'm pretty sure he would have NOT Picked LISP and picked exactly the same language he used to build his first game.⬐ abraxasA kid of John Carmack is likely to have a cognitive capacity that is a standard deviation or two to the right of even the "smart" kids in class. Genetics isn't everything but it's not nothing.⬐ AnnatarIntelligence is inherited from the mother, not the father. That's standard content on the United States Medical Licensing Exam ("USMLE").⬐ blueblimpThis sounds like a myth, as I have never seen such a thing suggested by any expert on the subject.⬐ Annatar⬐ lonelappdeWell I sat through quite a bit of USMLE prep and it's there.That's a poor paraphrase of "recent studies suggesting [testable IQ]'s mostly from the mother".⬐ casualrandomcomI don't know how this ended up in the USMLE but AFAIK, it has long been debunked... unless for "inherited" you mean something other than "genetically transmitted".
See "Not in our Genes" by Lewontin, Rose, Kamin, for a thorough discussion.
In practice, it is a result based on twin studies, but with very low standards: for one thing not double-blind, definitions were let swing arbitrarily by the interviewers, and so on.
Definitions of intelligence are themselves questionable, techniques to measure it, even more so. The history of IQ has been tainted by plain fraud... And the whole field is too a succulent target for ideological warfare... truth is too easily a collateral casualty. This should not be considered science.People who are very good at things are the ones you want mentoring you, regardless of the subset who are bad teachers.⬐ blihpOr they remember all too well. Another way of looking at it is that people who have gotten good at something can look back and see the things that hindered their progress. Like many here, my first exposure to programming languages was BASIC and 6502 assembly language. In retrospect, I can see that they were horrible languages to start with because they taught me some very bad habits that I had to unlearn.
It is possible to teach someone Lisp, or something like it, without teaching them all of it at once... if ever. There are lots of people who use CAD systems like AutoCAD, or Emacs, or the various Lisp based/inspired Expert Systems shells, etc. who wouldn't consider themselves 'Lisp programmers' who learned just what they needed to be productive. If people were exposed to it a bit at a time, rather than the fire hose with minimal direction, I suspect a lot of complaints could be addressed. For example, the reason people think all the parens are bad is because it's become a meme and it's different than what they're used to. If they had started with Lisp and never learned ALGOL-inspired syntax, semicolons would likely look very strange to them.⬐ dTalI credit my earlier exposure to BASIC as a very good introduction to programming, because of its bare-bones nature. Too much abstraction would have been overwhelming, to start with - I didn't even understand the purpose of GOSUB for a long while (I knew, mechanically, what it did, but I did not grasp why one would use such a construct instead of just putting all code inline). The simplicity made it an easy outlet for creativity, and pushing the language to its limits and finding the complexity more and more difficult to manage was key to my eventual enlightenment - advanced language constructs felt like gifts, rather than burdens.
Of course this process could be done in an advanced language that grows with the user, but most modern languages are not that - even Python expects the user to understand at least the rudiments of structured flow and objects almost immediately. Lisp (Common or Scheme) isn't it, either - lambda calculus is already far too abstracted from the "series of instructions" model which is a critical foundation for computing in the real world. C, my next step after BASIC, has quite a good balance of available abstraction and a tractable mental model; but the amount of boilerplate (the requirement for main() always seemed baroque to me) and hand holding of the computer (total lack of even trivial type inference) is not ideal for a beginner language.There is a LISP textbook now that teaches LISP by writing videogames. It's called Land Of Lisp. And there are LISP game dev communities operating on twitter or IRC, organizing game jams:⬐ OrebLisp (especially Common Lisp) works just fine as an imperative language, even if it’s not the most common style. And there are entire books written about using Lisp for game development.
If the goal is for a beginner (whether child or adult) to be able to make cool things fast, Lisp is a great choice. The interactivity and the simple syntax makes it very easy to get up and running compared to more mainstream languages.⬐ cocktailpeanuts⬐ scytheWhen was the last time you saw a kid who made a cool game or software and made money using LISP?
The best motivator is recognition. Kids don't care if a language has books and whether there "exists" a game development kit. They only care about how much satisfaction they will get by learning something and building something with it.
LISP won't get you anywhere in that sense. Sure you may learn some programming concepts, but the ROI is not worth it. Kids might as well spend a bit more effort to learn languages with more exposure and actually feel the satisfaction of having real users.⬐ flavio81>LISP won't get you anywhere in that sense. Sure you may learn some programming concepts, but the ROI is not worth it.
Do you want your kid to learn actual computer science, or do you want him/her to basically be able to create a cookie cutter mobile app?⬐ jimmyvalmer⬐ AnnatarJust getting him to read a book or go outside would be progress.⬐ cocktailpeanuts> Do you want your kid to learn actual computer science, or do you want him/her to basically be able to create a cookie cutter mobile app?
This is exactly the point I was making in the ancestor thread. If you want your kid to learn computer science, you don't force feed him/her things they will have no interest in immediately. Instead you teach how to build a "cookie cutter mobile app", and they will get interested and go from there and teach themselves racket or lisp or whatever you originally wanted to force feed them.That's not true at all: as a kid, I had to do inordinate amounts of reverse engineering precisely because I didn't have sufficient documentation, and what little I did have was in a foreign, non-English language I did not understand! I would have loved to have had books on how to program!⬐ kazinator> teach them Swift or Java
That's basically child abuse.⬐ Annatar...And then some. That would be enough for me to report the abuser to child services.⬐ cocktailpeanutsI would say teaching LISP is more of a child abuse than teaching Swift or Java (FYI I am not a fan of Swift or Java either)⬐ abraxasThis is such hipster arrogance it makes me angry.⬐ AnnatarNo it isn't, he right. It's child abuse. Not Swift, but Java is definitely child abuse.⬐ cocktailpeanutsJava the language is shitty, but that's the language you use to build Android apps. And most kids own Android phones. Kids want to show off to their friends and the best way to do that is to build mobile apps nowadays.⬐ AnnatarWell then it's simple: can't have a good platform built with a shitty language.So on the one hand, I wrote a Tactix GUI in Java/AWT in my first high school programming class which covered mostly Java with turtle graphics. I can agree that kids who want to learn programming want to make games.
But that Tactix GUI took me two months of sustained effort, lasting longer than any of the actual class projects. Most of the students struggled to draw a circle. It took weeks for us to get to "implement a method that takes an argument".
If you're looking at teaching programming concepts to elementary school children, i.e. to most kids, building applications doesn't seem very likely to me. It takes a long time and small children have poor memories for long-running projects.
If the programming is supposed to support elementary math and logic for kids who are getting used to the notion of "variable" in both programming and math contexts, teaching the kids to write the sieve of Eratosthenes or Babylonian algorithm really does seem like the way to go. Not because it teaches them to be good programmers or to like programming, but because it teaches them to think, and they're mostly not going to grow up to be programmers.
If, however, you want to entertain the minority of schoolchildren who do like computers and want to learn to program, then using an easy graphics library with good deployment tooling makes sense. Those kids do want to spend two months or so making a game. But that doesn't, to me, seem to be in the spirit of 'proximitysauce's comment.⬐ blondin> ...my first experience with programming was to build a game
most of us!
we have made it difficult to show our games and stuff to friends. except for minecraft and game mods. that's why kids gravitate towards those.
as a side note, i was thinking last time that programming is difficult to teach nowadays because when you boot your computer or phone, it doesn't drop you into a shell or command prompt.
so few people nowadays know that you can actually give commands to your computer or phone. so the concepts is not familiar to most!⬐ gtycomb> At least those who do, want to learn because they can build cool things they can show off to friends.
I have no doubt about what you say. I had a really broken laptop that my 3rd grader happily tookover as his laptop, a linux machine mind you, about which he knew nothing about. I showed him how to open a terminal and use some bash commands, and how to invoke the Python interpreter and import a turtle graphics module. He was hooked and had lots of fun moving the turtle around (along with the incentive to learn some math at his level). I remember the day he walked to school with this duck taped laptop on a show and tell day, which ended up with the school's IT departement making Python available on all computers in that elementary school lab. I don't think he could have pulled this off in lisp. Beautiful language Lisp,but I don't see how I could have helped with graphics programming within an hour or so -- which was all what he was interested in.⬐ taeric⬐ Raphael_AmiardPretty sure Logo was originally implemented with a lisp, no?
Don't fall into the trap thinking lisp is just functional.⬐ flavio81>Pretty sure Logo was originally implemented with a lisp, no?
Logo is a bare-bones Lisp disguised as an educational language.⬐ pgtan⬐ dTalBut it is also a excellent concatenative (left-to-right) language with brilliant procedure definition mechanism. Here as example, an oneliner to draw ascii christmas tree, we made with the kid last year:
? tanne.print tanne.output tanne.shift tanne.split 19 3 3⬐ taeric⬐ kamaalWhat are you using to execute this? The Python module?⬐ pgtan⬐ lonelappdeBerkeley Logo (brand new in version 6.1). I have compiled two versions, with and without wx.
The file with the procedures is on github:It's a bit silly to hide the work in a method call and call it a "one-liner".I recently picked up 'Turtle Geometry' from Abelson and diSessa. And it was a mind blowing experience.
Really makes you think what kind of fun programming was about back then and its potential. Frankly speaking you begin to feel programming has kind of lost its way.⬐ taericIt is still somewhat there. Just competing with a lot more advanced things now.
I also picked up that book. What are you using to work through the exercises?⬐ kamaal⬐ lonelappdeI'm using TerrapinLogo. Its free but not quite, but works for the most part. Also supports multiple turtles.All the easy problems are solved. Logo and processing and scratch exist Programming didn't lose its way, it move forward on its way.So, someone had lisp, thought "I want to teach people programming", and instead of just teaching lisp directly, chose to implement something quite different in syntax and spirit?⬐ taeric⬐ gumbyTo be fair, that is the lisp spirit. They wanted to do something, imagined what that language would look like. And then implemented it in lisp. :)Logo basically was Lisp -- a small parser on top of MACLISP.
There were some later small implementations (e.g. for the Apple II) that were written from scratch and didn't need to implement all of Lisp (e.g. lambda, plists, etc).⬐ mstDoes that make logo the sole truly successful form of m-expressions?⬐ lonelappdeNo, because m+expressions are syntax and logo has a different syntax, and because Mathematica is a successful use of something much closer to m-expressions.I sympathize with the general message of what you say but:
- it is completely possible to build cool things with lisp, as highlighted by some other people who answered your message.
- your pejorative use of the word "nerd" above is really annoying and doesn't bring anything to your argument.⬐ __sYep. From age 12 to 15 I messed around in Game Maker, didn't need anything else⬐ crazypythonArras.io is an MMO with 50,000 monthly players. You can remix a version here. https://glitch.com/edit/#!/arras-template?path=README.md https://discord.gg/JrwVT3F Multiple people have learned to code using only Arras.io and its community.
I am doing a rearchitecture of the game's code.⬐ earthboundkidFWIW, I was taught Scheme as a kid in nerd camp (maybe seventh grade?). I had previously learned BASIC. I didn’t notice anything very different. I didn’t understand it really. I didn’t use it once the summer was over, probably just because of lack of learning material.⬐ pmelendezSome people would disagree with you.⬐ GFischerI went to a talk by cognitive psychologist Dan Ariely, and he very much agreed: said that he tried to get girls into computer science, in Israel they had a 6-week introductory course, and that class SUCKED at getting kids interested (actually negative effect).
Ariely said there are actually better ways to get people interested, which is to show them something meaningful.
https://www.pscp.tv/w/1yNGapZbZElKj (see minute 15 and ahead)⬐ gdubsI can totally imagine a LISP inspired course of learning in a Montessori classroom. Elements, lists, functions — all somehow through physical, tactile objects.⬐ didibusQuil is pretty cool for that: http://quil.info/
Build on top of Clojure's CLR support, obv.None⬐ serf>You don't understand why kids would want to learn programming. At least those who do, want to learn because they can build cool things they can show off to friends.
I mean, this isn't true for everyone of course, but I began learning to code at around 8 or 9 years old because I was heavily interested in math and numbers, and precisely because I didn't have many friends (or brothers or sisters) to occupy my time with when I was very young.
I agree with the premise that the majority of folks learn better with a practical goal in mind, but I disagree with you that there exists only one kind of curious child.
I had a second-hand IBM XT from my fathers' shop at first, and I wanted to learn how to do things with it.
That equipment being available, in my opinion, was the biggest motivator in learning how to use it.
It was there for me to use, the limit was simply my knowledge of how to use it, and that was a very enticing proposition.
My first project as an 8 or 9 year old was a prime number generator (a naive sieve). I had read a book about patterns, and primes had been mentioned. I took a trip to the city library (another rarity statistically?) and picked up a guide to Pascal that was written towards small business owners and non-CS college students to help them with simple automation, and got to work looking up terms.
A week or two later I had a CLI program that spat out primes as fast as my computer (or my poor implementation..) could make them.
I then tried to use those primes to draw trippy pictures, which began another foray into programming topic that were new to me, necessitating more work looking up terms and generally haunting the library.
Years later, when I was a teenager, when I ran into like-minded computer folks and we'd get to talking, that same prime generator got spun into a small benchmarking suite that my friends and I toyed with before the multi-core trends.
so.. I guess that the "show it off to friends" thing still happened, but knowing myself and how I learn, I doubt that i'd have ever been interested in a hobby that was pushed towards me by authority figures as being useful.
I have a hard time conceiving how I would become a 'computer person' now-a-days, in fact. I was so anti-social and actively hostile towards teachers that the idea that one of them could have tutored me in the hobby , quite counter-intuitively, may have been the exact reason I would have avoided it as a child.
really, my grand tl;dr : "There is no one teaching method."⬐ Waterluvian100% agree. As a kid all I cared about was making cool stuff. My code was a disaster. And I did just fine with Java anyways.
Last year Clojure made it to #1 (2019), improving from #3 (2018) in the SO salary cahrts.I'd argue that racket's ecosystem is ideal for getting young people interested. You can build gui tools and do graphics programming out of the box, very easily.
My go to language to refer people who want to learn is Processing though. Easy to use, and the documentation is fantastic (and Dan Shiffman is IMO the best programming educator out there for kids and adults alike, whether or not you like his high-energy style).⬐ chairmanwow1I absolutely agree. I watched many of his videos as a professional programmer just because it’s fun to watch him build cool visualizations. He’s super charismatic and looks like he’s having genuine fun in figuring things out.
The Little Schemer  doesn't assume any prior knowledge of programming yet teaches programming and thinking in Lisp. Also, it has a lot of cartoons and jokes to keep young folks interested.
A Tour of Go  (If you are a novice, you really should try writing the programs yourself. You will end up finishing it in an day or two. If you just read through, it would be just a couple of hours)
The Little Schemer 
This reminds me of the style of The Little Schemer which a lot of people love but which I found to be plodding and insufferably condescending.
The classic systems were worlds ahead of most modern ones in one very important respect: documentation.
The Tandy/Radio Shack books for the Color Computer series (and it's astoundingly good LOGO implementation) were amazingly clear and concisely written with lots of examples, and because in those days even a disk drive wasn't a guarantee, all the examples were written to be hand-typed and experimented with.
There were even books in those days that aimed to teach kids machine language! 
That said, I think Djikstra and Felleisen may be slightly right about the long-term usefulness of old-fashioned BASIC and LOGO for learning, but there are a few books in modern languages that come close.
Hello World! was explicitly written to hearken back to those old manuals, by a father aiming to teach his 12-yo son programming with Python.
Land of Lisp and Realm of Racket also call to mind those old books as well, though they're targeting a bit older audience and have their quirks (LoL is a bit in-love with huge nested trees and a-lists in the examples, and Realm of Racket tends to gloss over a lot of the examples and expects you to just read the sample code rather than walking you through the process completely).
The Little Schemer is also a fantastic little book that takes on the form almost of a set of brain-teasers, and teaches recursive thinking entirely by example and in methodical detail. The later chapters can be a bit stumpy, but if you go through the book step by step in regular sessions it builds on itself pretty well.
All of these are aiming at around the 12+ age range though, I don't think there's much out there anymore for anything younger.
To understand the theory of recursive functions you must understand fixed points, but I think there's a simpler way to understand the magic of the Y combinator.
Here's how it works. Say we have a recursive function like map:We want to write this more primitively, without explicit recursion. How can we do that? Well, if it's possible at all, we obviously need to get rid of the map on the right hand side of the second case.
map f  =  -- We'll ignore the base case since there's no recursion here map f (x:xs) = f x : map f xs -- This is the interesting part
How? Well, let's abstract over the recursive call, replacing it with a function that we'll add as parameter to our definition:(Read map' as "map-prime", i.e., a variant of the definition of map.)
map' _ f  =  -- Still boring map' g f (x:xs) = f x : g g f xs -- Pay attention for later!
All we've done so far is replaced map' where it should be on the right-hand side of its own definition with g, and then added g as parameter of the function. We end up with a double g on the right-hand side because of that added parameter.
OK, now what? Well, we need somehow to make g be map', the thing we're defining. which means we need somehow to pass our definition of map' to itself, so that (in the second case) we'd end up with something that evaluates to:Then the right hand side would obviously be right; it's what we were shooting for at the start (assuming we can get map' map' to equal map, which is what we're trying to do). The left hand side looks a little strange , but it's just saying that we need the first parameter of our definition to be the the thing we're defining.
map' map' f (x:xs) = f x : map' map' f xs
So how do we make this happen? Well, what is map map f (x:xs)? It's map applied to itself, then to some other arguments we need. So the key, it seems, is to figure out how to apply map to itself. Well, in the lambda calculus that's pretty easy :That is, why is just
why f x y = f f x yOK, so fix takes a function and applies it to itself (after applying it first to arguments x and y). Great. That's what we needed. Now we can take our defintion of map' (the one marked Pay attention for later! above) and do this:
lambda f. lambda x. lambda y. (f f) x) yAnd I've re-used the name map there because we can easily show that this definition is equivalent to our original definition of map by showing that it reduces to the same expression:
map = why map'Which, if you keep expanding the expression map' map' f xs, you will see is indeed equal to the definition of map.
map f (x:xs) = why map' f (x:xs) == (by def. of `why`) map' map' f (x:xs) == (by def. of `map'` f x : map' map' f xs
Voilà. So that wasn't too hard. It's basically two steps: (1) abstract over the recursive call, then (2) figure out how to pass the function you're defining to itself. If you look at the Y combinator, you'll see that that's exactly what's going on there.
If this didn't make a lot of sense to you, it's probably because I wrote it on my iPad at 4:30 in the morning. It really is just those two steps: abstract over the recursive call, then self-apply. ...
To get deeper into the recursive mindset (if you're not there yet) and to build up deliberately to the Y combinator, take a look at one of my favorite books on functional programming, The Little Schemer . (And watch out for the jelly stains!)
0. And it's ill typed, but never mind that. It's not possible to define the Y combinator (or any other fixed-point combinator) in the simply typed-lambda calculus, so just imagine that my Haskell-style syntax is untyped, like the basic lambda calculus.
1. Although, again, there's no way to give fix a good type in the simply typed lambda calculus.
⬐ klibertp> just imagine that my Haskell-style syntax
I wouldn't otherwise, but after reading this comment I have to ask: why did you use such a syntax instead of Scheme, which is what TFA uses?
EDIT: also, I second "The Little Schemer" suggestion. I'm working (for the nth time) through "The Seasoned Schemer" in preparation for "The Reasoned Schemer" and it still is very enjoyable. It's a bit like SICP but with a sense of humour and unique, engaging style of presentation. Well worth the read!⬐ SirenosThat was a really nice explanation. I like they you write.⬐ ameliusRegarding your note "0", could anybody here explain how the Y combinator be properly typed in a more advanced type system? Is there a (practical) language that would allow it to be typed?
Also, would the Y combinator be a useful abstraction-aid in a compiler (for a typed language), or does it exist merely as a curiosity?⬐ klibertpTake a look at these examples:The Mu/Roll trick seems to be a default way of typing Y, while some languages (like OCaml) provide other type-system features like recursive types or polymorphic variants.
http://rosettacode.org/wiki/Y_combinator#Haskell http://rosettacode.org/wiki/Y_combinator#OCaml http://rosettacode.org/wiki/Y_combinator#Scala http://rosettacode.org/wiki/Y_combinator#Standard_ML http://rosettacode.org/wiki/Y_combinator#Swift
It's certainly possible to learn to "think recursively," and thus be able to work out recursive solutions to new problems in the same way that other people work out iterative solutions to new problems.
The book The Little Schemer is a great way to learn to think recursively. It has been 5 years since I read it, and I haven't kept the skill fresh, so I've probably lost most of it.
I started my Lisp journey seeking to learn Clojure too. I starting out with The Little Schemer. I chose Scheme so that I could first wrap my head around the basic Lisp syntax, along with the recursive and functional thinking. To keep things as simple as possible, I did 95% of the exercises using a composition notebook and pencil. This kept the incidental complexity to a minimum.
Later, I moved on to the Clojure books. Working through the Little Schemer was invaluable (and its bibliography is excellent too).
There is a book called The Little Schemer (was The Little Lisper) - a book all about recursion. This is a quote from a review:
Little Schemer is without a doubt one of the best books I have ever read on the subject of recursion, and what is interesting because they never really go into a formal definition of what recursion is, as most texts on computer science try to. Instead they show the reader time and time again what recursion is, while providing a great series of rules (commandments) on how to get the most out of recursion, particually in a tail-recursive language like Scheme. http://www.amazon.com/The-Little-Schemer-4th-Edition/product...
You can read more about The Little Lisper here: http://thelittlelisper.blogspot.com.au/2010/06/little-lisper...
Or you can read about working through it in Clojure here: http://juliangamble.com/blog/2012/07/20/the-little-schemer-i...
⬐ agumonkeyI remember reading bits of one of them. It was so dull and empty. Until you click.⬐ DonHopkinsI'm going to go have myself a nice peanut butter and jelly sandwich now.⬐ davexunitThe Little Schemer is fantastic. I recently picked up The Seasoned Schemer as well, but haven't gotten a chance to really dive into yet. I'm looking forward to seeing how the authors tackle more advanced topics using their out of the ordinary teaching style.
Now, go cons a cake onto your mouth!⬐ JtsummersThey've also got a 3rd book in the series, The Reasoned Schemer . I didn't finish working through it (life and work and other things), but it's pretty good as well.⬐ davexunitI want to pick that one up once I've gotten most of the way through The Seasoned Schemer, or if I see it through the window of the MIT Press store and can't resist.⬐ AimHereBe warned that, despite the name, the Reasoned Schemer is only tangentially about scheme; it focuses on miniKanren, a somewhere-in-the-Prolog-ballpark logic programming language created by one of Friedman's students, that is implemented as an extension to the Scheme language proper (among other languages, most notably as the clojure core.logic library).
Also Friedman and Byrd did show up to a few clojure talks and seemed, from the online videos, to be highly entertaining - I remember their using miniKanren to automatically generate scheme programs that evaluated to 6 being particularly fun.
SCIP should always be in the list as one of the best programming books ever written. Others are 'Simply Scheme: An introduction to computer science', simply scheme is an alternative to "How to design Programs", http://htdp.org/, both books are written for non-programmers but they provide a gentle introduction to many advanced topics covered in SCIP. I prefer "Simply Scheme". Another one is the "Little Schemer" http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262....
I really liked The Little Schemer. The language/syntax is a little different to Clojure but it's broadly transferable; really helped me think functionally.
I'm a total noob with this stuff but I've been really happy with Clojure (and more recently ClojureScript/Om) :)
I recently went through the later chapters of The Little Schemer again. I still find it incredibly challenging and awesome. As many have said, this is a great book to teach you to think recursively.
Get a copy of this for the kids!
⬐ klibertpI just read the chapter about fixed point combinator (aka Y). It's great, not only for kids.
I tried reading the book a few years ago, I remember being irritated by the QA style it uses and dumping it because of it. On my second attempt I realized that it's only irritating if you know the answers very well and skipped to the chapter I didn't have so much confidence in understanding. And it was very pleasant experience, especially when I stopped to think a little before reading the answers. It felt like I was having fun.
So I'd advise to give a book a go, even if you are confident in your Scheme and FP skills. Just skip the parts which seem too obvious to you and get to the interesting stuff, you won't be disappointed.
Now it's time for The Seasoned Schemer, I guess :)⬐ mentosOne of the best CS classes I took in college was an introduction to scheme that used 'The Little Schemer' as its text book. Having only worked in imperative languages it really opened my head up!⬐ dmixThe MIT course on youtube from the 80s using SCIP and Scheme was the single best time investment I've made since learning programming. It still blows my mind how much it changed my perspective on programming.⬐ latjFrom the 80's? You have a link to which one you mean?⬐ dobbsbob6.001 on MIT open courseware Its the lectures for SICP tho not 2nd version but doesn't matter⬐ dmix1986 https://www.youtube.com/watch?v=2Op3QLzMgSY&list=PLF4E3E1B72...
A year before I was born :)
Lots of terrific advice here, and I myself am mostly a self-taught programmer, I've only taken 3 formal courses, all introductory. I'd only add:
"Maybe I would be confident in my skills to apply to some tech jobs. Or do some freelance work"
Don't expect to get "normal" tech jobs by the time you're good enough unless you can disguise your age, age discrimination is fierce in this field. But as noted by you and many others, there are many options.
I'd also add that at some point unless you've forgotten all your math and don't want to refresh it try Structure and Interpretation of Computer Programs (SICP) (http://en.wikipedia.org/wiki/Structure_and_Interpretation_of..., http://ocw.mit.edu/courses/electrical-engineering-and-comput...), everything you need is free and online. If it's a good enough fit for you it will teach you some foundational things that'll make you a better all around programmer and system designer. E.g. one way or another learn big O notation (https://en.wikipedia.org/wiki/Big_O_notation) and its significance.
The Little Schemer is the book that got me thinking about data structures recursively (starting with linked lists), and that was later furthered by SICP.
I've found The Little Schemer to be very approachable and effective for grokking common CS concepts.
⬐ thisisnotmynameI agree with this suggestion.
Also, I want to point out that "essential readings" is not the right attitude. In order to really make progress you're going to need to get your hands dirty and work though some examples. One very good exercise is to write an interpreter for a language you invent.⬐ IxiausTLS series is wonderful - HTDP is great too, it assumes the student doesn't have programming experience which means they start out with simple stuff (and use Scheme for the implementation language!).⬐ jinfiestoUmmm. I read this after SICP. While I found it to be an easy way to pick up a lot of "gotchas," I definitely wouldn't give this to someone as an intro to CS or programming. It's a good book though.⬐ mgcrossI'm reading/working through this book now and can't recommend it enough, especially for those with limited time (or limited ability to focus and study due to environmental factors). I've worked through most of the first two chapters of SICP, but honestly felt a little overwhelmed at times. TLS has been enlightening AND fun. The format is genuinely unique and well-suited for reading/thinking in the small slivers of free time I have between work, kids, freelance, Khan academy, etc.
Most exercises don't require an interpreter, which is nice if you need a break from screentime. But I do enjoy working through some of them in Racket or even Pixie Scheme. TLS isn't free or available in a digital format (AFAIK), but the book is inexpensive and very portable.
The first most effective thing was taking a data structures class. It was the second programming class I took in college, and I use the knowledge from that class every day. I think that you can be a pretty good programmer without a lot of the theoretical stuff you get taught in CS classes, but data structures is not one of the things you can skip.
Another very useful thing I did was was read The Little Schemer (http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...). Before reading it I'd had a lot of trouble thinking recursively, and since reading it I've had very little trouble. I've also found its question-and-answer style very useful for teaching other people how to program using recursion.
⬐ jkmcfI'll second the data structures class. This was the advice I received 20+ years ago.
I found Erlang hard to understand at first but I was a victim of my own ignorance. I knew instantly that it's pattern matching feature was incredibly useful but it wasn't until I read "The Little Schemer" http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02... that I was able "get" Erlang.
It sounds like you're more interested in programming languages in general. You might find these books interesting:
Essentials of Programming Languages http://www.amazon.com/Essentials-Programming-Languages-Danie...
The Little Schemer http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...
My vote goes for The Little Schemer. It's short (but don't read it all in one sitting), entertaining, and will teach you some important concepts.
⬐ charlieconroyThis book like no other just makes me smile. I read this right after I graduated and started my "real" learning in programming and math. The intermission page list books on logic and set theory.
FYI: it is the first book in a "trilogy" -- but your next book could be either of the other two (their only prereq is The Little Schemer). Listed below:
Reasoned Schemer: http://www.amazon.com/Reasoned-Schemer-Daniel-P-Friedman/dp/... Seasoned Schemer: http://www.amazon.com/Seasoned-Schemer-Daniel-P-Friedman/dp/...
Autobiography of an unknown Indian: http://www.amazon.com/o/ASIN/094032282X/
Little Schemer: http://www.amazon.com/o/ASIN/0262560992/
Two good books which are in the sort of style you seek are:
The Little Schemer <http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...; and
Clause and Effect <http://www.amazon.com/Clause-Effect-Programming-Working-Prog....
Also a help is that the languages they use ('use' is a more appropriate word here than 'teach') — Scheme and Prolog, respectively — are much more mathematical in nature than typical mainstream languages are.
⬐ gtanithis is sort of discrete math with haskell examples⬐ silentbicycleI second Clause and Effect. (The Little Schemer, too, but CAE doesn't get much attention.)
Sterling and Shapiro's _The Art of Prolog_ is also excellent, though you'll probably be better off reading _Clause and Effect_ first if you've never used Prolog. CAE is all about getting a feel for how Prolog operates, step-by-step* , while TAoP is about the logic programming paradigm, interspersed with project case studies and comparisons between Prolog (as an LP implementation with various compromises) and "pure" LP.
* This is the main thing it has in common with The Little Schemer: both begin by stepping through their respective languages' evaluation at a micro-level, until the semantics feel totally clear. This is especially helpful since Scheme and Prolog are both very different from the typical imperative/OO languages people know.
FWIW, The Little MLer is written in the same style as TLS, and is a good, lightweight introduction to ML's type system / static typing.⬐ silentbicycleAlso, if for whatever reason you have a hard time grokking Prolog, there's also an excellent chapter on LP and Prolog in CTM.
I remember when I first read this a while back, and I wanted to read the little schemer too. It's now in 4th ed. (http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02... - $22) but I really wish there was an e-version for my Kindle: PDF, anything.
The Little Schemer is an updated version of The Little Lisper. It also happens to be much cheaper: http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...
It's an excellent introduction to thinking recursively. The others in the series (The Seasoned Schemer, The Reasoned Schemer) are worth reading too.
⬐ RBerenguelThanks, I'll try to get myself a copy from a library. That's how I got to read the LL, and really loved it (that's why I have a try to A little Java).
The Little Schemer: http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...
I personally find scheme to be the simplest Lisp to learn (after working with Common Lisp, Clojure and Scheme). If you do want to learn scheme, I found the MIT lectures http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute... brilliant and the little schemer http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02... a lot of fun as well.
Might I make a recommendation? Start with "The Little Schemer" and then graduate to "The Seasoned Schemer". Here: http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...
It takes you more step-by-step than SICP and once you get more practice with those books, SICP will be much more paletable.