17 ms·
Principles for Programming Languages for Learners
- teach 10y agoI've been teaching kids to code for 19 years now, and I still make them do it the hard way. Just two days ago this year's crop of 83 students wrote their first Java programs in Notepad and compiled and ran it from the command-line. And I have a waiting list to get into my class. I do work with older students (aged 14-18) and the key is TREMENDOUS support. I'll happily show them the command-line stuff over and over again for a month if need be. And my curriculum goes through the basics of Java very slowly. As I've said on HN before, I make my students code FizzBuzz, but they will have literally done 106 complete programming projects before it.
- bigiain 10y ago"I make my students code FizzBuzz, but they will have literally done 106 complete programming projects before it." Pretty sure I've never met one of your students in an interview... (Just joking...)
- teach 10y agoI understand that you're joking, but my students deeply understand the fundamentals. They can code everything from scratch without having to Google anything or ever reference Stack Overflow. My program is very strong. Some of my former students now write code for Microsoft, Google, Apple, Facebook and Dropbox. (Haven't gotten anyone hired at Amazon yet, though!)
- mikegerwitz 10y ago> They can code everything from scratch without having to Google anything or ever reference Stack Overflow. This isn't a good measure of proficiency. I frequently do both of those things---in fact, I consider it a bad thing when someone does not, because that means that they are not exploring others' solutions to the problem, or learning other methods of doing something. Struggling is a good way to learn, but at some point you should see what others are thinking, and how they are doing it better than you are. Similarly, manuals (manpages, info manuals, online resources, etc) are essential: trying to memorize every detail when certain things aren't often used is not an efficient use of one's time, and that knowledge will only fade unless applied. I think the point you were trying to get at was that for what was taught in your course, the students were proficient enough that they didn't need to reference other resources.
- teach 10y agoYes, I mean that they can code everything in my class without needing a reference. I don't make them memorize anything -- I agree that's a waste of mental capacity -- they just learn it through tremendous repetition. Once you know a half dozen programming languages then Stack Overflow and reference manuals are of course useful and I'm sure most of my former students do use them.
- harryjo 10y ago> I don't make them memorize anything -- I agree that's a waste of mental capacity -- they just learn it through tremendous repetition. I don't understand. You are drilling them to memorize through repetition.
- mikekchar 10y agoThere is a difference between proficiency and fluency and when teaching languages it is important to distinguish them. Proficiency is a measure of how many things you can do. Fluency is the degree with which you can do something without undue thinking or planning. I don't know exactly what the parent poster had in mind, but for me fluency is what you should aim for when teaching novices. You should keep the domain very, very small and help them get to the point where they can explore it without undue effort. In human language training you get the classic example of "I can read just about anything if I have a dictionary, but a can't speak to save my life". The lack of ability to output fluently is an indication that the language has not yet been acquired. It is tempting to get students to achieve impressive results based on being able to piece together material from outside sources (Google, SO in a programming context or a dictionary and example sentences in a human language context). However, creating fluency in a small domain gives a more solid conceptual model and will ultimately serve them better IMHO.
- mikegerwitz 10y ago> There is a difference between proficiency and fluency and when teaching languages it is important to distinguish them. That is important; thank you for the clarification. > fluency is what you should aim for when teaching novices I think you should aim for both, but yes this is important. An earlier thread mentioned autocompletion: use of it during early stages of learning is a good example of working against fluency.
- jczhang 10y agoAs someone who is studying web dev right now, i'm interested in hearing your methods and curriculum, as at least for web dev, it seems so much requires googling/using stack overflow.
- mikegerwitz 10y ago> first Java programs in Notepad Do you find this to be beneficial? What are your observations? My first impression would be the frustration with lack of simple features that programmers take for granted in their editor, like auto-indentation. I can see the benefit in deferring syntax highlighting, but something as simple as the former can be unnecessarily off-putting, and distract from learning. With that said, I try to think back to when I was learning HTML in elementary school, using Notepad to edit. I was so focused on struggling through comprehension that typing extra tabs/spaces wasn't what slowed me down. I also didn't know what I didn't know about editing. But I have observed frustration in others who didn't know how to program, pounding the tab key or spacebar. And I did forego indentation in my early days in many instances, because it was a PITA. So this isn't a criticism of your decision to have students use Notepad; I'm just curious of their feedback and your observations. Java indents virtually every line.
- robertelder 10y agoI taught a few programming courses (C programming) this past year at a local college and I went for basically the same route: Get them to type out small simple programs in gedit, and compile them on the command line with a simple make file. Modern programming is often so high-level and tool assisted that it is difficult for a newcomer to understand the difference between what they did and what the computer did. Many of them previously programmed using the arduino programming environment (which I haven't ever used), but I have been told that it does a lot of stuff automatically for them, they don't even write the 'main' method. Many of the students started trying to do all kinds of crazy stuff when trying to make a simple 'hello world' C program, including various Windows headers (on Linux), trying to do GPIO pin stuff etc. I think it can be beneficial to keep the number of new things as small as possible, and build up from there.
- teach 10y agoI couldn't agree more. That's actually my biggest complaint with Java for true beginners; "hello word" has half a dozen concepts you can't omit but also can't even begin to explain. I just get hand-wavy and say "it's a required heading that Java requires; I'll explain it later."
- mcphage 10y ago> I do work with older students (aged 14-18) and the key is TREMENDOUS support. I'll happily show them the command-line stuff over and over again for a month if need be. I think the article was written more in relation to teaching younger children, rather than high schoolers.
- teach 10y agoYou're right, of course. I'm not disagreeing with the article at all, actually. I agree with all five points. I wish there was some programming offered in the lower grades in my district.
- tsumnia 10y agoI've been experimenting with college students by giving them images of source code and forcing them to type out the program as their first assignment for the week. I've since gone back to earn my PhD and I hope to study this specific technique to see the empirical merit to it. I'd love to chat with you outside of HN if you have the chance!
- teach 10y agoI make all my students type in many assignments as well. I don't use images, though, just classroom management techniques since I have them in the room with me and I find students have less incentive to "cheat" when they know what they're doing. Shoot me an email; would be happy to discuss.
- swaits 10y agoThis is really interesting! Is your curriculum open, by chance?
- asimuvPR 10y agoI work in edtech and find this fascinating. I was at ISTE last June and talked with teachers with similar experiences. In your experience, what are the top three issues students face?
- deleted 10y ago[deleted]
- benhoyt 10y agoDo you have your curriculum in a shareable format, or even just an outline? I'm going to start teaching programming to high schoolers soon and would love to see that.
- teach 10y agoThese were my classroom assignments in 2012. My current assignments use my book, but the basic sequence is the same. https://programmingbydoing.com/ https://programmingbydoing.com/
- phlakaton 10y agoTEALS volunteer here (https://www.tealsk12.org https://www.tealsk12.org). TEALS offers its Intro to CS curricula as open textbooks: Sem 1: https://teals-introcs.gitbooks.io/introduction-to-computer-science-principles/content/index.html https://teals-introcs.gitbooks.io/introduction-to-computer-s... Sem 2: https://www.gitbook.com/book/teals-introcs/2nd-semester-introduction-to-computer-science-pri/details https://www.gitbook.com/book/teals-introcs/2nd-semester-intr... I taught this last year and had a blast. It's still a very new curriculum, so expect to have to work out some flow issues and maybe even a bug or two. In particular, doing Snap! for a whole semester I think works if you're only teaching one semester, but we wanted well more time on Python than we had.
- viiralvx 10y agoWhen I was learning C and C++ in college, my professor didn't show us what an IDE is until the second to last lab at the end of the school year. We were all like, "WHAT?! We were over here making Makefiles and all that when there's a piece of software that could do it for us?" But to be honest, after that, we didn't even use the IDE because we were already good at making Makefiles for our project, haha. EDIT: Just remembered writing my first C programs in nano, lmao. I really wonder how much time I lost doing that, smh. Ended up using kate later on. I just learned vim last year out of forcing myself to abandon Sublime Text/Atom and once again, productivity skyrocketed.
- bluetwo 10y agoWhere do students learn how to understand a problem, break it down into parts, document requirements, and plan development?
- Retra 10y agoIn a software engineering course.
- deleted 10y ago[deleted]
- seanmcdirmid 10y agoIn a properly oriented programming class. The primary focus shouldn't be on learning to program, but using the computer to solve problems, where learning to program is just a big part of that. However, large-scale SE tasks don't belong there either (e.g. document requirements/plan development comes way later, but the first two points apply to all scales and should come in the very beginning).
- jakub_h 10y agoPresumably, in a How-to-Design-Programs-based curriculum. (http://www.htdp.org/ http://www.htdp.org/ , http://www.ccs.neu.edu/home/matthias/HtDP2e/ http://www.ccs.neu.edu/home/matthias/HtDP2e/)
- parfe 10y agoIf excel isn't the first item on your list for teaching programming you're already out of touch. Let's pretend you're a high schooler volunteering at a charity. "Donors who attended our last five fundraisers?" "Email list for our whale donors from this fiscal year?" (>100, 1000, 100000+ whatever) "Who are our best fundraisers?" "Was the dinner last week a success?" What are the odds the student who can answer these questions is helped by a teacher who ticks off any of the five principals in the submission? Logo? People aren't drawing basic geometric shapes. "Cognitive load" referencing types? I'm not even sure how to address this. Any beginner expects 1/2 to display 0.5. That entire paragraph is nonsense. Be honest Ok, learn how to excel in your field with programming/excel/sql/etc as tools to succeed at your job. "Computer Science" isn't programming and it isn't a job. Never confuse any of those. #5 is just generic filler for being a not-bad teacher.
- mikegerwitz 10y agoOne doesn't need Excel to answer those questions. It has convenient GUI features, but it can also be efficiently done in a variety of languages made for processing of data (or even simple command-line pipelines), many better for the task. That's also a good application for teaching about SQL and databases. These yield broader skills that can be applied more generally. In any case: I hope schools don't start with Excel, since that cements students in relying on proprietary software and Microsoft's suite of software. If they teach it as a generic spreadsheet program---e.g., the same things can be done with LibreOffice---that's another thing.
- lbotos 10y agoYou expect your average high school student volunteer to be comfortable with command-line pipelines or be briefed in that vs. just using excel??? The conceptual overhead for a beginner vs. the payoff is just not there.
- mikegerwitz 10y agoCommand-line was just an example. In some instances, a seemingly difficult problem can be solved trivially with standard tools found on most Unix-like operating systems like GNU/Linux. But if we're talking about programming, then we're not talking about putting some formulas in Excel---that's what I'd expect of far less technical positions, ranging from accounting, to data entry, to your average person looking to understand some simple data a little bit better. Someone trained to use Excel is stuck with morphing problems into Excel's domain rather than being able to apply general building blocks to other problems. You can do some pretty complicated stuff in Excel that requires strong technical skill; I'm not implying otherwise.
- gameofdrones 10y agoAhh, fondly remembering LOGO for the Apple II in grammar school when I was about 6.
- known 10y agohttps://en.wikipedia.org/wiki/Test-driven_development https://en.wikipedia.org/wiki/Test-driven_development is good for teaching programming
- teach 10y agoI disagree with this for true, absolute beginners. In order to do TDD, students have to know enough to write an object with methods or -- at minimum -- a function. My students do seven assignments before they even see a variable. They've done 25 assignments before they write an if statement. They do 76 assignments before they see a function. My second-year kids can do TDD and it works pretty well. But for students with literally zero experience coding, TDD means you're skipping a LOT of basics. Or throwing a lot of unnecessary complexity at them before they even know the basics.
- akkartik 10y agoDo you have any pointers to such assignments? I've been teaching programming 1-on-1 with mild success by introducing concepts related to teaching fairly early: http://akkartik.name/post/mu http://akkartik.name/post/mu. But I'm very conscious of what I don't know, and eager to learn more.
- teach 10y agoThese were my classroom assignments in 2012. My current assignments use my book, but the basic sequence is the same. https://programmingbydoing.com/ https://programmingbydoing.com/
- akkartik 10y agoThanks! Drat, I just realized that I mistyped my original comment. I meant to say, "I've been teaching programming 1-on-1 with mild success by introducing concepts related to _testing_ fairly early.." Hopefully that wasn't too confusing.
- lfowles 10y ago
- ihaveahadron 10y agoTo think like a child is to understand that everything is learned at one point. Literally nothing, is easy to learn. It is easy to do after you have learned it, but it was never easy to learn, nor difficult, it just took effort, for it to become a tacit ability. The learning of the concept of what I wrote above is included in this, meaning, it requires effort to learn and understand it, and it's something that no one knows, unless they have learned it.
- hairy_man674 10y agoHere is the opinion of someone who makes a strong normative claim, that not lacking merit, is typical of one who has had more time to think. The naive idealism of motivating us" computer science" people to solve non-trivial problems is in stark contrast to an industry that that is lucrative to the extent that it satisfies the facile needs of millions of relatively unintelligent, complacent users. As long as there is a market demand for these little apps, enterprise consumers and shitty little ventures millions wills be invested here and greedy companies and stackeholders will profit. Fuck the poor and ambitious ideas. There is money to be made!
- AstralStorm 10y agoLogo is more like low threshold, low ceiling. A good benchmark is if you can implement differential calculus in said language, while also drawing pretty pictures and playing sound, with real time input. In other words, implement a full 3D video game. Logo fails this criterion as far as I am aware, Pascal and Squeak do not.
- 20years 10y ago"We are doing a disservice to kids by assuming that they can't grasp industry-standard languages, complex computer science topics, and applications. By limiting them, we undermine their capabilities and stifle their creative and inventive potential." I have felt this way for awhile with the direction some of these learn to code courses take with the younger kids. I think we sometimes forget just how quickly younger kids learn. They soak things up so much quicker than adults and even teens. Last summer I ran a learn to program class for 8 to 12 year olds and it was a very interesting experience. We taught them how to program Minecraft mods in JavaScript. The biggest hurdle was critical thinking and trouble shooting. We taught groups of 15 kids at a time and out of each group only 1 to 2 kids had the critical thinking/trouble shooting skills needed for programming. These kids were the ones that really excelled in the class and wanted to learn more. They couldn't get enough. By making things too easy, I worry we are losing those 10% of kids that have the potential to be really great programmers. That 10% get bored with the drag and drop stuff and bail out if they are not challenged.
- wccrawford 10y agoI think the easiest solution to that is to give them time to challenge themselves. I was very bored in school, and I usually found some way to entertain myself. If it was a subject that I was interested in (like programming!) it meant that I spent time writing other programs while I was waiting for the rest of the class. I would have preferred a stronger class for me, but this was the second best thing, I think.
- AstralStorm 10y agoA funny question: wouldn't it be easier to teach students assembly in a good environment that can diagnose errors instead of crashing and burning? It is easy syntax, no extra concepts. Then pick some sort of structural language, and then go further... Come to think of it, might be as successful as Logo but more gradual and useful. Everything is explicit.
- tyleraldrich 10y agoI think to actually learn Assembly, you need to at least have some idea of how a computer works on the inside. Knowing what a register is, what pointers are, what memory even is, is necessary to make anything besides "add 1 and 1." I'd encourage any CS major to learn assembly, but imo it's definitely not a beginner-friendly thing.
- phlakaton 10y agoI agree with the principles, but I am curious what so-called "coding app programming" approach they're referring to. I strongly suspect it's a straw man. I taught a semester of CS to high school students in Snap!, a derivative of Scratch. It's a coding-with-blocks app and we did go through a sequence of game projects with it. But it's unfair in the extreme to say students are not learning real CS by going through it. Here's what we covered: Algorithms and algorithmic thinking (one of the first things we hit upon!) - Data types and variables - Data representation - Binary arithmetic - Scope (to some extent) - Conditionals and boolean expressions - Loops - Modeling and simulation - Event-based programming - Functions and procedures - Prototypal OOP And all this while keeping high school students engaged with extremely limited time. The curriculum I linked elsewhere on this thread if you're curious. I think that, given the time and size constraints of an American high school class, the emphasis on keeping the cognitive overload constrained is paramount. And that includes as little yak shaving as we can get away with! Any attempt to evaluate a PL for intro really _really_ needs to look carefully and honestly at the yaks - in the language as well as the programming environment...
- mathattack 10y agoI agree. I dismissed Scratch as a toy, and then saw my kid doing logic, loops, variables, procedures... It was more advanced that anything I learned up until AP Computer Science. (And now he wants to learn Python)
- blendo 10y agoAnd now a derivative of Scratch can take you through the new AP "Computer Science Principles" course. See http://bjc.berkeley.edu/ http://bjc.berkeley.edu/, which says: "Snap! (formerly BYOB) is a visual, drag-and-drop programming language. It is an extended reimplementation of Scratch (a project of the Lifelong Kindergarten Group at the MIT Media Lab) that allows you to Build Your Own Blocks. It also features first class lists, first class procedures, and continuations. These added capabilities make it suitable for a serious introduction to computer science for high school or college students."