6 ms·
Ask HN: Is teaching my 8yr old son a functional language first a bad idea?
I want to teach my son how to program and I've been wondering what language to start with. I work with Ruby day-to-day but if I teach him that first I feel like it'll sully him for other languages and "taint" him.
I was thinking of going with Go since it's very basic, clean and explicit. It's a C-style language so he will be able to branch out to other languages years down the line if he wants to.
On the other hand, distributed systems are on the rise and probably the future of computing. Something like Elixir will go a really long way in teaching how how to think in a functional, distributed manner.
What do you guys think? Fathers, what languages have you taught your son first?
- alistproducer2 10y agoMy oldest is a girl who spends several hours a day drawing comics so I'm not sure she would enjoy programming, bu tI do have some thoughts on the subject as a person that has taught children programming. I find that functional languages force the user to think in a more artistic, creative way than imperative languages. It's out of the box thinking by design. The danger is that if the student is interested enough to push past the initial discomfort of being lost, you risk poisoning the well for some time (maybe forever). Learning programming is stumbling through the woods no matter the language design, but functional languages can be more brutal.
- davelnewton 10y agoIf the person in question hasn't been exposed to anything else there's no unlearning. It's easier to teach a non-programmer FP than a programmer that's been exposed to imperative programming only (at least in my experience). Not including Haskell here.
- tonyedgecombe 10y agoFunctional programming certainly changes the way you think about many problems but I'm doubtful learning an imperative language first is detrimental.
- davelnewton 10y agoIt depends; I should amend it to say that if all that is focused on is imperative programming it can be a greater leap to FP than if the initial learning is either a comparative class or FP-first.
- pythonaut_16 10y agoImperative programming is just functional programming where some (many) of the inputs and outputs are hidden :)
- davelnewton 10y agoNo reason not to start with FP. Arguably even better. I wouldn't use a brace-language first, though. I'd stick with Logo, Smalltalk, Python, or Scheme, preferably in a decent environment, e.g., Logo or Scratch. The issue with starting with brace-oriented languages is that they spoil you in different ways. Ceremonial languages are a harder sell, less fun, and AFAIK don't have good kid-oriented "IDE"s. (Processing might be an exception since it has reasonably-friendly IDEs and provides immediate feedback.) Worrying about "spoiling" this early because of Ruby seems odd to me. It's a low-ceremonial way to get started, it has enough power to do anything necessary including teaching "higher-order" programming. But without Shoes it lacks the immediate feedback loop for kid-like programming (shapes, graphics, games, etc.)
- skylark 10y agoAbove all else, it should be fun. If your son finds programming enjoyable, everything will fall into place. For that reason, I'd suggest a language that enables you to easily make things. I actually think Ruby is perfect, because you can teach him to make websites using Ruby on Rails. I personally have a soft spot for rails because it's how I first got interested in programming. I had no experience in coding and don't have a CS degree, but hacking on rails projects is what initially sparked the fire for me. Two years later I'm working my dream job at Google - that never would have happened if there wasn't a fun, interesting gateway into the programming world.
- wikibob 10y agoWould love to ask you a few questions about how you got from point a to b, mind if I drop you an email? I don't see an address in your profile
- tonyedgecombe 10y agoI suspect you are taking it a bit too seriously, it just needs to be simple and fun, don't make it a chore.
- z1mm32m4n 10y agoFull disclosure, I'm not a father, though I have thought a lot about introductory CS education. 1. Let the student drive the learning. We all have our own views of what fields are interesting, exciting, and worth studying. They've been shaped by our own past experiences and views of what's important or useful at large. Students, especially young students, are still forming their worldviews. It's possible to condition them to think one way, but these views will always feel "forced" or "alien" compared to views they arrive at themselves.[^1] Thus, it's important that the students drives the learning. This is largely done by perpetually asking questions. Knowing the answer without being intimately aware of the question is nearly useless. Curious students will ask better questions, internalize the knowledge better, and drive their own learning. As it turns out, this applies to all learning, not your specific question related to programming/computing. Let's explore that question next: 2. Prioritize computational thinking. Specific choice of languages in industry come and go. You identify this trend yourself: in recent years languages like Go and Elixer appear to be gaining popularity, perhaps even at the expense of languages like Ruby or Java. Whatever the general trend maybe, language choices always vary. However, there are two tenets which remain relatively constant. a. "Computational Thinking" provides a framework for problem solving Computational Thinking, as popularized by Jeanette Wing[^2], basically just means thinking about solving problems in a way that formulating the solution resembles the process by which you could encode the solution on a computer. Regardless of the choice of language, programmers and computer scientists still approach problems algorithmically and formulaically. This skill set is more important than knowledge of any particular language. b. Language paradigms change infrequently Across all the industrial trends in language choice, languages in popular use can largely be categorized by the extent to which they utilize two paradigms: the imperative paradigm, where programs are built of a series of state mutations, and the functional paradigm, where programs are built from mathematical functions with a focus on composition. Familiarity with both of these paradigms is important, and indeed they complement each other.[^3][^4] Most languages are not purely functional nor purely imperative. However, being able to recognize and identify these features will facilitate learning new languages as they arise. 3. Embrace child-like wonder. As we get older, there's increasing pressure to not be "surprised." People say things like, "Wait, you didn't know that? Everyone knows that." As a result, we are conditioned to contain our excitement when learning new things. As it turns out, people are learning and getting excited about things all the time. Excitement is infectious; if you are always excited and passionate about the things you're learning (or teaching!), that excitement will spread to those around you. > Never lose sight of that child-like wonder. It's just too important. It's what drives us. > -- Randy Pausch, The Last Lecture ————— [^1]: Cf. Inception [^2]: Computational Thinking, Jeanette Wing. https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf [^3]: When Carnegie Mellon restructured their entire introductory course sequence in 2010, it was driven by these ideas. Freshman take two courses: Principles of Imperative Computation, in C, and Principles of Functional Computation, in Standard ML. [^4]: Introductory Computer Science Education, A Dean's Perspective, Randal Bryant et al. http://reports-archive.adm.cs.cmu.edu/anon/2010/CMU-CS-10-140.pdf http://reports-archive.adm.cs.cmu.edu/anon/2010/CMU-CS-10-14...
- Mo3 10y agoI'm far from a father but you really seem to take this too seriously. Introduce him, yes, if he has fun he will want to continue by himself and probably nag you. But don't try to distract him with whatever your ego seems fit for an extension of "yourself" and "your son". He might as well become a heart surgeon if you let him have his space to be and explore.
- sergiotapia 10y agoIt's a mistake on your part to assume my parenting style based on 4 paragraphs.
- Mo3 10y agoI'm not assuming anything, really. See if you see yourself in what I wrote. If you don't, disregard.
- davelnewton 10y agoIt seems like you are, explicitly. There's nothing over-serious in the request--it's a question asking what the best approach would be, which is totally fair.
- weatherlight 10y agoPresume much?
- drewrv 10y agoI wouldn't worry too much about the language, try to link it to something they enjoy. If your son enjoys video games teach them javascript/html5 and let them build in-browser games they can easily show off to their friends. If your son likes to tinker with physical things, do an arduino project with him.
- mcgrath_sh 10y agoDoes your son have an interest in programming? Does your son have an interest in something related to programming? How are your son's reading, writing and typing skills? Programming, by nature, is very deliberate. Misspellings and typos can cause a world of hurt for an experienced dev and could be even more frustrating for a kid. A lot of programming is less about the language than it is about the concepts. In light of the above, I am going to make an out of the box suggestion... Buy a Lego Mindstorms kit. Build a robot with him and then use the software to put together basic programs for the robots with the programming software that is included. You will be able to teach him simple if statements, loops, conditionals, variables, etc all without having to worry about what language to use and without him worrying about spacing and punctuation. When I was a kid I loved doing this. I was always playing with Mindstorms, setting up courses, and seeing if my programming lets them work their way out of them. I also would set up different courses for the two types of wheels that came with my kit. I had to learn that bumper sensors had to be out further than the wheels. I had to be able to turn on and off motors for the right length of time to make the robots turn. I could use light sensors and I even tried to figure out how to make it annoy my sister. There was some building, sure, but a lot of my time was spend "programming" with the Mindstorms software. Then I tried to jump to C++ or C# (cannot remember) when I was 9-11 and I was miserable. Granted, my parents had no programming experience and I tried to kind of do it on my own, but it was a bit much for me. I just didn't enjoy it and quickly left it alone. If your son enjoys Mindstorms, maybe in 12-24 months you guys can start with real electronics and a formal programming language. The cool part is (especially if you have an interest) this (ie. hobby electronics and programming them) is something that could be something you do with your son that lasts a lifetime. That is always a positive! Good luck and have fun! Edit: Here is a pretty decent overview of the programming that is involved. There are more tutorials on the channel if you want to get more of a feel for the interface before you buy. https://www.youtube.com/watch?v=81hctQt6Cp8 https://www.youtube.com/watch?v=81hctQt6Cp8
- sergiotapia 10y agoHe's actually asked me about my work many times. I think I'm going to go the lego mindstorm route. Any particular "package" you recommend?
- vikingcaffiene 10y agoI agree with the others that you might be diving too far into the deep end here. I'm about to start teaching my 7 year old a little bit about coding and am starting with Wonder Workshop[1]. Its a suit of toys (robots) that are approachable and fun and give the kid instant feedback. Something more high level like that might help you teach your child the overarching concepts that will inform more complex ones in the future. Best of luck! [1] https://www.makewonder.com/ https://www.makewonder.com/
- mcgrath_sh 10y agoOoh! Those are neat! They look Lego Minstorm-ish. Cool!
- davidjnelson 10y agoBuilding levels and maps for video games can be a great introduction to the type of thinking that can later be used to learn programming and building more complex things.
- jpfed 10y agoApologies for my many disorganized thoughts here. Consider also soliciting suggestions from mothers. Do you think Elixir will help him solve a problem that is interesting to him? Kids would probably be most immediately motivated by a language that allows them to execute interesting effects right away. Declarations, definitions, and tautological wiring are all probably the least interesting things. I don't know if "spoiling" a budding programmer is really a thing. However, I suspect it may be easier to go up the ladder of abstraction than down. For example, after using a primitive line-oriented version of BASIC as a kid for a while, I wanted more structured constructs, and could understand how those structures worked in terms of conditional jumps etc. I accidentally introduced my son to PICO-8 (which uses Lua). I was evaluating alternatives, he noticed the icon for it and asked about it, and that was that. He hasn't done much programming with it; he's more interested in drawing and making music. Then again, he's only six years old. I think the specialized screens for editing graphics and music make it easier for him to just not think about programming at all, in a way that wouldn't be true if he had to draw graphics with LINE(x1,y1,x2,y2) etc. In short, probably don't use PICO-8. My start with primitive BASIC dialects is probably biasing me, but if there were a fake assembly language with a simplified interface for interacting with the environment (sound, graphics, text input), that sounds like it would be ideal. You don't even need to understand block structures to start with this sort of thing.
- throwanem 10y ago> In short, probably don't use PICO-8 Whyever not? It sounds like a great playground for a kid who might be interested in art, music, programming, or any combination of the above. (Or he won't bother with it for long.) The kid's eight, for pity's sake. Give him a chance to find his interests.
- CCing 10y agoIMHO you should try with something very simple like python or php.
- PrimalPlasma 10y agoIt's the best thing you could do for your son.
- splintercell 10y agoNot a father, but very much interested in pedagogy of programming. I initially got interested in this because of the (now infamous) paper 'Camel has two humps'[1]. Since then, the author has redacted his conclusions, but I still think the paper points to a very interesting thing, some people are different, they just don't "get" programming the same way we do (and this is hardly an indication of being less intelligent, but that there are different kinds of minds out there). My theory is that the main culprit here is Turing Machine architecture. That people who don't 'get' programming actually might like it better if they are taught lamda calculus based programming first. I tried teaching my intelligent non-developer buddy programming using a non-FP language which he absolutely didn't get, but when I tried teaching him lamda calculus that made a lot of sense to him, so I am interested in seeing more validation of this hypothesis. So my suggestion is that you try teaching your son any kind of programming, and if it doesn't work out then try teaching him the other kind. For FP, I recommend teaching him lamda calculus and this game [2] is a good place to start with. 1. http://www.eis.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf http://www.eis.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf 2. http://worrydream.com/AlligatorEggs/ http://worrydream.com/AlligatorEggs/
- davelnewton 10y agoNew comment to highlight something I said earlier: https://medium.com/@stevekrouse/scratch-has-a-marketing-problem-f84626bd18ef https://medium.com/@stevekrouse/scratch-has-a-marketing-prob... And its embedded link http://woofjs.com/ http://woofjs.com/
- lolive 10y agoTeach Javascript. It drives all web pages, is the right place to learn (the tools to deal with) asynchronicity, can be the foundation for crazy functional stuff (cf https://www.gitbook.com/book/drboolean/mostly-adequate-guide/details https://www.gitbook.com/book/drboolean/mostly-adequate-guide...), can be strongly-typed (aka TYpeScript), has a very decent editor (VSCode). My humble 2 cents.
- RantyDave 10y agoEight? Scratch.
- paultz 10y agohttp://woofjs.com/ http://woofjs.com/ ?
- dragonwriter 10y agoWorry more about an engaging approach and interesting projects than the first language. If you are worried about the language being limiting, introduce another one or two after a while; a language or language family is limiting if it is all you learn for many years, but otherwise probably not.
- xfer 10y agoGo with racket and look into some of teaching languages. I would avoid C-like languages because of the memory model.
- a-saleh 10y agoI wouldn't worry about limiting language syntax just for him to be "able to branch out to other languages years down the line if he wants to." As far as I remember, my first brush with programming might be when I was ~7, on an old, crt-connected computer (not comodore, something Yamaha branded, with arabic OS I found at my grandpa's), with the Basic programming language. As far as I remember, I was able to comprehend PRINT, INPUT, IF and GOTO, I don't think I was able to handle sub-routines and loops. Your mileage may wary :) I really started \w programming 10y old, with after-school course in Visual Basic for Applications. It was the year 2000 and that was only ide our teacher was sure we would have at home :-) I remember, that sub-routines were fine for me by that time, loops and array iteration as well, interestingly, I took some time I comprehended, that I can do i.e "x = x + 1". This wasn't something that my brain thought was possible, based on my experience in math class (we have been solving simple linear equations by that time). So, functional language might have been easier in this regard :-) Unfortunately, I don't remember when I managed to grok recursion? We made a lot of text adventure games \w input and message boxes first, and later on drag-n-drop some forms together. Two years later we worked with C. Three years later in Java. In that time my accomplishments were at the level of single level top-down shooter and we might have accidentally invented the clicker genre :-) So, if he wants to try ruby, wouldn't worry about somewhat tainting him. If you think it would be fun to learn elixir, and want to take your son along, and write a game together or something like that, that sounds like fun as well. Hope my account helps, I would like to hear how did your effort go :-) I have a three year old daughter, and one day I will want to share programming with her as well :-)
- paultz 10y agoan interesting functional programming language is OpenSCAD he may enjoy making onscreen objects and optionally 3D printing them, at the same time learning some of the basics of functional programming
- deleted 10y ago[deleted]
- mikebelanger 10y agoI dunno the first language I ever managed to figure out was TinyScheme (running on Gimp), which is considered functional. I actually found more OO-style languages to be harder to understand. But that might just be me.
- deathtrader666 10y agoMathematica should be fine for kids.
- NKCSS 10y agoMindStorm and Scratch are great ideas. When you venture into something more real, give QuickBasic (QBasic) a shot. It was part of the Windows 95/98 Power Pack addon for free if you have one of the old cd's lying around and it's a great way to start. I say that because that's how I started when I was 12; found some tutorials online; has very basic functions, is text-focussed and lets you get started, fast. After; I'd move to C# since that enables you to use the friendliest IDE out of all (Visual Studio) and it's a great language and relevant to the job market now and in the forseable future.