Principles for Programming Languages for Learners
cacm.acm.org
cacm.acm.org
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.
Pretty sure I've never met one of your students in an interview...
(Just joking...)
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!)
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.
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.
I don't understand. You are drilling them to memorize through repetition.
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.
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.
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.
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.
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."
Introductory Java works for me, though.
Once most universities begin with Python, the AP exam will follow suit.
http://cacm.acm.org/blogs/blog-cacm/176450-python-is-now-the...
But your point is therefore even more valid: not all of these students are going to be at top schools.
Any introduction to programming which requires hand-waviness is just teaching newcomers to not ask questions, which is terrible.
I started programming long ago in a land fortunately very far away with Visual Basic---and this statement expresses one of the largest impediments to my understanding of systems.
I wholly agree that it's detrimental (and perhaps negligent on an instructor's part) until a time where the student has a firm understanding of the boilerplate.
Was a tough unit that definitely did not hold your hand (I had done a lot of Java before that which handled things like memory allocation for you along with a much more forgiving teacher) but I am grateful I did the unit and really enjoyed the harder-approach my lecturer took.
That said, I only make them use Notepad for a day or two. My goal is that they understand that nothing magical is happening. Java is just text, which can be written with any suitable tool.
After the first couple of days we switch to Notepad++, which has syntax highlighting and auto-indent.
(We would use Sublime Text, but the district won't approve "shareware".)
I do have auto-completion turned off in Notepad++, though. In my experience that only produces beginners that don't actually learn the names of anything.
Auto-complete is super helpful once you have a few years of coding under your belt, but IMO it is inappropriate for honest-to-god beginners.
This makes sense.
> I do have auto-completion turned off
I also agree with this. I'm not going to start a debate over the topic, but I believe its benefits are best exploited once they are least needed.
With regards to choice of editor: I don't know your district's rationale, but I personally wouldn't want to encourage use of an editor that they would have to purchase to use at home and get the same experience---it's not necessary in our field, and there are many good alternatives.
Your choice was a good one. I can't speak for the editor (though I have co-workers that use it for light editing), but it is free/libre software---proprietary editors would send mixed signals, saying that it's great to be curious and learn, to share code with others, to modify your software to suit your needs and help your friends...except when others tell you that you can't. Don't impose limits on their ability to learn and explore. :)
Is this really a thing? I just can't imagine a student going into CS unless they have at least a bit of experience playing with it in their own time. As someone who started programming at age 7-8, I just can't believe people go into CS without a pre-existing interest in the form of a hobby.
Do people really enter into CS for the money grab? No interest in programming, no idea what they are getting into, and solely interested in the salary once employed? That seems so counterintuitive based on the reason the majority of us enter the industry. Maybe this is where the 9-5ers come from? I can't say this without ego being involved: you can tell the difference between a "real developer" who spends some time most nights digging into new tech, vs. someone who is in it for the salary who adds nothing but code debt every time they touch the codebase because they never improve their skills outside of office hours. ie: The "senior" after 10+ years whose every commit looks like the work of a first-week developer.
Students have room in their schedules for several electives and mine has a reputation as a tough but rewarding course. The majority of my students just take a single class and go on to college to major in something else.
Kids have different hobbies. I have students who've been playing soccer since they were 5 years old who don't play around with a computer for fun. Or they don't have access to a computer. (Many of my students are on free or reduced price lunch.)
Limiting the profession to those who started naturally at a young age is a good way to keep out everyone but rich mostly-white kids with college-educated parents.
Counter-example: I started coding at 9, got my first at-home family computer 3 years later, and my parents graduated college when I was already in college. This was back when a PC cost more than my parents made in 2 months. Now laptops can be got for $300.
It's not about rich, it's about having coding after-school classes as available as soccer (or whatever) practice.
I went through my first year at community college without even having a desktop computer. All of my home programming was with pencil and paper, and I used the lab. I can imagine that if you're 9, you may not have parents that can carve out an extra $300 so you can see if you like computers, or a lab at your school that has free computers that you have a sufficient level of access to in order to run or install the software you would need. I was in my 20s, and still limited.
Ok... so what about the kids who want to play soccer instead of being cooped up inside?
The idea that you might have to choose between playing a sport and getting enough experience to consider going into CS/SE in college is ridiculous.
I don't see what your point is. The OP suggests that coding after school classes should be as available as soccer practices. Do you think that if coding classes after school are made available then somehow it is harmful?
The idea that you might have to choose between coding and getting enough experience to consider being a professional soccer player is ridiculous.
;)
But my point was about having the choice and opportunity.
~$100 (or less for an old second hand laptop plus a basic internet connection (or the public libraries one) is all that's needed to start programming.
The question is, is there need for something like this?
Now, think about accessing the resources to learn programming: Books, Documentation, Compilers, IDE...
I recall being on 56k internet in 2001, paying by the hour. Couldn't have learn programming, except going around and buying books and tools on CD and offline documentation.
That was the hell of a barrier to entry compared to today.
No it's not. You first have to know that it's a thing that you might be able to do. Who knows what other barriers are there unless they live it?
A lot of poor people do not have free time to earn it-- they're going to school and using their minimum wage money to eat. I slept on the floor and worked 16 hour days to be able to get my education.
I would say it weeds out everyone who was not inclined to study programming or was not in a situation that prompted them to start programming.
Frankly, this is a childish presupposition. Let's imagine if surgeons where expected to have begun surgery for fun at the age of seven.
It's a cop-out excuse from teaching establishments (if used) and it's a harsh and exclusive requirement from colleagues, more fitting of a puerile fraternity than that a professional cohort.
What one does need, is a certain fluidity in language skills, logic, and most of all, most importantly, a will to learn.
Yes, it needs a lot of work, and it's not easy, but let's not invent imaginary boundaries for peoples careers and lives.
These are high school students.
Everyone starts with a simple "interest". Computers were the "interest" for me as a teenager that grew in CS. Others can be interested in "computers" but not know where to begin. Only after looking around did some find CS to be that "it" they were looking for.
There are all kinds.
1. It's quite ok to start programming after ones teens and still make a career of it. The basics of programming aren't that hard. It's the systems design aspect which takes a lifetime.
2. Internal motivation for the subject is the key. People are pretty good learners for most of their life.
"Money grab"... Most professional careers demand quite many hours put into it. Some programmers treat their career as a profession, others as just a job. Since there are no authorative qualification bodies on the matter (like for doctors) that's just how the dynamics of personal lives and human nature run.
That said, I don't really see the point in chasing after new technolgies - I have quite a large enough learning load in trying to gain deep understanding of my domain (graphics/computational geometry).
Over time, my interests grew and I wanted to make websites so I started off with some HTML. I got a basic hang of it and I wanted everything to be pretty - so I did some basic CSS and then I got in JS. (All of this was done in Notepad - I was not even aware about auto-complete and tab indentation till I got to university and started using Visual Studio and Eclipse)
I got into Software Engineering in university because I was passionate about computers - not "programming" in general. But the course of my education, I got into everything from web and mobile dev, to creating file systems (it was extremely basic) - and now, I'm extremely passionate about programming. All that said...from personal experience, I would say that if you combine game dev, CS and SE - more than 80% of the incoming class came in with no prior experience in programming.
In my specific class, out of the graduating students (in Software Engineering)- at max 2 of the 15 are what I would consider "good/skilled" programmers. The rest got in because of various reasons (thought it was easy, thought they'd get a huge salary after leaving etc.) and don't really give a damn about programming/tech and their code/skills display that - but in the end, it does not even matter because companies like TCS/FDM hire such students, have a "intense" training program (read: basic Java/C# skills) and then pass on these "trained" students to enterprise (banks, hospitals etc.) and pay them extremely low (min. wage during training period, 30 - 40k CAD for the next 2 years - which these students will accept because they are aware of their deficiencies and this sets a bad precedence for even skilled workers)
It's not TCS/FDM's problem, managers/enterprises don't care either as long as you have that many hours/day and work gets done (quality and ownership does not really matter) and your co-workers generally have a similar skillset and play hot potato when it comes to getting actual work done. All the workload finally falls on that one skilled guy / team who basically does everything (who'll keep getting more and more frustrated and finally quit)- rinse & repeat. And worst of all - co-workers will have the audacity to make fun of the skilled worker for having an interest in programming/work (because having a passion for what you do is somehow a bad thing /s) all while offloading as much work as possible.
I have seen quite a lot of friends (skilled and mediocre) basically fall into the above cycle and in the end - the skilled are the ones who finally give up and stop giving a damn about their work/skills (which then sets a bad example - I have heard this as an example in uni - "why bother studying this framework/tech?, just find the guy who knows it and offload it to em") while mediocre workers basically get skilled at just that - not getting work done while not getting fired - which is considered a perfect 9 - 5 life.
BTW the above are my experiences and incidents I heard from friends/co-workers etc.
2. My mother, with an English degree, went into programming in her early 20s through a training program at her job. That was nearly 40 years ago, and she's still going.
Programming is largely a monoculture that looks down on people who are dissimilar (for example: who didn't program as a child, or decided to enter the field in college), and actively discourages them from continuing by assuming the worst about their capabilities.
Introductory courses often serve the purpose of introducing students to a topic they've only heard of, if that.
I found it a pretty surreal experience working on a Chinese (Java) code base. All the names were in English (comments were in Chinese, but anything that wasn't a comment was in "English"). Everyone used autocomplete. If a name happened to be misspelled on creation, everyone happily went with it forever. They didn't care. Even if e.g. you had a bunch of related methods like "dispatchAComponent", "dispatchBComponent", "dispacthCComponent".
I think the article was written more in relation to teaching younger children, rather than high schoolers.
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.
I'd love to chat with you outside of HN if you have the chance!
Shoot me an email; would be happy to discuss.
Sem 1: https://teals-introcs.gitbooks.io/introduction-to-computer-s...
Sem 2: 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.
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.
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.
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.
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.
You forget how difficult is getting to the point where you can "trivially" solve problems at the command line. For one you need to be aware of the tools' existence and then understand their functions and how they cooperate and fit in together.
My argument is that time can be better spent teaching general skills than teaching students how to be locked into a single proprietary program and try to force certain topics into its domain so that they can use the tool familiar with them (Excel) to solve the problem.
They take my course to learn programming so we don't waste time on applications, valuable as they are.
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.
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.
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...
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.
Logo fails this criterion as far as I am aware, Pascal and Squeak do not.
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.
I've been teaching programming 1-on-1 with mild success by introducing concepts related to teaching fairly early: http://akkartik.name/post/mu. But I'm very conscious of what I don't know, and eager to learn more.
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.
If you can write a TDD suite to test those first 69 labs then my hat's off to you.
I think we have different definitions of the word "beginner".
Absolute beginners have trouble looking at foo = bar; and understanding that variables do something different on either side of the equals symbol (which helpfully is doing a different job to what it does in their math class). TDD I just adding another layer of misunderstanding and complexity when you need simplicity and clear concepts.
I even got to try it myself recently. The IntelliJ people have a nice setup for learning their new language Kotlin. Every exercise is driven by automated tests:
I'd love to see this approach tried seriously with programming novices. Partly because I think it's a good learning experience. And partly because people get used to testing from the beginning.
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!