How Should I Teach a Basic Programming Course?
riverman writes "I have been 'provisioned' at the school where I work to teach a new Computer Science/Programming course. I'm supposed to be teaching everything from the very-very basics (i.e. where that myspace thing is in your computer monitor, and how it knows who your friends are) to the easy-advanced (i.e. PHP classes and Python/Google App Engine). I'm an experienced programmer, but I'm not sure where to start — I could easily assume that my students know something basic they don't. Are there any resources on the internet that could help me find a solid curriculum? What are your suggestions?"
I'm sure many of us have gone through intro-level programming courses of some sort; what are some things your teacher or professor did that worked well, and what didn't work at all?
Computer basics, ie how to use the web, and computer programming do not belong in the same course. People in the audience for either will not be happy with the other.
Don't teach things in 'the abstract'. Give them a task to accomplish that needs particular 'features'.
Then the next 'task' adds more 'features', but doesn't drop the earlier ones learned.
And don't make the tasks abstract either. "do a bubble sort" would qualify as too abstract. While "collect 5 client names from the user and sort them" wouldn't.
---- Booth was a patriot ----
You have to taylor the content to the audience.
Not knowing what age range is your audience makes it difficult to give you concrete
advise.
Avoid the history of computers, most young people (i.e. everyone under 40!) finds
it boring and in reality it is useless.
You can use Scratch as a great tool to introduce
programming concepts without the boring theory.
In general, do not bore your audience, that's the secret.
Be very, very careful what you put into that head, because you will never, ever get it out. - Cardinal Wolsey
Most people who are taking a programming class already know how to use a computer. About the only way that you would ever teach basic computer skills in a programming class is if it was required to graduate. Also, what level is this? Is this high school? College? If it is college is it mostly people who are fresh out of high school or people looking to get a pay raise by getting a degree? All those things will change how you need to work it.
Taxation is legalized theft, no more, no less.
1) Teach them to understand that a computer does what a computer is told. So as a class building exercise get them to "program" a robot in pseudo code. You give them a fairly complex assignment that involves decisions. The test in this is that you the teacher are the robot. And the students who thought of this as a joke or simple assignment will quickly realize that garbage in garbage out means something.
2) Do the assignment again, but this time add "testing" routines. Make them write little assignments, that are assembled into bigger tasks. Show how this could be a "test driven" environment. You teach the robot little things, and then those things are assembled into bigger things. This teaches them components, modules and test driven.
3) Take all of that knowledge and apply it to a programming language. I personally would choose something along the lines of python and ruby. They have enough problems and they need a quick turn around.
4) Teach them about OO by introducing them to a programming language like C# or Java.
5) Finally teach them functional
Though I would stress team exercises thus giving them the benefit of XP (Extreme Programming) type training.
"You can't make a race horse of a pig"
"No," said Samuel, "but you can make very fast pig"
...my first class in programming: the teacher wrote "x=x+1" on the blackboard, and my reaction was "Huh? That is unsolvable!"
So, one of my friends in college did his senior research on alternative ways to teach introduction to programming and gave a very convincing argument for teaching it with Python and Blender (the 3D content creator). Blender allows you to use the Python programming language to set everything up and manipulate the objects so they learn programming, but it's a lot more satisfying. For example, what's more fun: reading input from stdin and saying if that integer is divisible by 3 using % or creating some 3D objects and moving them across the screen in a specified way?
Maybe someone else has a better idea, but I thought I'd share
This was a recent topic on stackoverflow. There are some really good suggestions there.
Find Steve Drasner. He's a Computer Science professor at Northern Virginia Community College in Annandale.
His intro to programming class starts at the bottom, teaching only pseudocode without the use of computers whatsoever. After giving the students a good grasp of concepts of structured programming, he uses it to segue into the concepts of object oriented programming.
I took Java prior to Drasner's class and, while I understood most of what I learned, I never quite understood the purpose of OOP/D until I took Drasner's course. Everything snapped into place.
http://www.nvcc.edu/home/sdrasner/
Viable Slashdot alternatives: https://pipedot.org/ and http://soylentnews.org/
You could check the Stanford Engineering Everywhere program's resources. They released some great beginner level programming courses under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported license. Those could be adapted for teaching the subject to students, and the content used for instructional material.
I attended a fascinating talk by Mr. Vern Ceder at the past PyCon (Python Conference) on teaching programming to secondary students. You might review his papers from that and other conferences, and email him for advice (see linked page).
As a college student currently enrolled in an introductory java course, what I found particularly interesting was the initial teaching of really basic HTML and its tags to introduce the idea that programs need to follow a rigid syntax for them to function. Although I already had previous knowledge in Java and understood this, the rest of the class seemed to benefit from the way that the class was introduced. Regardless of the language, the professor can then go into basic programs for the target language (Java, HTML, Ruby, etc.) and build from there.
First, it is a good idea to try to do some sort of survey or something to judge their skills. However, that being said, you will almost certainly be dealing with a broad range of skills from some who may know more than you to someone who barely knows how to turn the computer on.
The hardest thing is trying not to make the advanced students feel bored and the beginning students feel like you are talking down to them. That's when good teaching methods come into play. I would suggest asking the students to explain how to do things rather than some sort of lecture.
This is one of the biggest challenges of teaching anything dealing with technology. Even in classes that aren't about technology, if you ask them to do anything on a computer you will run into difficulties. For example, I've had students turn in papers electronically and, like nearly every class, I've told them to double space the papers. In every class I've had at least one student who made the paper double spaced by hitting return twice at the end of every line.
http://www.popularculturegaming.com -- my blog about the culture of videogame players
Thinking back (waaaay back) to my first programming class in HS, there are going to be two kinds of students, those who have an active interest and those who do not.
The ones with an active interest will just need a little bit of "fuel" and point them in a direction and let them go. For these students you can show them a quick demo, tell them where to find more information, give them a project, and all you need to do is be available for questions. Too much guidance or restriction will either bore them or make them frustrated.
The other kind, lets say they have a passive interest, might be curious but maybe they don't have the same motivation as the others, so they will like to see many demonstrations, and have hands-on exercises where you guide them through something. I don't know if the active and passive interest students could be taught effectively in the same class.
I Heart Sorting Networks
If you are covering more than one language in a "basic programming course" then you are already off mark. Now if your goal is to do more like a survey of programming languages, or an introduction to programming languages, then it is appropriate to explain why there are different languages, the types of languages, why languages are used in specific roles, etc.
If you are truly teaching programming, as in at the end of the course the students will be creating programs that do things, then you need to stick with one single language and development environment. Otherwise, every time the students begin to grasp the language and how it is invoked you are switching to something entirely different.
Better known as 318230.
Don't teach BASIC.
Scariest title ever.
Faster! Faster! Faster would be better!
As you are no doubt aware, "where is that myspace thing" and php/python/C/Pascal/Ada/C++/BASIC/LISP etc are not in the same ballpark. The scope of the class seems unclearly defined - an "Intro to computers" vs programming.
Let's face it 99% of the people in the developed world (and higher in the rest of the world right now) will never need to program or want to program. They just want their computers to work and do what they want.
Traditionally, computing is taught "bottom up". Courses used to start with binary arithmetic and go on to NAND gates and flip-flops. Now, there's a trend towards "top down" instructions, where you start with something like using JavaScript to modify a web page, or PHP to create one.
Most people don't need to go very far down. Down to the first level of code probably covers most programmers today. Some still need to understand C. Fewer need to understand assembler. Fewer still need to understand what the CPU is really doing (do you know what a CPU's "retirement unit" does?). Still fewer will ever wire logic gates together, write VHDL, or deal with timing constraints in IC layout.
A bit of understanding of what goes on behind the screen is a help, though. A reasonable place to start might be PHP, followed by some MySQL to give a sense of how data is stored and looked up.
Python is a simple but powerful language. Cambridge University Press is about to publish this book by Allen B. Downey. The link above shows a free online version.
1) Is it a "programming" course or a "computer science" course? There is a difference.
If you are teaching them how to program, then you need to cover background things like "what is source code" and "how to compile a program and what that means" and "now that it is compiled what do I do". Then you need to introduce typical programming constructs - loops, conditional logic, representing math operations, etc.
If you jump right into the web stuff it's almost completely missing all of the basic concepts.
I'm a 2000 man.
When I first learned to program, I remember the teacher asking us how we got to school that day, in as minute details as possible. Example: awaken, open eyes, elevate torso, rotate 90 degrees, bend legs until they reach the floor, stand, walk to bathroom, etc.
From there, you can explain the concepts of procedures to compartmentalize the code. Brushing your teeth may take thousands of steps, yet cut down dramatically with looping, etc.
While it starts out as a new way of looking at how computers process the steps in a more methodical sense than we do, it soon becomes a way to introduce functions, procedures, and other syntax in a practical sense.
Don't teach down. By this I mean please do not be shy about giving more complex examples. I had a professor who would constantly keep things very basic on purpose in order to not confuse people. The problem with that is that the top 10% get VERY bored and leave with questions unanswered while the bottom students (those who will go on to write inefficient insurance company database query code) still struggle to understand the difference between ++i and i++.
You should keep your advanced students in mind and nurture them. Do your part to help out our future.
The majority of people - even those with college degrees - have a difficult time with logic. Something as simple as an if-else construct can be very confusing to the average person at first.
And there's another twist. About 40% of learners can understand and manipulate abstract concepts, and learn them without any practical experience whatsoever. The other 60% require experiential learning - they have to do before they understand. Fortunately, computers can very easily demonstrate concepts such as if-else...
And how computers work is a mystery to most people. Before you start the course, you should come up with a simple mental model that you can use to explain how a computer works to someone with absolutely no understanding of electronics, logic, etc... For a basic programming course, you should first assess class understanding:
For most programming courses, you should not even assume your students understand how to use the compiler. Furthermore, you should probably come up with a series of simple examples which demonstrate your point without any extraneous code. Because most people learn by doing, one of the first exercises should be to build a simple "hello world" type of application to familiarize themselves with the build tools.
And have fun! Come up with interesting problems. Your students will most likely spend most of their corporate careers doing boring stuff, so they'll appreciate the chance to do fun things like games.
The society for a thought-free internet welcomes you.
...shrug...
It'll get their interest, but then don't do it and you'll have taught them the most important lesson that can be taught in computer science.
bait and switch.
I was not a comp sci major (a physics major), but I took comp sci classes, and am self-taught in compilers, language theory, and everything else I know about computers - including the hardware level, like the majority of people in the field. Looking back on the courses I did take, I feel that they left out a discussion of the flaws in the current paradigms. For example, the failure of the core von Neumann model of computing to address the problems of parallelism. The failure of procedural languages to enable intentional decomposition so that one can be sure a program is correct. The failure of OSs to be secure, and why that is. People think this technology is mature. It is anything but. The situation we are in has to be transitional, or we are in "deep sh**". While teaching them how to hack in the current languages (one can do no better than that), give them the message that this stuff is fundamentally broken, and that something better is needed.
As a starting point, I suggest this (draft) paper, because it's interesting, and short, flippant, and gets you thinking. The Camel has Two Humps
Belief is the currency of delusion.
to suggest not using "myspace", or anything on the Internet as the starting point, but instead use some computers that were *not* connected to the Internet at all, and teach actual programming, but others have suggested starting without computers entirely, and that makes sense too.
To be perfectly honest, it wouldnt hurt to find a copy of DOS and GW-BASIC, and teach that. (Apple II's, using either Apple Basic, or Pascal would probably be harder to find)
If you absolutely have to use something modern, I suggest shell scripting on either Linux or even OSX. Maybe some perl. Yes, I know these are considered old and archaic, but either one avoids all the bells and whistles and distractions of Visual-(anything), and would give them a solid understand of what actual programming is. Thats assuming that programming is the object of the course.
You might also get a bit better description of the course than it sounds like you have. From what you've said, it sounds like they told you 'go teach something about computers', so that student who have to take a 'computer' elective to graduate can do so, but they don't really expect you to teach them anything.
If thats the situation, you would serve them (and the IT field in general) well to introduce them to non-Microsoft systems, so they understand something else exists. Requisition some systems, and burn some copies of your favorite Linux distribution and let them install it.
Step 1: Determine whether you're supposed to be teaching computer programming or computer literacy.
If Computer Literacy, rename the course and structure it accordingly. End.
Step 2: Where that myspace thing is on your computer monitor is computer literacy. Don't teach computer literacy.
You don't start a calculus course with a review of the multiplication tables. Any students who don't already know how to use a word processor and navigate the web are not ready for a programming course and don't belong in one. Catering to them will aggravate and waste the time of the students who -are- ready for a programming course.
Step 3: Pick one structured, strongly typed language like Pascal or Java. This is the -only- programming language you will be using in the course. Survey of programming languages comes much later, after the student knows how to program in a structured, strongly typed language.
Step 4: Go pirate one of the open content freshman CS courses from the colleges that publish them on the web. This is the content you will be teaching, only you'll want to stretch it out over a year instead of packing it into a semester. That should also give you some time to throw in some fun stuff of your own, but keep it parallel with the general lesson plan.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
HTML in a basic text editor is a great place to start. It teaches how to open and close tags and the importance of correct syntax.
You can also make it more complex by adding CSS or Javascript which resemble real programming.
You want your students to learn something about computers along the way. Start with something like C. The last thing you want are a bunch of grads knowing shit about computers but knowing all about how to function in the Java sandbox.
Trolling is a art,
From what I have observed in my classes, students like to see immediate results. I think the robot exercise posted a very good idea. Having the students make it perform an easy task like stand up and walk until you get to the wall. I also think dividing each of the parts of the 'program' and giving them to groups of 2-3 students would be worthwhile so they can see how they have to work together and what assumptions they should make.
Once they have mastered that, they should see that programming doesn't have to be math based, instead its giving very specific instructions for every little intricate thing.
Id lecture for a little bit about what a variable is and a loop and then jump into something with more immediate results, like Alice (Alice.org).
Take a look at Alice. There are even textbooks based on it.
Remove the caps and hold to a mirror.
You need to teach concept not concrete skills. If you teach the concepts they will be able to adapt them to other things if you teach skills the will either need to learn the concepts behind them or forever need someone to teach them the new skills for the next thing.
There was one comment that really stuck with me from my lookover of Knuth's books. He developed a virtual machine and teaches everything based upon that, why? because if he has used C or Java or Basic or Fortran or anything else he would have to continuously update things to the new standard language. I am not advocating that you teach an assembler language but you do need to make few basic decisions first is what OS are you going to use? If you are going to use a command like based OS then you skip all the complexity of a GUI and still use almost any language you want to focus on the concepts. If you are going to use a graphical OS then you will either need to go into the concept of building a GUI or pick a language with some envelopment which handles the GUI aspect.
The first concept I would suggest is that computers are stupid or mindless. The second is that no matter how complex the program or the computer, the computer is still only performing one of a few possible operations at a time, basically working with numbers which mean different things at different times. You should explain the difference between concurrent and simultaneous and the concept of threads (the concept, not necessarily multi-threading) You should teach the concept of interrupts and events and event driven concept versus procedural programming concept.
As for a language I would suggest that you cover multiple language conceptually and maybe a few concretely. Teach in a pseudo code so they need to understand the concept and fill in the gaps.
Knowing what ages and experience and the time frame... ie..once a week or daily would make it easier to give a better list of ideas.
Last thought, ask them to write down how to tie a shoe lace both at the beginning and at the end of the class and let them see how they few that problem differently after learning how computers work.
Former teacher here. I was in a similar situation. Here are some pointers:
* Go low level. Dedicate a lecture early on to bits and bytes and how binary logic becomes maths. The students don't need to know how to build a processor, but you need to dispel any notions of magic from the bottom up. Without some understanding on this level, computers will forever seem slightly magical. (Keywords: Relay, light-switch, bit, byte, register, instruction, Assembly, bus, ram, hard drive.)
* Build upon the previous and explain digital audio and more importantly, graphics, as examples of how the numbers become sounds and pictures. (Bitmaps, graphics memory, sample rates, bit depth.)
* Operating systems. Students should know which ones are out there how they differ and what they have in common. (Driver layer, process, program, gui)
The more you put into these steps right away, the easier it will be to teach programming. Also, it tends to equalize the student pool. I put it into two two-hour lectures, but you may want to be even more through.
Proceeding from there depends a lot on what the goal is, but for programming, I found that interwoven lectures and exercises with support time (teacher/TA in the computer room) usually works the best.
Don't do pascal. It is a useless language that is missing fun features like the goto statement. Also, the biggest gift you can give your students is enthusiasm. Encourage them to play around with the code rather than just doing the assignments. Better yet, have them create their own small project assignments that use the language features you are trying to teach (rather than say, making a student who has no interest in buying a house write a program to calculate mortgage payments.) I remember the most fun I had programing in school was getting the computer to print "I hate algebra" 100 times in basic. Unfortunately, the fact of the matter is so many instructors teach programming poorly and/or don't really know it themselves. Insist that the programs actually compile and run. This way you know the students know the concepts rather than writing a bunch of garbage. Also, don't forget to teach important things like the compiler or interpreter (use a good free-software one like gcc, don't make students buy expensive toolkits they don't need. It should work on Linux, Windows and Mac so that students can do it at home. ) If you somehow fail to teach programming and/or you students are unhappy with you, don't be surprised. It means you are just a normal person rather than an extraordinary teacher.
Figure out what this class is. If absolute beginners, then teach as such, including programming concepts as well as basic syntax. It it's experienced coders, you simply teach the new syntax of the language, as well as specific new and unique features that the language has.
with
BASIC, obviously
Kilgore Trout .
or else they'll hate doing the actual work... typing. If their fingers aren't fluent, they'll spend all their time trying to save keystrokes, by cut/paste, or just not doing some things. Let them wrestle with it for just enough time to start to get frustrated, then switch to typing training, with a good tutor program, and time trials. The people whose fingers to go the home row and eyes to the screen are always far superior to and enjoy their work far more than the ones whose index fingers poise above the keyboard under their eyes.
Thank you, Ms. Castellucio, wherever you are.
http://www.bembry.org/technology/python/index.php
IIRC, the site's creator is Bryce Embry. His python stuff was, again iirc, created for high school students. I found it extremely helpful when I was learning python.
You can give students too much information and they just get lost and confused. bembry gives just enough to get the students going. I send him a big KISS (keep it simple stupid) award.
Teach them to outsourse, for class and future employers.
at my school "computer programming" is playing flash games on the school computers
You might want to take a look at Greenfoot (http://www.greenfoot.org/). It's a nice programming framework for beginners using Java. Unfortunately it's not open source.
There's a Google tech talk about it at http://uk.youtube.com/watch?v=Tcwx-I6Arwk.
IMO, computer basics have no place in a programming course. If your students don't know the fundamentals of operating a computer, they shouldn't be trying to program one.
Having said that, the first programming language I learned was BASIC (specifically Atari BASIC), which was great because it was easy to learn and we got immediate results/feedback from our efforts (no need to wait for a compiler or even have a completed code block). But that wasn't part of any course; the school just provided computers and instruction manuals and let the students explore programming on our own.
The first actual class I took in computers used Apple II. I actually don't remember whether our assignments were done in Apple BASIC or Pascal; it was probably the latter. Either way, it did introduce us to more structured programming (loops, subroutines, algorithms). I would imagine that most of those concepts can be taught using any procedural language, but I would advise picking just one language and sticking to it. Comparison of different computer languages should be saved until after the student is familiar with programming concepts in general.
I would also suggest not introducing students to object-oriented programming until they've learned procedural programming to the point that they understand what a data structure is.
One of the issues I had when I was in school is that the computer classes were radically changed as I progressed through my grammar/middle/high school career.
In 3rd and 4th grade, we learned LOGO on some old Atari computers and were basically taught about pixels and where home row was on the keyboard. It was all very simple to grasp and we did a lot of projects (drawing pictures in logo) that required us to use the keyboard a lot.
In 6th grade, we had a BASIC class (not Qbasic, not visual basic... straight BASIC) on PCjr systems where we learned how to draw shapes to the screen and were taught the basic ideas behind computer resolution, very simple loops, how to print text to the screen, read input and use if/then. We also learned what input and output devices are and the names of the various computer parts (monitor, keyboard, printer, etc).
I liked those classes and they went at a good pace which was great because I was the only kid who had a computer at the time (this is like 1991/1992) and everyone seemed to get what was going on and it was great. When I got to high school, there was a VisualBasic class which had a pre-requisite of Intro To Comptuers. I opted not to take that since not only did I have a computer for my whole life, but I also had the previous classes. When I talked to my guidance counselor, he said that the intro to computers class was just a typing class. The visual basic class was not a programming class... it was a class that teaches you the basics of computers (what a floppy is and how to print) and then ends with showing you visual basic.
I opted not to take either class.
My senior year of HS (98/99), they added a c++ class which I managed to sign up for by talking to the teacher and showing him that I already knew a little C++ and already knew computers better than most others (I would have had to take intro to comptuters and the VB class, otherwise), but that class wound up spending half the year teaching about how to use a web browser and what the difference between RAM and ROM is before we even got to 'cin' and 'cout', and that's all we ever did.
So my advice is to spend very little time on the basics of computers in general and dive right in to projects that get them applying what they do know to do things that they want to do. Also, use a language that lets you dive right in. Java is a programmer's programming language. New programmers never understand it because it requires so much up-front knowledge to even understand what a simple hello-world app does. Especially if they are coming from visual basic or something similar.
I think that C is the best beginners language out there. It's very simple. It's super straight-forward. There's a ton you can do with it right out of the box.
PHP may be another good beginner's language, too, since the web is what most people use the most when they're on a computer and it would enable people to show off what they've done. It would also spark much more interest than C, especially since building a C app to work in windows isn't really a piece of cake... although programming in windows, in my experience, has been very difficult... there's a limited amount of free tools and it comes with virtually nothing built-in for that.
...spike
Ewwwwww, coconut...
PYTHON!
Buy a "programming for dummies" book and get the feeling of not knowing anything. I'll get ideas from it.
DNA in your Linux: DNALinux
It's the coolest and most interactive language -- most immmediately available (in every browser), and you get immediate and gratifying feedback (seeing results and interacting in your browser).
And it's cool because the JavaScript language itself has understandable structure, with an ultramodern approach to functions, scoping, and objects. Use the excellent book "Javascript: The Good Parts".
With a WebDAV server like LimeBits.com (disclaimer: I work there), you get automatic state storage and data storage, which overcomes limitations of running in the browser. LimeBits is an execution platform for open-source JavaScript, as well as a free storage server.
I'm in an Intro to Visual Basic class now, and in the beginning the instructor started with a "jump right in" approach: he would show us how to design a form, add a couple lines to a button event, and voila! Most of the class thought it was magic. He never has bothered to give the definition of a variable, a method/function, or explain why it is that you can say strExampleString.Trim() and your string knows what to do. A thorough grounding in the conceptual basics will do your class a world of good.
Start off without a computer. At the basis, computers are sequential, even if some other from is used in the programming. Students must be able to break processes down into steps. They will invariable create ambiguous steps or leave steps out. Act out the process to show the missing steps. Use humor show undesired outcomes. Kids tend not to fully comprehend cause and effect, sequential logic, and the like. They tend to want to told a process, then apply the process mindlessly. The creativity and flexibility at the basis of programming a computer must be taught. At this point language only limits the students options, so it is not necessary to worry about that yet.
Second, the student must understand the limitation of a computer, and how they function. A sideline into binary math and boolean algebra is useful to teach these limitation, and get the student to think on this detail. If an AOI circuit simulator is available, this can be used to teach these limitations, as well as get the students used to using the computer in a product creation manner. This last bit is important, because many students have never used a computer to create anything significant, and don't really understand that this is what many professionals do. They know how to use proxies to bypass security, but not how to load an IDE to create a program. Many can't even comprehend it, and play with their proxies not understanding that there is something else they could be doing.
This is a bit abstract, but computers do work in the abstract, which is why CS majors, and scientists, engineers, and math people tend to earn a premium. Such people can think in the abstract, and they can not only because of innate ability, but because they were taught to. Teachers that shy away from the abstract because the kids complain and it is easier not to are leaving out a part of the educational process. But use concrete examples to keep the abstract grounded in something the students can relate to.
At this point, when everyone is familiar with the computer function, some time can be spent detail the general workings and components of the computer. I have seen children as young as 9 forced to memorize, rote, the names of each part of the computer, and match the name to the part. I have seen high school kids repair computers with a high level knowledge, not quite knowing how everything really fits together. I don't know what level of detail is necessary for computer programming. They should now what a computer is, but I would not formally assess or punish the lack of rote memorization.
At this point, it depends on what is to be taught. Something like Alice can teach OO concepts in a very accessible and high level manner. Since most everything is moving towards using a high level API with short bits of glue code, this may not be such a bad choice.
If actually programming is to be taught, I would not use an overly complex IDE or language. The basics need to be taught. for instance, to switch values i=j; j=i does not work. Variable scope is important. How one passes parameters is important. Global variable can be very bad. That sort of thing.
At higher level, creating reliable contained data structures is always a fun topic. Write a web engine or a word processor is now a well known problem and can be handled in a year. If there is a science or math component, well formed solutions to such problems are also quite instructive.
A key thing that is often missed in debugging. Give students time to debug their work. Don't cave to the crying. Let them help each other. Assessment is best done in their ability to fix a bug, rather than sketch out a section of code or a data structure.
And of course project based and group learning is the soup du jour. As mentioned, it is possible to have the students write a si
"She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
We need to change the stereotypes of future generations of programmers!
The CB App. What's your 20?
When I was being taught, we were shown how to do algorithms for everyday tasks. What are the steps to show someone how to make a BLT. You get them to start at the beginning but don't tell them. Show them that they must use deductive reasoning and let them learn what assumptions are. If they miss something obvious, ask them - what about x? Also, show them that there is no real one way to do things but there are logical ways of doing certain things better or more efficiently *functions, loops, etc.
(1st sig) If this were a snappy sig, you'd be reading it right now. (2nd sig) I'm a karma whore. >Insert FUD here
Try using LOL code (:
And that rule is to make your god damn code readable. Use comments if it makes sense, break up blocks of code into digestible blocks, useful function names and variable names. I can't remember how many times I've seen unreadable code with 1000 line functions, no comments at all, different classes with similar names, braces that don't line up, etc. Oh well, given slash dot I expected to have this one moderated down.
You must approach it as a hamster would when teaching a baby squirrel to fly.
I'd highly consider teaching Delphi for beginners. Why? Because it is easy for beginners to grasp, and as the student progresses, you can teach them about memory management, pointers, references, inline assembly, etc. Check out this site for some great tutorials and resources (http://delphibasics.co.uk/). Also, you can download Turbo Delphi for FREE here: http://www.turboexplorer.com/downloads The beauty of Delphi is that it is easy to get into, and also very very powerful. I believe it is also a great foundation for moving to other languages, like C++ or even C#. Regards
Start from assembler.
Mwa ha ha ha ha!
The simpilest example I can give you to use is the making of a peanut butter and jelly sandwhich. Bring loaf of bread, knife, jar of jelly, and a jar of peanut butter to class and ask the class for instructions on how to construct the sandwhich.
statements like 'put the peanut butter on the bread' would result in taking the jar of peanut butter and placing it physically on top of the loaf of bread. Similarly, the statement 'add the jelly' would mean moving the jar of jelly onto the pile you've created. Until the students understand that each (and every) step must be stated, they won't correctly grasp the concept of what programs do.
Jerry
"Software is the difference between hardware and reality"
Get into the mindset by explaining the ubergeek religion...
Linux is godlike, Anything from Microsoft is the work of satan, and that Slashdot is their bible.
Back in High school, in an "Introduction to CS course", we started with our own made up language. Since CS wasn't really an organized thing at the time, I had already taken a course that used QBasic, so when the teacher started using Homer Simpson as an example of a computer (since "computers are dumb"), I started recognizing it as effectively bring Basic. Variables were equated with post it notes, functions with sheets of instruction, and every program ended with "GOTO MOES" to get beer.
Very simplistic, but it was meant for people who had no idea how to program. Plus I laughed.
Z, if you're reading this, thanks again :)
That all said, you might want to consider a "placement test" if you're not sure. That way you can at least try to deal with or even avoid the "half the class knows C++ and the other half has never seen the command line before" problem.
How Should I Teach a Basic Programming Course?
Very simply.
The higher the technology, the sharper that two-edged sword.
So your students will be able to understand their supervisors and employers...
Use an interpreted language for most of the beginning teaching. Especially if the language has a shell where the user can tinker.
I would recommend dividing the class into computer basics, using the web, and then hit programming.
The basics I would make VERY basic - talk about what an OS is, hard drives vs. USB drives, how computers process and store data, how computers are networked - all from a very high level. Make sure they understand how to save files, and where they go when they are saved.
For web, specifically "web 2.0", take a look at http://plcmcl2-about.blogspot.com/ . Whether it makes sense to just do the "23 things" from that site, or pick and choose (perhaps even have students pick and choose different projects, and then show & tell would showcase the widest variety of stuff on the web).
Programming should start very basic, maybe with an interpreted language like Perl or Python, and then maybe discuss compiled languages such as java or C/C++ or even C#. Once you get beyond "Hello World", I'd highly recommend pointing to some of the design patterns that are out there - show them how to find good examples on their own.
I've seen basically two types of courses - one follows a book (SAMS, for a bad example) that walks you by the nose step-by-step, and at the end, you can repeat the steps (maybe), but have no idea what you've really done. The better course says "this is one way to do it, here's another way, and if that's not enough, here's where to look for more". The second way is a lot more involvement between student and teacher, but I think it helps the student with problem solving and analysis down the road (where the first method teaches them to grab the first easy answer they find).
"The large print giveth, and the small print taketh away" -- "Step Right Up", Tom Waits
so the answer is - it does not matter. Some of them will get it, most of them won't, makes no difference what you do.
If you still have time in your course after that, you'll probably want to touch on object oriented programming a bit, though that subject really deserves a course entirely of its own. I don't think you can really do justice to OOP and design patterns in less than a semester.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
I find lately the biggest hurdle in programming is getting your environment setup and being able to write and execute code. Many of the development environments are pretty tough when you just start out, but if you know enough to get testable code written it relieves a lot of stress. And not everyone wants to be a programmer, so don't expect total buy-in those that do will more than appreciate the leg-up to get started from their they can access the Internet's resources to develop further.
For most people nowadays teaching HTML wouldn't hurt. Many languages interface to it and the web is now a hot method of app delivery.
Introductory class... if this is going to be a prerequisite for something better cover those bases needed for the next class.
Languages, I like the ones with some clear understandable syntax that is not overloaded with obscurity. PHP and Python are pretty straight forward (what you read is what it will do). But if it will lead into something like OS design, then you have to get into C/C++.
But the most important thing you can do is:
- get them to be able to get an environment loaded onto a system
- write some code that works and make sure they know what to do in order to execute it. (Programming is no fun if you can't figure out how to get your code to work.)
- Also steering them in the right direction with some good syntax highlighting editor, IDE, discussion about setting up a project file structure, etc. all are valuable to the noob.
- Next would be to give an explanation about some useful but simple code works (how a forum works, or a simple game maybe) those into it at this point will pick it up and do more research and mess around with it, and the others hopefully you wont bore them too much.
"Enjoy what you're doing! If it becomes drudgery, you're doing it wrong!" - Jim Butterfield
Computer literacy is distinct from networking which in turn is distinct from programming [as has been said]. Don't try to teach them all at the same time, and only teach two at the same time at the areas where the two overlap.
The rest of my post is about teaching programming specifically, not the other two (although it may also be relevant to system administration).
Teaching generative models is crucial. What does that mean? It means teaching the causal connections; for one, between what the code says and what it does, and for two between what one piece of code does and what another piece of code does.
Three interesting reads:
No matter which languages and tools you teach, and no matter which problems you make the students apply their tools to, help them obtain a generative model, and help them help themselves obtain a generative model.
As for which tools to teach them, I would recommend python. It allows you to go straight to the meat of the matter without having much in the "this part is magic, you're not supposed to understand this". Also, it supports the teaching of multiple paradigms. Procedural and OO programming are its strengths, but you can definitely teach the ideas of functional programming in it as well--it already likes doing things with lazy lists (called generators), such as map-filter-reduce.
There's also a good book, How To Think Like A Computer Scientist, freely available at
http://www.greenteapress.com/thinkpython/thinkCSpy/html/. Be sure to also look in its parent directories.
(There are also other programming paradigms or computational models, such as prolog-style declarative programming, string rewriting systems or cellular automatons; python doesn't lend itself naturally to do those, but it should be simple to write a simple string rewriter; besides, I wouldn't suggest teaching esoteric computation paradigms).
So my vote is Python, How to think like a computer scientist, and a lot of attention to the generative models.
If you need an example of real-world python, I'd suggest the official bittorrent client (it'd also give you a good excuse to talk about networking if you feel like it).
Also, try to take something the students already know how to do and show how they are following an algorithm; make them implement the algorithm. Math should be rich with examples (gaussian elimination, computing derivatives or simplifying expressions), but the examples may also be a bit on the boring side.
.. like pascal!
WAIT WAIT.. this isn't a troll!!
I`m dead serious. Starting with a language like Java or C++ or *.NET or anything where the programmer can make something interesting means they will focus on the end product and not the code.
Give them a language like pascal, and restrict them to cli apps.. and they won`t spend their time trying to make their app do something cool.. but instead focus on making the code look neat.
Structure and Interpretation of Computer Programs. The title says it all.
I can't really tell you how to teach this course, but I can suggest that you find some sort of underlying idea around which you will structure the course. For example: it sounds like you are trying to make a course that could just as well be called "Introduction to Computer Programming for the MySpace Generation." What does this mean? Well, according to my philosophy:
With respect to students, it could mean that you are dealing with students with zero programming knowledge and zero programming interest. They were just told that they had to be there if they wanted a well paying career in software engineering (or whatever). This will very much affect their attitudes towards the course. It may mean that you have to pull up MySpace on the first day and ask questions like, "how does this work," just so that they have a motivation hook. It may also serve as the motivational hook for your entire course.
On a technical front, it could mean that this is a course about client/server programming. How do you get computers to talk with each other so that people can talk to each other? This means that you will probably have to make a mini-MySpace, because you can only really see client side stuff otherwise. You may want to show them the multitude of languages involved here: HTML, CSS, and JavaScript on the client side. Maybe you'll have PHP and SQL on the server side. Going deep into algorithms at this point, or even properly structured programming or things like psuedo code, is probably a bad idea. After all, you aren't dealing with teaching a single language here. It is more like teaching about complex systems that are tied together by a lot of programming glue. Doing things the right way can enter the picture once they understand what that involves.
(For those hard-core programmers who think that theory leads to solid programming skills: how many of you started out with theory, and how many of you started out by trying random things on your computer? Without worrying about all of the principles of software engineering. I'm willing to bet that the latter is going to be more typical.)
Try to consider the social angle too. A lot of students really don't know why they are there. If they do know why they are there, they may not fully understand the process that leads them towards achieving their goals. Anything that you can do to help them understand that, without dumbing down the course, will ultimately make everyone happy. You'll be happier because you'll have a bunch of happier students who aren't approaching you to bitch and moan about grades. The students will be happier, and even take more responsibility (1), because they see where this is leading towards.
(1) This is unbelievably true. I've done courses where student attitudes flipped 180 degrees just because they could see where things were leading.
I think a great way to teach basic fundamental programming concepts is using C#(very easy to learn), pretty intuitive. They have great books on it. My personal favorite is the ones written by Dietel and Dietel and also WROX. I would teach the students, basic I/O, Classes, Objects(because programming is turning into more Object Oriented than anything), Operators and Loops to start off. Then you can move onto Structs, Arrays, Stacks, Polymorphism, Trees etc....those are more advanced. The gentleman S3D stating teach them ASM is wrong in my opinion. ASM will confuse more than teach. That is the reason for High Level Programming languages..which look more like English. In summary. Teach C#, Great books are by Dietel and Dietel and WROX. Teach them, Basic I/O, Operators, Loops, Classes and Objects. Sundeep
I started by learning the PRINT, GOTO, LET, and FOR/NEXT commands, and learned to number lines by tens, so extra lines could be added later.
Oh, wait. "Basic" programming, not "BASIC" programming. Got it.
I would vote for (standard, nonproprietary) C or C++, since once you know that, it's a lot easier to figure out other modern languages (Java etc).
I would put off introducing pointers until they have a very good grasp of using standard variables and variable arrays, though. Then you might explain what a pointer is (using diagrams or animations), and walk them through a simple example.)
If they're not going to become programmers, FreeBASIC is a lot of fun, very easy to use, and can handle modern language structure (functions/subroutines, WHILE statements instead of GOTOs, etc.)
Paleotechnologist and connoisseur of pretty shiny things.
Go on - have a look: "Alice is an innovative 3D programming environment that makes it easy to create an animation for telling a story, playing an interactive game, or a video to share on the web. Alice is a teaching tool for introductory computing. It uses 3D graphics and a drag-and-drop interface to facilitate a more engaging, less frustrating first programming experience"
The only language you can teach to someone who doesn't know how to browse the web is LOGO, and even then... it's a stretch
It teaches people you can program, it does not teach them how to do so. No best practices, no structured/object oriented/functional programming...
On the other hand even if you teach a programming course, pick a language. Just because you know more than one way to do something doesn't mean showing them alternate paths is a good way to get your feet wet. Picking the best language for a job is an intermediate-level programming task.
Gerald Sussman and Harold Abelson's MIT course "The Structure and Interpretation of Computer Programs" is the best beginner's course I've ever seen anywhere. It starts at the beginning and ends up with advanced subjects like closures, and functional composition, building every concept in small pieces with clear examples. Plus the material is freely available, and there's video of Sussman giving the course to a bunch of hilariously dressed HP engineers in the eighties some time.
One thing that really irks me as a student is the teacher assuming we know nothing about a particular subject - and explains things in a very abstract round-about manner that only half makes sense when they pull the punch line and tell you what they're trying to explain last.
Concept first - explanation later.
For instance..
Imagine all the streets in your city. There's only so many streets for so many cars. What would happen if all the cars decided they wanted to drive at the same time? Would we have to build new roads to accomodate for the increase in traffic? This is like bandwidth.
Bandwidth is the total 'area' data has to move within a network. This is like.. (street analogy above).
I'm aware my defintions are wrong, I used this on my dad as a basic concept. Give them the idea to apply the reasoning too first - or the reasoning is lost with nothing to apply it to.
As for very basics - I'd suggest upfront, warning the students the first X lessons are for beginners, covering variables, operators, functions etc. Let the students with half a clue come back when they're ready to LEARN something they didn't already know.
If you think you're going to work all that into an introductory programming course, you're nuts. First teach them to use a programmable calculator. Then introduce them to the (Ugh!) BASIC computer language. That's probably about all the time you'll have, but if at all possible try to teach them the C language. That should serve as a good foundation to branch off into the other areas you mentioned for the more advanced courses.
If on the other hand, your job is to teach them to use computers instead of programming computers, by all means concentrate on applications - both native and web apps.
9/11 Eyewitnesses to Explosive WTC Demolition 1 of 2
There are probably a few kids who'll be able to follow programming arcana, although the vast majority won't or can't. So hit them where they live, by introducing meme-level applications. Teach Gimp amd game-building to artists, and Firefox and Open Office to everyone else. The notion of "what computers do" really has simplified in the last decade, to the point where we can talk about Jonathon Swift and not about Bigendian vs. Littlendian manias. "Top down" has now been around so long, the "down" part actually works so well it no longer needs to be taught.
That said, I've met professional programmers who don't understand such elementary concepts as page-based addressing or stacks. These deficiencies lead to bizarre programming practices and difficult bugs, such as creating local variables so large they overwrite return addresses. I'd recommend a short course in 6502 or Z80 assembler, but only because those Trilobite concepts were my base. Follow that with a thorough-going grounding in C (not C++ or C#), followed by an introduction to actual open source libraries such as gzip. That gets you to the point where it's almost possible to understand how Microsoft distributes functionality at a level of granularity so fine it actually does make sense (from their point of view) to integrate a browser into the OS.
``Tension, apprehension & dissension have begun!'' - Duffy Wyg&, in Alfred Bester's _The Demolished Man_
Lesson 1:
10 REM Welcome to basic
20 print "Hello world!"
30 REM print it again
40 GOTO 20
50 REM Can't believe no one made this obvious joke yet.
The final project should be a video game.
Announce it the first day.
They control the content within reason.
Nothing fancy just a simple web game would do.
Many of the kids in the class are probably thinking in that direction and it's not that hard.
The rest of the course could build into the goal.
Skip the history it bores most kids.
Do a hello world the first day so they have a concrete result.
Then back track to teach them object oriented basics.
Remember that? A language for teaching programming with easy to see results (a turtle which moved).
No sig today...
Like others have mentioned, without knowing the age range and dictated goal, it's tough to give really great advice, so I'll tell you about two of the mini-classes I've given.
The first was a weekend "computer camp" for a small group of kids aged ten to sixteen. In a few days, we covered:
The second was a 1.5 hour web development basics course for high school aged girls. While introducing myself, I noticed the girls' interest was piqued when I showed a screenshot of my myspace page. I naturally didn't change my presentation, however, I discussed every topic in the context of "hacking your myspace page." For that class, I covered the basics of HTML hand-coding, CSS, cut-n-paste javascript (see "gateway drug" comment above), and a few basic design concepts (e.g., blue text on black background is unreadable, choosing background textures for text readability, etc.). I short-cutted the process by providing each girl with cheatsheets (HTML, CSS, color names, etc.) tailored for the class and a USB drive containing examples, images, javascripts, etc.
Among my standard bag of tricks (no matter what subject I'm presenting) are:
1st class have them write instructions on how to make a peanut butter and jelly sandwich.
Then follow the instructions. None of them will get it entirely correct. Ie. Put knife in jar, but not open jar first.
Fight Spammers!
Take an extra effort to clarify the language that you are using. A beginner will have a difficult time differentiating between the mandatory syntax and the other things that are done by convention. This goes for all sorts of programming and even basic computer instruction. Use funny or ridiculous variable names and such so that they can't be confused with the other words or statements that are real. Even basic stuff like the word 'integer' can throw people off if they don't have a good math background, so make sure that everyone grasps the vocabulary you are using. If they only miss one word in a sentence, then they've missed the entire point, right?
I have seen far too many programmers that start with say VB or Java and don't get the basics down first. Have them loop though an array or matrix, show them an array, structure, pointers, and control structures. You know basic stuff. OOP, webapps belong in a more advanced class.
Teaching youngsters is a lot easier if they can see good results within one or two days. Any tiny program that they could write and actually see function within two or three class days might get them hooked on learning more.
Also kids like to compete. It raises interest in those that are reachable. Having a bit of a contest as to which kids program runs best may help inspire them.
use the robot making PB&J sandwiches.
Have the students team up and write an algorithm for a robot to make PB&J sandwiches.
next class, one of the students in the class act out the instruction with the bread, plastic knife or spoon, peanut butter, and jelly.
Obviously, don't let students who are allergic to peanuts do this!!!!!!!!
The exercise gives students an understanding of how algorithms are formed and the importance of each step.
Your response when they skip a step is, "HOW?"
My c++ instructor in college taught us all programming before he taught us c++. He used this method. It works for most.
They're using their grammar skills there.
Take a look at AutoIT3 (http://www.autoitscript.com/autoit3/). Yes, it's a form of Basic, not transferable anywhere else, closed source, but it allows the person learning to program a means to create useful program within just a few minutes. There is great community support with code snippets and DLLs available to do many things. It includes SQLite (a lite SQL) that can be used to teach database concepts also. It's a great way to get started quickly and easy to learn.
Start with machine language. Then assembly language. Make them use punched cards. Hey, that's how I learned it.
Teach them Jonesforth. They will be indebted to you for life.
http://www.austincc.edu/baldwin/
Demonstrating interface is tricky especially as the particulars change. Maybe as the students think about how to stop a bicycle and a car?
As to algorithm and execution, get a cook book page and show how a recipe relates to a program. How the instructions declare the variables and provide the algorithm. (How the recipe consists of steps in an interpreted language in that when it says "caramelize the onions" the experienced chef knows what to physically do.) How the kitchen is the computer; the chef is the I/O bus; the range, oven and mixers are processors; the mixing bowls and counters are RAM; and the refrigerator and pantry are persisted memory while the grocery is costly slow memory. If the receipe said a tablespoon of salt when it meant teaspoon, that would be a type of programing bug. It wouldn't hurt, at that point, to mention Dr. Knuth who provided us with the algorithm = recipe connection.
Part of your considerations must of course be what language you teach your course in. Contrary to popular opinion, I claim that Java is a bad choice for several reasons. First, Java is complex. Just getting a program to run requires extensive knowledge of paths and the underlying environment. This takes away from the learning experience. Second, Java can be likened to a box of complex and powerful parts. The problem is that students come to rely upon those parts but fail to learn how they work. Finally, Java constrains one's creativity to one particular mode of thought: the Java object model. This prevents the kind of cleverness and creativity that we need in good programmers.
So then, what language to use? I propose a form of assembly. Perhaps MIPS, for which a number of good simulators, like SPIM, exist. You could also use x86 assembly via GAS, which is the GCC assembler. It is very easy to prepare an assembly file that way, so you can get a program running easily. Also, you can start with the extreme basics by only using registers at first, then graduating to memory. The best partvis that students will naturally learn about the underlying hardware at the same time. Later in the course, you can introduce them to C as a form of generalized assembler, for which purpose it was first intended. Then the students will better appreciate the power and flexibility that C grants. By the end of the course, your students will have a good grasp of exactly what their machine is doing with their program.
Very basic, annoying, somewhat buggy... But a decent start. Teaches some good basics.
I teach a year long CS/Programming class for a charter high school in Duluth, MN. The class takes kids (half of them girls) from no experience to c++ in a year. I start with freeBasic and move to gcc (we're a k12LTSP environment). While freeBasic is ... well, er basic, it actually has evolved over the years to be pretty robust. Also, the community surrounding it is super responsive to my kids questions...sometimes the language maintainers even answer questions posted in the forums during the same class period as they were asked. Becoming part of a developer community is as important and learning the details of a language. Asking (and answering) good questions and taking advantage of resources is a valuable life long CS skill. Also, there is great support for SDL and even the irrlich 3D engine to get kids doing game programming and graphics right away...always a good motivator.
First order of business, install a programming language. If they have trouble, use this: http://www.richarddooling.com/index.php/2006/03/14/python-on-xp-7-minutes-to-hello-world/ Works for most n00bs who are stuck on Windows for whatever reason.
ask students what they want to learn/ and what they know. many classes begin with initial aptitudes and that may just save you weeks or months, rather than assuming everyones a noob, you may find yourself having a 90% ratio of pc literate to noobie.
happy trials
If you want to appeal to a broader audience including women and minorities you have to be able to deal with the current perception (e.g., of middle school kids) that computer science is hard and boring. This is a deadly combination. You need to be able to show in a very short amount of time that they can use USE computer science to build something that they care about such as a video game.
Offering easy to use drag and drop programming is one approach that can help because it can overcome pesky syntactic issues. Having produced one of the first drag and drop programming environments for kids, AgentSheets, we know a thing or two about this topic. To be able to overcome syntactic problems is important but it is even more important that you can provide some way for the them to think about computation in a way that helps them to solve problems and to tackle challenging programming challenges (game, computational science) by themselves. To that end, you need to be able to convey a process of design/development including programming and debugging to build complete games.
Some people mention (above) some easy to use programming environments for kids. Please ask yourself: easy to build what? Yes, having having some characters moving on the screen can be entertaining for some time but then what? Can you teach the students even to make some of the classic 1980 arcade games (e.g., Pacman, Frogger)? If not, why not? And if you can, can you move on to SimCity, the Sims kinds of games? Too ambitious? We do not think so. If you give students tools and approaches that cannot deliver then their excitement will quickly be removed with a new, even more profound, kind of frustration. We are teaching middle school, yes middle school, students how to build their own Sims-like games programming sophisticated AI. They learn about math because they NEED math to make the game do what they want it to do. And these are the same kinds that supposedly are bad or not interested in math.
Now for a shameless plug. We are working on a notion called Scable Game Design. We use the notion of design to teach students not just how to use programming environment X but how to think about the design process. This does not take more time but ultimately really gets them into computer science. In the very first session student can build a complete 1980 arcade style game while learning about stacks, methods etc. Moreover, this is not just kid stuff. We use the same idea at the university level:
Repenning, A. and Ioannidou, Broadening Participation through Scalable Game Design, ACM Special Interest Group on Computer Science Education Conference, (SIGCSE 2008), (Portland, Oregon USA), ACM Press. http://www.cs.colorado.edu/~ralex/papers/PDF/ScalabeDesign_SIGCSE2008.pdf
and then progress to scripting. Then, and only then, consider a graphical development environment.
As well, consider teaching the development of practical, open and community based code.
Please.
More than 20 years ago, my "basic programming" course wanted to teach us "top down" programming. Break the top level thing from the assignment into smaller pieces until you more or less have chunks that fit into one line in your programming language.
This fails horribly if you're learning that programming language.
A friend wanted me to do his assignments. I refused, but offered to help him do his assignments.... So repeatedly saying: "and how do you break that into smaller pieces" resulted in him trying to parse floating point numbers....
So.... I would suggest: First give some assignments that end up building on the previous assignment. i.e. bottom up. Build something more complex after having built some basic building blocks. THEN introduce top down design, and if at all possible, have the building blocks from previous assingments fit in!
Check out "How to Design Programs". You can view/use the entire text for free online. www.htdp.org.
I teach undergraduate CS and it's where we begin. It focuses on good design principles and how to put a well thought out program together. The frustration I often encountered, and that led me to choosing this curriculum, is students focusing on getting code written without actually understanding on what the code was supposed to do. HtDP uses a version of Scheme combined with the Dr.Scheme programming environment (www.plt-scheme.org).
It is most definitely worth your time to check it out. Additionally, the plt-scheme group offers summer workshops on teaching with this approach.
Research and experience seem to demonstrate that practicing concepts and theory in a simple, fun language are much more enticing and approachable than getting thrown into the deep end with OOP from the beginning. Programs that do this well are Scratch, Alice, Scheme, and Context Free/Algorithm art. All have some aspect of drawing, image manipulation, and animation to them, which can be appealing to a first-time programmer. Alice (www.alice.org) and Scratch (scratch.mit.edu) are simple, and can be used from middle school and up. Scheme is somewhat more advanced, and has it's own formal online textbook (www.teach-scheme.org). A colleague is using it right now with his Intro to Programming Course, and students are showing significant progress. Context free is very light Java, and fun (www.contextfreeart.org, and azarask.in/projects/algorithm-ink). Having attended seminars for Scheme and Alice, I can tell you that they have terrific support communities backing them up. I'm sure that there are others out there too, but this ought to give you a running start.
There's an old teaching kit, previously available from Bell I think, that taught how a computer's CPU worked: CARDIAC. It was NOT a computer program, but rather just used cardboard props and the like. The "operator" was responsible for writing the instructions, then processing the results.
You don't really need the teaching kit, you just need to keep it simple. 100 memory cells, decimal storage instead of binary, only the program counter plus one register. It not only teaches the basics of programming, but teaches at some level that computers are deterministic. This is the one thing people really need to know before they start using them.
http://www.teach-scheme.org/
Because using Scheme and their teaching methodology will allow you to teach students more stuff that is actually important and have them learn it better and faster. There are a couple of FAQs http://www.teach-scheme.org/Notes/ there that explain why it's a good idea.
x = x + 1
x/x = (x+1)/x
1 = x/x + 1/x
1 = 1 + 1/x
0/1 = 1/x
0*x = 1
x = 1/0 = infinity.
Whatever you do, make sure you go and listen to (at least) the first few lectures from this course: http://see.stanford.edu/SEE/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111
I've been listening to them for the past couple of weeks, in addition to taking a course at my university in C++. My professor here is a very poor teacher (he's said that Bill Gates invented shared libraries and that all programming languages are object-oriented). But listening to the Stanford course has helped me tremendously.
in HS, i had a great CS teacher. her knowledge was admittedly limited, but she spent much of our time on concepts, and was open to us exploring outside the scope of our class-work. starting a month or two in, many of my programs that i turned in included code and concepts outside the scope of the class, or ahead of schedule (though they met the requirements, and utilized the recently learned material).
with that said, we spent much of the first few weeks writing pseudo-code, which helped many of the intelligent, but non-technical, non-analytical types in the classroom grasp the material. this helped them break all of the tasks down into small tasks, and see clearly what they wanted the computer to do.
and, with that said, i started with c++ (very nice) for a few years, took a couple week foray into java (yuck), and ended up teaching myself perl (hooray). i would highly recommend going with something like c/c++, or perl. perl is everywhere, and is an easy transition into "hey, you know all those dynamic web-pages out there, that do all that cool stuff...." while staying reasonably OO. c/c++, in many ways, is the model that other OO languages are based off of. you can't go wrong with them.
and, finally, with all that said, i believe the pseudo-code may be the most important thing. teach people how to think differently. start easy, introduce basic concepts, like input and output. basic math, and variable assignment. don't worry too much about making sure they know *how* it's done, just that it is and can be done. after a couple of weeks, the how and why to x=x+1 should make a lot of sense to the majority of the class. cout and cin and printf and echo and print and STDIN and variable[] and all of these things will come a lot easier.
hope this helps. (all of this assumes an intro-level course)
not only is time travel possible, it's irrelevant.
Start at the beginning, and when you come to the end, stop.
Here in California, Dave Bricetti teaches a class for children at Diablo Valley Community College; one of the preeminent schools of its type.
supporting member of the R foundation
A major goal of yours should be sparking interest and a desire to learn more from each class the students attend. A good way to do this is to have each class give the students something they can walk away with and use immediately in a manner they appreciate.
For example: class one could cover the basis of what a web page is, and how the html, css and so on make the page. Don't go into detail, just hit the high lights of each, compartmentalizing the web page elements and their respective purpose. Don't say how they are constructed, only describe what they are used for - html=content, css=layout, php=logic and so on. Then give them one example of editing a MySpace page, showing something simple for students seeing this for the first time, and something advanced for the students that already use MySpace Editors for their own pages.
Class one, you give them a mental picture of a web page and then show them how to modify a MySpace page. That should get many students' attention. In the following classes, touch upon each area a bit, exploring your student's interest and letting the class explore. They may go into Flash games or widget development, it's hard to say. But in each case, it's not to hard to take baby steps into a complex area. Remember, you're not making CS graduates here, you're giving a class of students a "guided interactive tour" with the goal of sparking their interest and creativity to learn more.
1. CPU + CACHE + RAM + HD + Network
2. Fetch Decode Execute (THIS IS NOT THE ONLY SOLUTION, CHILDREN! We just happened to pour trillions of dollars into this)
3. Assembly language
4. C. Spend lots of time on C. LOTS.
5. Step 4 will probably take the rest of the semester or quarter to go through... But teach it well, and they'll go far!
Absolutely the best teaching tool is BlueJ (from bluej.org). It's got a great textbook and is used is thousands of schools all over the world. The kids love it. A related tool that's wonderful can be found at greenfoot.org: teaching kids to program by writing behaviors for video games. Alice.org has another great one.
This is a fairly easy task.
Find a child, new person to technology, or old person who does not have experience with technology.
Try to teach them the basics assuming a fixed level of knowledge. Let them know to ask any questions that may be confusing.
Record the conversations, and later IM's if you bring up their tech level enough.
Then you have the material and can arrange it based off of what may need to be added as background knowledge.
Repeat with more people as necessary, or just teach the course at that level, and learn from your class more on what to teach and the level for the next time.
Take lots of notes, as technology always changes and do notice you will have to be adaptive. You may want to offer an advanced after school club for the students that go beyond the knowledge required to help them out.
It may be a good idea to also provide a sample test to assess the general classes knowledge and group students with similar starting points together.
Have each group work on different levels of labs and tests and learning events. You can teach a general overview to everyone and then specialize at different levels to the students in these groups. This way you will ensure you cover the basics with everyone and have general questions that can be shared on tests/quizzes.
If you do not try to accommodate different levels, some students will be bored, become class clowns, challenge the hell out of you, or just do poorly because it is considered mundane to them.
You may be surprised, some students may even surpass your level of knowledge and experience. Do not underestimate them all the students, but also do not overestimate them.
The students that know a lot, can still get proper training or another way to look at things or a new easier/better/worse concept that they did not know before.
Also try to have different learning style trainings so they can choose which method is best for them to learn. (Seeing,Doing, Hearing)(Reading, Watching, Participating, Listening)
Do not try to do each student individually too much and do not try to teach only them all at the same time too much. You probably will not survive.
Good luck to you.
Start with logical thinking... Don't root yourself in any particular language.. Teach algorithms in a step by step manner.. Also give a good intro on what programming is good for... i.e. the applications in real life.. show where the value is for the student to learn programming..
It's not too long since I had an intro programming course (although I was already an experienced programmer). Assuming your school does not have an unusually high percentage of students who are talented at abstract thinking and/or experienced in writing code... keep it very, very basic. So basic as to seem almost useless.
I found my class completely trivial - we never wrote a program more than a few lines. The LAST topic we covered was how to write a function. We never wrote a class, even though we were using an "OO language." And yet many or most students struggled quite a bit. I later talked to a different professor who sometimes taught that course. She said when she was first given the syllabus for the course, she thought it was extremely simplistic and that she could cover that material in a week. Then she discovered how hard it was to convey even the simplest abstract concepts to most students, and that it was a challenge to get through all the required material in a semester.
Students allowed into a beginning programming course should not be allowed to register unless they already know their way around a computer/internet. If need be, prerequisites should be offered. For a beginning programming course, teach problem solving. Computing languages are tools; anyone programming should have the knowledge to choose the most appropriate language for use in a given situation. Make the course fun! For the first half of the term, choose a problem and divide the class into teams to solve the problems. For the second half, switch solutions between the teams and have them improve the work you gave them. The reasoning behind this is simple. Working in a team is a good way to cross-pollinate knowledge and is how it generally done in the industry. Having to take over someone else's code is a lession best learned early in life.
Maybe now that you are in teaching, maybe you should have a look how others do it, here is an example:
http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
I've been watching these for a while now, I liked them (although to much beginner for me, it's a nice way to get to know a 'new' language).
New things are always on the horizon
Supply them the tools. For example, "This is a print statement, it does..." then give them a problem to solve using the tool(s) you just gave them.
Of course, you can probably offer more than one or two at a time.
"Dear Slashdot: please do my homework for me."
FROM A PROFF!
I've taught intro CS at Stanford, and the key is to leverage programming projects as you go. Just talking about CS without doing it is ridiculous ... fun programming projects that are scaled to challenge the students at the level of what they know can work really well, emphasizing the key aspects of CS while engaging the students.
This site gathers great assignments for use by instructors or whatever:
http://nifty.stanford.edu/
This site has live little programming problems that work in the browser
http://javabat.com/
Slashdot smarties challenge: heres's a tiny programming problem
http://javabat.com/prob?id=Logic.makeBricks
See if you can type in a solution which passes the tests the first time -- harder than it looks!
Without that I wouldn't be the programmer that I am today. Here's the README:
The C script is not complete; use at your own risk.
Lessons are in
Source is in
Miscellaneous supporting code is also in source.
Make a learn by
make
When this seems right, extract the lessons by
make lessons
This extracts the lesson archives
for each course. You can also do this one step at a
time with "make files", "make editor", etc.,
if you don't want all courses.
If you do things separately, you must also say
make play; make log
Finally, check that it's sensible with
make check
If that doesn't print any messages,
you're probably in good shape.
Learn requires general write permission on the user playpen .../lib/play. Lesson directories may be protected.
directory
Learn collects a log file for each script in the .../lib/log
directory, with a file for each script (files,
editor, etc.) containing an entry for each lesson
attempted. These files will grow without bound,
unless they are periodically truncated.
The log files should have general write permission.
If you don't want logging (a sensible position to take),
set the variable "logging" to zero in source/lrndef
before making learn.
Learn requires about 1500 blocks to make itself,
and about 1000 when completely made.
Please report problems, bad lessons, etc., to
Brian Kernighan, MH 6021, 2C-518, or
Mike Lesk, MH 6377, 2C-572. Thanks.
I myself have only done introductory programming-language work. I did this as an independent study during my senior year of HS, admittedly a different structure of learning than what you're trying to do. (Also, I came in with solid knowledge of basic computer topics) * One language only. [Differences between languages probably aren't what you want to get bogged down in.] * We used Python. (I feel it worked well as a beginner language: like-English syntax didn't hurt) Also, using a real language that fits the bill seems to be more useful than using a teaching-only "baby" language. [Students could continue using it successfully if they wish, and would help them learn other production-use languages] Granted, other languages might also have these features, but: Python *is* cross-platform. Code, especially the relatively basic code you'll be working with, should run on whatever computers you and your students have access to. The IDE included in the Python package (IDLE) allows you to execute code in a controlled environment, so you don't have to get into compiling yet. * Start with basic assignments and move on up. With each assignment layer, work in a few more features. (Assignment 1 needs only print statements, Assignment 2 adds a need for prompts and loops, etc.) * Assignment: "Accomplish X". Then explain you how one might go about doing X. [Once you get a little farther on, don' t give the hints quite so quickly.] If different students take different approaches to X, use the differences as a teaching tool. * Later and final projects: the student chooses the topic of their work, and/or the program which applies concept Y. * Throughout the class, weave in commentary about general good program-design principles
I listen to both RIAA and non-RIAA stuff if I like the music, tangential business/politics nonwithstanding.
From my personal experiences with taking programming courses, there's one major area that most teachers seem to neglect: program design.
You can teach your students how to do any number of sorting algorithms, implement data structures, etc, but if they don't know how to design a solution to the problem at hand, they're going to struggle with it.
I know quite a few people who are presented with a problem and the first thing they do is sit down in front of a computer and start hacking away at the code. This may be fine for simpler programs where there is only a few minor tasks to complete, but as programs get more and more complex, it will cause problems if they don't learn proper design.
When you explain functions, make sure you explain why we use functions, and not just how. This will be a nice precursor to the concepts of OOP (i.e. break the program down into logical sections) and should make explaining the semantics of OOP a bit easier to comprehend when the time comes.
OOP was something that was briefly gone over in my high school programming courses, but it was basically along the lines of "Here's how you make your own class and instantiate it". I had no idea what purpose it served or when to ever use it, so I always just used functions and nothing else. It's only now, a year before I'm about to graduate college that I fully grasp the importance of object oriented design and program design in general.
I would have been in a much better position if these were concepts I learned from the start (possibly even before ANY code).
Side note: I have no experience with teaching programming concepts besides helping a few friends occasionally. This big rant was just what I've seen in my personal experience and what I think could have been done to make things a bit easier to comprehend.
Good luck! Don't teach them too much. I don't want to have to worry about job security before I even get one. :)
How about using a Commodore 64 emulator? If you're only trying to teach the basics of programming, using this will provide an easy way to get students to see the core concepts. Since the C64 had a built-in interpreter for a language, it gives them very fast access to a means to write code. While I don't recommend BASIC 2.0 as a language to really learn, it will still teach them constructs that can be used in any language.
What's more, these emulators are free so they could easily download and install them at home to do homework assignments. You could teach them how to transport a .d64 file from school to home to continue work on existing assignments. When they want to turn in their programs, they give you a .d64 file. Even more than that, there is a large code base out there these students could use as learning tools and examples. There are also abundant resources available as programming reference material for this platform.
Get to the class about 30 minutes early and watch as the students try to turn on the computers. If most of them push the monitor power and wonder why the computer is not on, then you know how basic you have to get.
Which basically means show them how to automate all the crap they have to do by hand right now. I like this post. I've been thinking about teaching a programming course myself.
I teach at a major university (Not CS) and I've found enormous success by rethinking problems and recasting solutions in light of what the students will actually use, versus following the formulas put down many years ago by other professors, solving different problems for completely different groups of people.
I remember my intro course in CS was this long, drawn out affair in C++ that had us programming basic concepts and games. And the professor used a lot of the tricks I've seen posted (the PB&J example particularly sticks in my mind) and all that, but it was all a waste. Not because the Prof wasn't good, he was, but because he completely missed the point of what his students were going to use programming for.
FACT: The vast majority of students weren't there to become systems developers or even prof programmers. They were there for the credit hours, or out of mild curiosity or something.
Now, what do you think they got out of pointers and bubble sorts and binary searches, and even the pong game we programmed. NOTHING. That's what.
The class was fine, but conceptually flawed. I liked it and aced it, but then, I wanted the details; most of my classmates were bored stiff and treated the whole exercise like a bad dream that they just needed to endure and then delete because it was worthless to them. Intro CS is a language course for non-experts, many of whom don't want to become experts. Treat it like one, and remember what your students will be using the computer for: typing papers, playing on the internet, managing spreadsheets, etc...
Office stuff.
Imagine if Intro English classes only taught people how to write poetry instead of basic reading, writing, and punctuation. That's where you are. And if you've ever seen some taught that way, you probably know what I mean.
Make your class solve the problems YOUR STUDENTS will most likely face and they'll love you and actually benefit. Focus instead on quicksorts and OO, and you can rest assured that your efforts will be 95% wasted. Which means, I'm sorry to say, that Java is not the right answer. A previous poster said it best, Java is a programmers programming language. It aims to solve problems that only come up for big projects.
These people need data scripting.
And finally, make sure the language has a good, IDE with a Read-Evaluate-Print-Loop cycle, which basically narrows your field down to three:
Python
Ruby
Dr. Scheme.
Be honest. Break rules. As crazy as it sounds against the CS orthodoxy, they'll get a whole lot more from regular expressions and functional programming than Object Oriented Programming and algorithms.
Good luck.
I am in a similar situation and have found an interesting program, "How to Design Programs". Check out www.htdp.org. Its an intriguing approach. At the moment, I am planning on giving this curriculum a try and will then transition to "How to Design Class Heirarchies" in the next level course which bridges to Java and targets the AP Comp Sci tests.
The best programming course I've had (a long, long time ago) was 6.001 at MIT. One of the things that made it successful was that they didn't focus on the language (Scheme); they focused instead on the underlying programming concepts.
In order to make this work, you have to use an interpreted language (such as Python, which is trivial to learn and translates well into most other common languages) for assignments and projects. This allows students to try different ways of doing things without getting too hung up on syntax, and helps them focus on what they're trying to do instead of how to use the language.
I teach CS at the undergraduate level and we've recently adopted the "How to Design Programs" approach. www.htdp.org. The book is available in its entirety online.
I personally love this curriculum because it focuses on problem and data analysis and not language syntax. It uses plt-scheme (www.plt-scheme.org) and the Dr.Scheme environment. The "Design Recipes" really outline good data-driven design as well as provide a rubric for awarding credit for all parts of the programming process, not just code.
I highly recommend HtDP to anyone, not just educators, especially if you've never really dug into Functional Programming.
I've taught introductory programming several times. I never thought that my goal was to teach a skill, or an abstract concept, or logical thinking. My goal was to convince the students that programming is fun and easier than they thought. If I succeeded, my students would run out of the class saying I CAN DO IT!
To capture their imaginations, I used Visual Basic. I taught them how to draw a ball on the screen, how to make it move, how to bounce it off the wall, and finally how to turn it in to a kind of Pong game. I can take a group of random people off the street, and teach them to make their own Pong in about 3 hours.
Graphics and motion are much more emotionally appealing than any kind of abstract logic. It also presents them with the opportunity to analyze symptoms to debug their own programs. They are better able to grasp the relationship between incorrect behavior and incorrect programming when the subject is graphics and motion.
Something fun like Pong, also teaches the students that programming is a means to an end, not the end itself. The interesting part is clearly what happens with the ball, not what the source code looks like. Later in more advanced courses, a subset of the students might become entranced with programming as an intellectual end, and go on to become software professionals. Good for them.
For those who never do become professionals, they at least grasp that,given a lot of work and common sense, one can create source code that shapes and steers behaviors in the run time. Never again will they think of software as some kind of incomprehensible black magic.
Let's face it, most programming languages suck from the point of view of teaching. Python's pretty cool, but the syntax has lots of special cases and many, many weird (but useful) language features, all of which are confusing. Ruby ditto. Java is useful but unspeakably complex. C++ is even more useful and even more unspeakable. C requires you to be anally retentive. Basic is a crime. etc, etc. If you pick any of these, you end up having to teach the language, rather than teaching the abstract concepts that underly the language.
My university got round this by designing their own custom language, S-Algol, and all the algorithms courses were done in it. Of course, it didn't help that it was a weird, half-implemented language (a garbage collected language with no actual garbage collector!) with lousy error detection (anyone who knows it will remember, and shudder at, the phrase 'void and void are not compatible in this context') and a half-assed IDE (the only editor I've ever seen where you had to move the cursor with the mouse. Yes, the arrow keys didn't work).
If you want an existing language that's powerful enough to teach proper algorithms and yet simple enough for novices, you could do a lot worse than Logo. Yes, yes, stop laughing. But underneath the cute turtle interface it's surprisingly powerful and rather deep: it's best described as a stealth Lisp.
Logo's biggest problem is that when it was introduced and heralded as the best thing since sliced strings, most affordable computers weren't powerful enough to actually run it; I remember Acornsoft Logo on the BBC Micro, running a Prolog-alike rules database, where a simple query took several minutes. Since the only thing that would reasonably run on a Logo on one of these machines were toys, Logo itself became known as a toy.
But if you have another look at it today, you might be impressed. Okay, the syntax is a bit weird in places --- particularly when it comes to local variables --- and there's no object oriented system (although it's pretty much trivial to write one), but it's pretty much ideal for teaching basic concepts such as conditionals, iteration, abstraction, data structures, etc. And that bloody turtle gives instant gratification, making simple programs considerably more interesting than they would be in, say, Python.
These days, you still won't find a better introduction to the utter basics of what computer programming's all about than the hoary old Logo tutorial. You know: "Let's move the turtle around! Let's draw a square! Let's make a procedure that draws a square! Let's draw several squares! Let's change the procedure to draw different sized squares!" That one.
... that I rather like, and would use if I were in your position. link.
Give them assignments with vague instructions
Lecture them into boredom
Give them pointless projects
Make sure they know that the real world is not relevant
Give the newbs no hope of ever understanding a damn thing that comes out of your mouth
Make a good effort not to be available outside of class hours
Success
Please don't teach them PHP, it's as harmful now as BASIC was 20+ years ago.
-- Tom Rathborne
1) Teach security concepts first and emphasis them thruout (ie. strong passwords, deny all/allow specific, look at data from the outside extra closely)
Having taken and taught professional courses, I believe they can be applied to K-12:
2) After your 'Hello World' program, don't make them write everything from scratch. Create a skeleton and write comments in the sections the concepts are to be applied.
3) Build each lesson on the previous so they can see the value of using variables and modular code.
4) Having been a volunteer teacher for a HS course here is a warning: Brace yourself for assigning grades. Come up with a plan and let them know how you will be grading them. Then stick to it.
5) Be enthusiastic, they are not all going to enjoy the class, and no one will enjoy it all the time. But if you are into the subject matter, they will be more likely to pick up on it.
Good luck.
Later . . . Jim
Whatever you do, don't teach them a useless language just because "it helps them learn".
http://learn-cs.pbwiki.com/
A lot of legwork already done for you, just give Mr. Weekly credit!
Ian
The University of Washington has popular introductory CS / programming courses. The teachers wrote the textbook and the classes have really good handouts and slides. They use an "objects later" approach instead of "objects early" like a lot of universities. All their materials are up and others can use them. The web sites are here (CS 142) and here (CS 143). The book is called Building Java Programs.
One of their instructors also teaches a web programming course that was really popular.
I'd also check out the "How to Think Like A Computer Scientist" series.
Check the excellent stuff available from universities like CS106A at Stanford by lecturer Mehran "evil Spock" Sahami, it introduces Java (without naming it and hiding the language specific stuff at first) but the aim is to teach general concepts of programming, using java.
It uses a framework called Karel the robot at first to even hide java.
Then it uses ACM libraries to hide some of java ugliness (like application set up).
And the lecturer is funny (well not always but that's ok).
I'm 36, but I'm a complete noob when it comes to programming.
I did some messing around with Commodore BASIC, RS BASIC, and Pascal as a kid but never became proficient.
So when deciding I wanted to make some of my own web tools in Python and PHP I grabbed a few books and started reading.
The tasks are easy enough to get you started but one thing I've found is they throw terms at you without getting around to explaining them.
I had no real idea of what a Class was, until I found a good definition/explanation in the 3rd or 4th book I checked out. Sure, it might be obvious to most of you, but to a beginner any term that isn't immediately understood is a stumbling block.
So if you're planning on teaching some new concepts in lesson 3, I'd suggest providing a glossary of those terms at the end of lesson 2 for the students to take home and get a head start. Even if they don't fully grasp the concept in time for the next lesson, they'll probably know what questions to ask before you get into the lesson. It should minimize the need to stop and start during the actual instruction period.
... not the message
so "language X sucks" are pointless.
Logo, Basic, C, C++, Java, Ruby, Python, ... ... are ok to teach basic programming as long as you use them to teach concepts and do not focus on language idioms!
I think the thing with teaching is to look at different approaches taken by other people, and use the method that actually produces results. I saw teachers try several different techniques at high school and university level, and they all failed miserably, except for one guy who was wildly successful. He was actually tasked with teaching us Haskell, which is an abstract pure functional language that most people "don't get". Despite that, he successfully taught it to the majority of students in his class, who then couldn't learn Basic or C from other teachers in the subsequent semesters.
His technique was simple. He set up a digital projector with his laptop so he could sit and face the class, and projected the development environment onto the screen. He then started coding really simple problems ("add all the numbers in a list") and running the example code, often through the debugger.
With almost every problem, he'd deliberately make a mistake (leave out a bracket, or not increment the counter in a loop, etc...) and demonstrate how the program failed, how to interpret the error messages or debug it to find the source of the error, and the result of fixing the error. He'd involve the class, asking the students to 'spot the error'.
I could already program when I started his class, so it was fascinating to watch him teach. What I found is that he was teaching exactly the things that I found difficult when I first started out:
- It's hard for beginners to go from a compiler error message to a fix. I still remember the Borland C++ error message "Cannot assign value to rvalue". It took me a day to figure out that I had an "=" instead of an "==" in an expression.
- Writing programs is relatively easy to learn, but learning how to "mentally execute" a program step-by-step to debug it, or use a debugger, is hard. Many beginner programmers just assume that it'll do what they meant, not what they actually wrote. Writing correct programs is much harder.
While I'll probably get boo'ed out of existence for mentioning C#. I've done a lot of tutoring of students one-on-one using this method... C# does an excellent job of getting the syntactical structures into a student's head - without beating them upside that head. Just don't teach any of the C# specific stuff (stick to the shared C++ / C# keywords - avoid foreach, 'as', 'is') It's trivial, and I mean trivial, to get someone to go from C# to C++ - you layer on memory management and the standard library goo, and you can have a halfway decent C++ coder in 3 or 4 months. The rest is experience and self-enforcing of good standards. One thing that I noticed really helps student coders is visualization of what they're working on. When a console app spits out a '5' that's pretty damn boring. When that '5' causes a dude to jump - or a color to change, it keeps people more interested and they feel that they're actually making changes. If C# is what's being taught, Microsoft is working with schools to get XNA utilized for teaching programming, making visuals super-simple to get up and going. I recently went through some Cellular Biology classes and I feel that my programming actually got better from learning how nature does complex systems. There are a lot of connections that can be made between Biology and computer systems, I wish at least a 200 level cellular bio class was a prerequisite for CS students. I think it'd make more humble programmers that are used to looking at complex systems which are decades away from anything a computer can do now. --- I realize this was a fairly Microsoft-centric reply and that's looked down upon here. But, a teacher needs to teach what students will need to know. In this day and age, for the most part, that's Microsoft technologies, with a solid core of platform independent language as the foundation (C++.)
http://openbookproject.net//thinkCSpy/
It's an incredibly well designed textbook co-authored by a 'a college
professor, a high school teacher, and a professional programmer', designed exactly for the sort of situation you describe.
I know in my undergrad program at the university I attend as a student, the better professor's try to involve/interact with you in class. Also, make sure that powerpoint presentation information is available for students to download and review. The interactive portion of class makes you pay attention more, and helps to work the problems out that are being projected on a large screen. But, that's really only applicable in classes of 40 or less. Also, one thing that the CIS department at my school does, is that they give out a pretest to evaluate what the students already know, and it allows them to tailor the class a little bit. Which would be especially useful if you were starting a new class for the first time and no one else was able to hand you the materials from how it was previously being taught (and that would be assuming that those materials and lesson plans were even good to begin with). You could also try referencing how to assemble a lesson plan for the course you're going to be teaching from other freely online CIS courses (http://www.intelligentedu.com/cat3.html). Furthermore, you're going to need to review some books for the course that the students would end up using. So, you'd want to contact the book publisher to see if they have any associated workbooks, powerpoint presentation, and possibly... pre-fabricated lesson plans. And above all else, try to stick with a book that can be followed by the students, and that hopefully progresses from chapter 1 through the chapter you intend to complete. I can't tell you how much it pisses students off to be in a class where all you do is hop around the book like a scatter brained fool.
I suggest "Computer Science Unplugged" as a complementary didactical material at www.csunplugged.com
The only other courses in the first term was digital electronics and pure mathmatics courses. Only in the second term was Java introduced as the perennial OOP/procedural language. I think we've got one of the lowest dropout rates in the country (but don't quote me on that).
95% of all computer errors occur between chair and keyboard (TM)
Teach them Scheme using the text "How to Design Programs" http://www.htdp.org/
Start by making the students to calculations with simple binary numbers, then teach them how to read and calculate with hex numbers. After that, move to modular arithmetics in base n. Make them work with pen and paper only in that early phase, or otherwise they will be spoiled for life. Then they should learn to write simple programs in Z-80 machine code (there are emulators for this).
After that introduction, it's time for some more serious stuff. Fire up some good scheme interpreter in Emacs and teach the students some basic data structures, recursion, proper tail recursion, and lambda calculus. Then they should learn the mu-calculus and prove a few basic meta theorems. When they have learned that, they should learn to understand and implement few advanced algorithms and datastructures, so they can decide a grid from a zip and a promise from a semaphor. A good excercise is to make them write a compiler for a little ALGOL-esque toy language and while where at it dicuss term rewriting systems on abstract syntax trees and stuff like that.
As the final project and to improve the teamwork skills, divide the class in groups and let one group write a real-time operating system for some mars rover and the other class write safety critical applications for that OS.
After that, they should know enough about the basics of programming.
When I was in 6th grade, computer class used Apple II's and we learned out of the Kids and the Apple II book, which took us through the basic language from the ground level and, looking back, I think it did a decent job of teaching us programming concepts in a fun way. I think this background gave me a good foundation of programming that helped me even through college C++ classes.
But I'm not writing to specifically recommend that book, but to share my observation about that time period of learning. Sure, we had our share of boring calculator programs, and I wrote a fair amount of spaghetti code, but the most fun we had was when the teacher assigned us to write an adventure game, in the vein of choose your own adventure. Since textual and graphical adventure games were what we liked to play at the time, it was a real thrill to be able to try to create even a pale imitation of them.
But then things got too complicated. Games got to good so it wasn't really possible to imitate them on a low level. If you learned C or C++ in class, it was really difficult to create games or GUI apps without learning all these other tools and platforms. Programs had to be compiled and took all the immediacy out of trial and error programming.
Years later, when the web came along and everybody was hand-coding or frontpage-ing static HTML pages for their "homepages," I never got into that. I knew that the professionally done sites like yahoo or amazon weren't using static HTML but had server generated pages. When PHP finally came around with the ability to programmatically generate web pages, I felt a thrill just like back in the BASIC adventure game days. I could create media the same way those "in power" created it.
Today's kids are voracious consumers of media, but they like to create it too. Whenever tools come along that let them create media "just like the pros," they jump on it. For example, when CD burners came around, everybody made mix-CD's just like the compilation CDs sold commercially. When sound and video editing came out, kids jumped on that, first using DVD burners and then YouTube.
Following this observation, kids nowdays live on the web. To them, Facebook is professional media. If they could create dynamic sites like Facebook, they would feel the thrill of creative programming and be able to connect with the reason for why people program computers.
For this reason, I think one of the web-oriented languages like PHP or Ruby is a great way to introduce programming to students. They can build pages like what they use and see the results in their web browser immediately without compiling and feel the thrill of creating again.
but possibly not in an 'optimal way'.
Looking back at it all I think there are two strands that need to be given. A basic understanding of the syntax (not the language per-se) - so some boolean, if/else/loop guff - just cover the concepts (they're not hard to grasp). Basically allow somebody to write down logic in a vaguely programatical manner. If you want to stretch them, then OO is fine - but that's not how the brain works out of the box. Start with a flow diagram on the whiteboard (ifs) then a few loopy arrows (loops). Next step is to make them feel they've made something useful. I'd just give them a Apache/PHP pre-config and let them rip with PHP. They can write some HTML and then just slot some PHP in the middle of it. Now if they know nothing about HTML, then maybe start elsewhere - but I'd assume the key is to start with what they can already do, and then get to the simplest way they can improve upon that as soon as possible.
I'm going to take a flying leap and suggest HTML.
a) HTML has immediate feedback. The most popular programming language isn't taught in any computer class, because it's Excel. Why is Excel so popular? Because it gives immediate feedback, is easy to learn incrementally, and people have motivation to use it (starting from saving tedious data entry work). However, since your audience are probably kids, HTML will have more applicable use.
b) HTML still has logic. It's not the traditional computer science IF-THEN stuff, but designing a good user interface requires a host of analytical skills, not to mention the same debugging skills used in programming.
c) You can still sneak in traditional CS with Javascript and PHP towards the end of the course. In fact, you can even teach API "black box" programming, which most introductory computer science programs fail to do ("What? You mean I have to use someone else's code when I program?").
I still have no idea why "Hello World" is supposed to be so darn exciting. Being able to write a program that tells me I can't write better than a cheap pocket calculator gives me no particular thrill.
For one, they actually will learn how to operate a computer. The basics of learning how to function a shell properly is immediately rewarding and practical. Once they can learn the fundamentals of the file tree, getting from A-Z and basic file management, show them something powerful with xargs... Next stop, Boolean logic structures. After that "functional" programming.
Every year I have taught this, the course has not only piqued interest in programming, but invariably ends up exposing kids to other aspects of computer science such as networking and more.
Or don't.
First, one more voice to the chorus saying: "do concrete examples". Hopefully everyone can see your screen, and they can watch while you solve some problem. And the best examples are ones that let them interact, so I'd teach I/O first thing so they can start thinking how the computer does something for them, like playing a simple game (eg. guess the number, dice game) by the end of the term.
I'd also make sure you have a great reference ready for them, so advanced students can read ahead while others review as much as they need. Maybe that goes without saying.
This may also go without saying, but since it hasn't been said: make sure you've got understandable examples of larger projects they can do by the end of class. Some way that they can get some real accomplishment.
Fun, concrete, easy-to-understand examples and games are surprisingly tough to prepare and explain, so prepare well!
I don't know if it will help but when I was 10 I begged my parents to drop the piano lessons and put me in a computer class. They relented and on the first day the instructor came in with a piece of plywood that he had mounted 8 plain light switches in a row. Each switch controlled a corresponding light mounted below the switch. That is how he taught a room full of 9, 10, and 11 year old kids how electricity could be converted to ones and zeros and how ones and zeros could be converted to characters.
Alice is an innovative 3D programming environment that makes it easy to create an animation for telling a story, playing an interactive game, or a video to share on the web. Alice is a teaching tool for introductory computing.
http://www.alice.org/
If you intend to teach basic programming concepts remember that technology is always changing. I would stick to well established functions true over many languages i.e. for..next, if..then, do...loop and maybe some concepts regarding scope of variables. Also, it is important to realize some people will just have a natural inclination to understand programming. Some won't and never will so I would not weight the course too heavily in programing.
Time flies like an arrow. Fruit flies like a banana.
I am an expert software engineer... A genius, in fact.
Most of the suggestions above are lame.
Teach old-school BASIC. Yes, start with something like this:
10 PRINT "HELLO"
20 GOTO 10
Anyone can get instant satisfaction from a program such as this. That's what hooks someone immediately and makes them want to learn more. The sense of power, and the desire to get the computer to do more, is instant and intense.
Forget about starting with a description of the machine or with an abstract discussion of the nature of computers. Make a few remarks about the idea of giving a series of actions numeric labels, and that actions can involve jumping to other numbered actions, but then simply show the BASIC program described above. Have a question and answer session about it. Let the students ask more about the program and ask about possible modifications.
After a few months of incremental expansions of a BASIC program, switch to a new paradigm: Action Script (for Flash).
What is so cool about Action Script? It's what Java (for applets) should have been, but never managed to become. Java sucks because nerds at Sun thought brittle tools (like "jar" and "javac"), which never seem to do the right thing with "classpath", etc, would be acceptable. Java also sucks because audio and video weren't given TOP PRIORITY TREATMENT by Sun way back when. All of that multimedia stuff should have been nailed for Windows the day that Java applets made their debut. Adobe did things right with Flash, which is why Flash enjoys a 98% installation base, and generally kicks ass. Anyhow, by teaching Action Script (with the free SDK), students can create fun multimedia programs that are platform independent and which anyone in the world, including Mom, can admire. Their work becomes an instant resume (because anyone can see their work in action online). The desire to do MORE -- by LEARNING more -- will come from many parts of the student's psyche. The concepts of Action Script are a bit beyond BASIC, but by doing incremental steps in Action Script, and introducing ideas only as needed, the steps can be made very small indeed. All the time the students will want to know how to do more, and the benefit of learning more abstract ideas will be evident to the student.
After a year of programming without any regard or appreciation of the mechanics of the computer, a student is ready to contemplate the lower level operation of the computer. This is when describing memory and the actions of the CPU is appropriate. And this is when I think programming in a language like C# would be best. Why C# and not C++, Java, etc? C# is cross-platform like Java, but isn't as lame (e.g., insisting on declaring classes as throwing certain exceptions, or insisting on naming files according to the classes within, etc). Furthermore, C# enables the programmer to learn about actual memory pointers, whereas Java has no such mechanism for this. Also, C# can be used to access native libraries, which expands the availability of interesting libraries that can be used by C# code. Java is a great language, but C# has improved upon the ideas and has disposed of the silly aspects of Java. I have no love for Microsoft! However, C# and .NET are great inventions, and they have been ported to Linux and Mac OSX long ago. Does Java even have any template-based collections yet? Anyhow, the point is that students should be taught about the computer as a machine only after thoroughly enjoying the experience of programming (in languages like BASIC and Action Script, where there's really no telling what might be happening behind the scenes to make things work).
Finally, flunk everybody! Teach them some humility. Who do they think they are, pushing buttons and thinking they're all that?!? Well, new flash, boys and girls -- but mostly boys -- you don't know jack about computers! And everyone gets barcode tatoos on day one in your class. No exceptions. On the forehead. You are hardcore. This is computer class!!1!!!
I don't know if someone has mentioned this, but have you checked out Stanford Education Everywhere (see.stanford.edu)? Go through the intro computer science stuff. Adapt it to your situation. It might be a good example.
First let me recommend you read Bertrand Meyer's write up on teaching introductory programming. Meyer is the inventor of the EIFFEL language, and the Design by Contract methodology. He teaches at the Zurich Technical institute.
Even if your students are not at the first year university level, some of his thoughts would be of value.
Second let me say that there are enough accomplished youngsters out there that you do not want to turn them off by boring them with trivia.
Meyer's approach is to use a well established library building blocks and let the student start by making calls to the library to implement some interesting new features.
Once hooked on the 'coolness' of being able to tell the computer what to do, some/most of them will want to know why and how this all works.
Third, given the almost total video orientation of today's youth I would suggest that the 'first program' should not be 'hello world' but instead be drawing a smiley face on the screen. Or something of similar graphical nature and complexity.
There was a language called LOGO developed for the commodore 64 that had that approach. Very easy to make a 'turtle' crawl around the screen and make figures/shapes. Learning to direct the 'turtle' was how the kids got introduced to statements, loops, conditionals etc.
softcoder
If the class is currently as unstructured as it appears, I would suggest talking to your students before selecting your tack. It sounds like your students' computer knowledge and skills are likely to be all over the board, so I would say use the first class session to familiarize yourself with what the know and what they would benefit from learning. Computer-oriented classes are all too often done with a one-size-fits-all approach (especially the lower/entry-level ones), so if it really is up to you, tailor the class to meet the needs of your students, be it basic email and safe web usage, elementary html, php and python, or simple network administration. In my experience in education, the more technical or arcane the subject matter, the less communicative the teacher. Look at this as one of those rare opportunities to really help individuals with their specific needs, and everyone might come out a winner, including you. Just be flexible and share only the appropriate knowledge, and presume that some topics will fly clear over the heads of many bright folks.
This is a hacked account, for which the owner can not be held responsible.
I think the "robot programming" theme is a good one. I remember one of the first things that got me interested in programming was a toy rover that could be programmed to travel a certain distance, make turns, etc, in sequence. Then there is Logo, which is essentially a virtual version of the same thing plus the inclusion of a drawing function.
Here is something else I came across a few years ago which I always thought would be great and fun for teaching OOP programming fundamentals, Colobot, a game where you are an astronaut who must complete a variety of tasks using programmable robots. It covers a very wide range of difficulty from as simple as moving around and picking up objects, to as complex as automatic flight and targeting control for aerial combat. It uses a very C/Java-like syntax.
To use a cliche, it makes learning to program fun. You get immediate feedback on your program and see for yourself its results. Much more fun to code some robot to hunt down a bug and zap him, than some textbook-style exercises. I actually found it quite addicting when I first discovered it :)
It is quite a few years old now and should run on virtually anything (requires a 300Mhz Pentium and 16MB 3d chip).
"Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
Whichever language, concentrate on algorithms (data and exectuion flow), terminology and practice. I'd use C.
PS: in which case you shouldn't forget to tell them why "int main(void/int argc,char **argv/char **env) { return EXIT_SUCCESS; }" are the only three ways of doing it right :)
PPS: teach them to indent/format their code consistently, I want to be able to read their crap when they'll get employed in the industry. Pyhon would inherently help here.
Divide your class into 'students' who want to solve puzzles and 'pupils' who need to be given limited-scope exercises.
Comment removed based on user account deletion
By the blood of the cross (inline ecclesia/assembly language) we can speak in any tongue and is remit through Him by grace of the sacrifice on Golgotha. The Calvary's Cross-compiler wills it!
God wills it!
# cross myfederalprivatecreditlawsuit.txt -o UniformCommercialCode-dresser
UniformCommercialCode-dresser created
# ./UniformCommercialCode-dresser -entrance patron -condition restrictive_appearance -title suitor -pursue law_merchant -directory rule.E-8 -memo "Congressional Supplements to Certain Admiralty and Maritime Claims" -dossier "libel of review"
segfault
core dumped to file "redemptionoflawfulmoney.txt"
1. Ask slashdot what you should do.
2. PM people who respond for more ideas.
3. Probe for more until the syllabus is written for you
4. Profit!
These posts express my own personal views, not those of my employer
start with the fundamentals (UTM`s)
move one to 8086 machine code (briefly)
some c (get them to write basic programs)
then explain the advantages of oop, black boxing things, reusable code, etc.
this worked for me after being lost in a previous course where the threw me straight into oop (the course was part founded by sun, so Java was THE language)
"MySpace? What is that?"
That's the train of thought you should be having. Assume your public knows nothing about this stuff, and you should automatically take care not to write complicated stuff.
I am not devoid of humor.
learn from this physics teaching master at mit:
http://ocw.mit.edu/OcwWeb/Physics/8-01Physics-IFall1999/VideoLectures/ (mit ocw)
The key is to just explain it, no bs and no assumptions of previous knowledge, then have students solve problem directly relevent.
You really are being asked to put 10 lbs of shi -- potatoes into a 5 lb bag.
I'm a teacher who ended up being the school's IT geek, and I am daunted by the task you face. At my school the vast majority of the kids are clueless about comptuters. They can use a web browser, and can put words in a row in MS Word.
There are a few that have played with script hacks. And a very small number that actually know how to program.
I see IT education as having the following goals:
0. Teach touch typing. If you have to think about what your fingers are doing, you lose track of everything else.
1. Teach uses for the computer:
* Internet: Searching strategies.
* Internet: Safe use.
* Text processing and layout. (use styles in word, darn it!)
* Calculation, statistics, graphing and modeling in excel.
* How to back up/move your data. Maintaining multiple versions.
These skills should be taught in conjunction with the kids other classes. E.g. Tie spreedsheet classes into their science or math classes. Tie text processing into their language arts classs.
2. Use the computers to teach troubleshooting/scientific method. Computers are a good way to teach reasoning.
3. Finding new tools. Present kids with a problem -- E.g. a photo with part of it in color, part in black and white, or a data set that needs perspective 3d to visualize. Let them search, download, install, and try out various things. (Lots of merit in each kid having his own VM for this.)
4. Show them logo. This is one of the best ways to get kids hooked on programming, as the feedback is so immediate, and it has elements to engage both left-brain and right-brain.
That's one course.
The second course is one in actual programming. Once the kids had mastered something a bit harder than "Hello WorldF" I would split the class in half, and give the two halves different easy problems. Say, the classic 4 banger calculator problem, for one, and a paragraph reformater for the other. Throughout this talk about the importance of code documentation. Now we add a feature to each problem, but the paragraph reformatter guys have to add a feature to someone's 4 banger, and vice versa. So each has to add a feature to someone else's code. Kids are marked not only on how well they did the original assignment, but how well the next person in line did with their code. Pairings are changed with each cycle.
For languages, I don't care, but given the sloppy nature that most kids today bring to academics, I think there is merit in a 'discipline and bondage' language that requires declarations and is strongly typed.
Some form of bottom up approach will work better than top down design will work better with kids, and overall will be easier to teach. You want a methodology that allows lots of immediate results, both so the kids get rewards for doing things right, and so that you can monitor their progress.
This second course is not one that I would make compulsory, or if it is, I'd want some provision for allowing kids flexibility as to which year they took it. I found teaching math that many young brains aren't ready for abstract thinking until they are 13-14 years old.
I would be interested in hearing what you decide.
sgbotsford at gmail.com
Third Career: Tree Farmer Second Career: Computer Geek First Career: Teacher, Outdoor Instructor, Photographer.
Don't listen to those Apple fan-boys and their precious frameworks. PHP is very suitable for students, quite similar to and compatible with the teaching transition to C++. I am currently enrolled in an Introduction to C++ Programming class. I'm acing the class. Most of the students have no idea what they are copy and pasting and ask many stupid questions on our discussion forum. I think the biggest hurdle you're going to face is keeping the students interest at this level. They don't care to understand the statements if it doesn't connect to their cell phone or MySpace. There isn't really a good way around that. My instructor sets minimal expectations for lab assignments and keeps the "rewards" coming in the form of 1000-point grade scale. I think his online discussion forum is probably his best asset in assisting the students. He gives great lectures, but everyone just does the labs and goofs those off.
I originally learned computers in the electrical engineering department of my university. We started by learning how to program a very simple computer in machine language (think binary codes), and very rapidly moved to assembly language. At that level we learned about how the actual machine works; what is an ALU, what are registers; what are different memory addressing methods; and so on. Once we were comfortable with assembly, we learned FORTRAN (today it would be C), and we learned how to "compile" or correlate what we wrote in the higher level language into assembly. We also learned about the various I/O devices such as disk, graphics displays, network, and so forth at a very low level before moving up to the more abstract levels.
Later on at university we took higher-level computer science courses, such as data structures and algorithms, in the computer science department. The computer science department taught their students introduction to computing using PASCAL and they never were taught the basics of the actual hardware and how they worked. In these higher level courses the top grades all went to the "visiting" electrical engineering students who spent the least time on the course, in large part because we all understood how the machine actual worked so we could visualize the higher level concepts in action and understand them much more quickly and much better than our CS colleagues.
In my professional career since then, I have consistently seen that people who knew how the hardware worked generally understood what is happening in their programs far better than people who were only taught high-level languages or abstractions. They often also had a much better understanding of what was possible, and what was feasible.
You might start simply by bringing in a computer and taking it apart in class. Disassemble the whole thing. For example, take apart the hard drive and show them the platters, arms, and heads. Pop the back off the CPU chip and show them the actual chip. Many people get much more interested if they can touch and feel what you are talking about, so when you show them the actual hardware bits they can then later relate your functional descriptions to the actual pieces they touched and examined earlier.
A good programmer knows the fundamentals of programming, they know all the common data structures, they know if they need to learn a new language they often don't need a full text but just need to know what the syntax rules are, whether arrays are 0 indexed etc. for example.
Start with the basics, explain the processes involved in them using a PC. Explain that when an executable file on hard drive is run how it's copied into memory, how references to external libraries are handled, the stack. Explain how code compiles down to bytecode to be run on an interpreter or down to native machine code and so on.
Once they know the fundamentals it'll be easy for them to pick up the rest in a well understood manner rather than doing how so many do and being dumped straight into programming without understanding how memory is actually being allocated etc. This is after all a large part of Comp. Sci. - not simply programming but understanding Computing.
Once they've got the basics you can go either way- either lower level and explain how various math topics relate to computing (set theory to databases, number theory to cryptography for example) or you can take things higher level and then teach them programming in a modern language.
You are making a mistake if you think that you can create a successful curriculum from scratch because you know something about computers. I suggest you find a good book. My recommendation would be Mark Gudzial's 'Computing and Programming with Python'. It is designed for the kind of students that you are describing and starts immediately with real problems with a cool factor. The focus is on multimedia programming, so the projects are things like simple green-screening, making music, etc. Python and the libraries he includes makes the projects simple and very appealing. You can pepper you classes with discussions about the Internet and how things work, but don't get too technical or try to cover to many things.
Of course, one thing that I always try to integrate when I teach similar courses is some days when I talk about societal issues with technology - the DMCA, the patriot act, fair use, "piracy", RFID tagged IDs, who can see those drunken photos you posted on facebook/myspace and why it matters, citizen journalism, etc. These are things that are a part of their lives and no one else is telling them about them and why they are important.
The fact you have to ask that question is a sure thing you are not suitable for teaching that course. Especially when you say 'php & phyton' in a 'basic' programmingcourse, means you are not suitable for teaching it.. those languages are not suitable for learning someone how to program decently.. but hey, that's just my opinion...
You aren't a teacher, why come up with a curriculum from scratch? Better yet, use something that a lot of high schools and colleges use, HOW TO DESIGN PROGRAMS: http://www.htdp.org/ http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-2.html
I would start with Haskell monads. If they can't get those, they're not cut out for programming.
I'm taking an intro-level course in programming now, and I have a background in web development. The course I'm taking uses Python as an instructional tool, and the book "Think Python" as the basis for the training. I have to say the book is relatively simple, the concepts are straightforward, and it's all presented in digestible sections. Also, the book is free to download here: http://www.greenteapress.com/thinkpython/ When the eyes glaze over, you can play some vintage Flying Circus episodes to reign in their attention.
I agree with the sentiment that your course sounds more like three courses targeting different audiences. I think you need to decide if this is a survey course or if you aim to actually teach them hard computing skills. If I were developing your syllabus, I'd probably recommend:
Part 0) Basic Computer Operation (pointing, clicking, etc.)
Part 1) Survey of Popular Use of Computers (the Web, learning applications, social networks, online gaming, etc.)
Part 2) Basic Programming Skills (variables operators, conditionals, functions, etc.)
Part 3) Survey of Advanced Programming Concepts (cloud computing, information architecture and informatics, IDEs, etc.)
You could omit or shorten each of these elements to fit the course objectives, which probably depend on your audience. The main advantage of teaching any computing course is that you can get incredibly interactive.
Finally, if your students are under 18, consider the implications of getting them involved in a social network or building a web site - you may need parental permission for anything that exposes personal information on the net. Maybe set up an internal web server?
If this is an introduction class, remember that your goal is to introduce, not indoctrinate. You aren't teaching and "advanced algorithms" class, you are showing your students a bit about programming what you can do with it.
Starting them off on something that introduces the subject of programming is a good idea, but I wouldn't even start them off on PHP, Python, BASIC, or Pascal, I would start them off on Scratch. It's a product of MIT, it's free, open-source, cross platform, and does an amazing job of showing the basics of event-driven programming. Even to the area of variables, iterations, etc.
Oh, and you can usually get somebody started in 10 minutes or so. It's quite a site to see somebody program a multi-player game full-on with scratch in an afternoon.
I would introduce increasing challenges in Scratch for the first month or so, so that people get a clear understanding of how variables, callbacks, math functions, and algorithms are used before introducing them to a more "real" programming language.
Of course, YMMV, I have no idea what context and environment you are really dealing with...
My $0.02 of free advice.
I have no problem with your religion until you decide it's reason to deprive others of the truth.
Things that did work: 1. do not do the first list.
Although the book is out of print (http://www.amazon.com/Your-First-C-Program/dp/0782114148/ref=sr_11_1?ie=UTF8&qid=1223836443&sr=11-1) I remember it being a great book to learn the basics from (I was 12 at the time and wanted to write a game). My expectations at the time were obviously way too high but it put me out on the right foot. I know some people would recommend Java (etc) as it avoids the "difficult" things in the lower level languages such as C/C++ (memory management) but considering programming is, in the books words, "telling [the computer] what to do, in exactly the correct order, in a language the computer understands. That's it." missing out these fundamentals is dodgin the bullet. Can you really learn something without understanding exactly what it is you are doing? Just my 2 cents.
Wow. Most the replies I have seen so far are from a much too high or abstract level.
Speaking as someone who has taken both computer science at university *and* computer programming at college, I'll comment on what they teach at college for computer programming. In university, computer science classes tend to assume that you have taken computer programming in high school, and therefore already understand the basic concepts. They make no such assumptions in college.
The first step is to simply explain that computer programming is not magic, it is a method of specifying a step by step solution to a problem i.e. laying out a set of steps to solve a given problem. Usually, you can do this by using a recipe analogy to cooking. You have a set of ingredients (variables) and some things (operations) that you do with these ingredients in a set order.
Now that's a really brief description, you would of course also explain briefly what a variable is, what an operation is (in computer terms - usually best equated using a math analogy) etc... The important thing is to emphasize the relations between computer programming and things they already understand (math, cooking etc...).
What you *don't* need to do is explain anything about:
-algorithm analysis (Big O - that will generate blank looks and dropouts)
-how computers actually work (1s and 0s, switches etc... again, blank looks and dropouts)
-computer hardware (hard drives, CPUs, RAM etc...) this may be acceptable for a intro to computers in general, but is not necessary to learn how to program - too much detail
-advanced math (calculus? see above)
-HTML or the internet (they might find it interesting, but it's not related to programming)
-software engineering, they have to learn how to walk before they can run, they'll have no clue about this until they actually grasp the fundamentals of what a program is and does
-bits, bytes, binary, hex, you don't need to understand representation to grok what programming is, this is WAY too much detail for beginners
-OO, you need to grasp basic structured programming first
All of the above is fine for a basic computer science course, but for a basic computer programming course, you really need to assume that your students are completely computer illiterate.
So, after teaching going through the first basic lessons on what a computer program is (i.e. formal specification of how to solve a problem) and *leaving out* the list of stuff I mentioned that will only confuse them, you move on to explain the 5 basic elements of computer programming in a bit more detail:
1) Assignment - the ability to store and retrieve values. As part of this you will need to explain a bit about what a variable is and some basic data types, integers, floats, characters, booleans and strings. You don't need to go into detail about HOW these things are represented, just that these are some of the basic general types of data used.
2) Operation - functions, what they are, what they do, what inputs are (i.e. to whip butter you need butter (duh), a mixer and a bowl) and what outputs are (the output of whipping butter is (duh) whipped butter)
3) Sequence - sequential execution of a list of instructions (go back to the recipe example if you have to), this is just basically the idea that one step follows the next in order they are listed
4) Conditional Branching - the ability to do one thing or another based on the condition/state of some variable
5) Iteration - repetition of instructions either a conditional or fixed number of times
These are the basic elements used to formalize solutions to a problem. If you can get your students to understand these basic concepts, then they will understand the essence of what computer programming is, and realize that it is not magic.
Once they have grokked this, *then* you can move to actually having them write some basic programs in some language that is suitably simple in
About 6 years ago, I left industry after 30 years for higher education. A bit a confusing at first, but you'll get used to it. Be prepared to realize that the undergrads know more about using the Web than you do. Talk with other faculty. There are probably some people who can help you find all the "interesting" aspects of academia.
I'd start with 2-3 weeks with Scratch (MIT). I think it's best system for learning the how computing works. I've had non-majors building systems with messages, nested loops, etc in 2-3 weeks. Once they have the concepts, you can go different ways depending the aptitude of the students. If you're not sure, try them on Alice (ask around the faculty if any have used it yet). There they have to actually type some code. If you think they are ready for straight-out coding, you could go with Python. A lot of colleges are using it in the first programming course. Alternately, you could go onto Web programming using Javascript.
Good luck! The first year will be a bear. Then you'll find what works and not for you. Enjoy! Email if you need.
Jerry
We did simple programs like
10 FOUR = 5
20 FIVE = 6
30 PRINT FOUR + FIVE
We also did flow chart diagrams, IF conditionals, and some elementary logic.
Since I was taking the course just at the beginning of the PC era, I had barely used a computer prior to taking this class, as my elementary school days preceded the widespread penetration of the home PC. Perhaps I was fortunate in this respect.
I've been programming over 20 years. I'm going to suggest that programming and intro to computers are two separate subjects. i.e. if you don't know how to turn a computer on then you don't belong in the programming course. Now then, moving on. Assuming you are talking about teaching programming. Back in college one of my professors did something really really good:
This was an intro to programming class and they were teaching the old QBASIC on DOS.
What made this teacher stand out above the rest is that he tought the class like HE was a machine. He gave very specific instructions for the class to follow. He asked that all homework be turned in on a 3.5 floppy with your name and class number PRINTED on the front of the disk. The disk had to be in a folder WITH pockets. The source code had to be printed out also and included in the folder. The staple HAD to be in the top left hand corner of the paper, not the right. The staple had to be vertically oriented. The outside of the folder had to have your class & name PRINTED on a label on the top right hand corner. Class on the first line, then name on the second line.
He would give 5pts off if you missed any one of these steps. He handed out a piece of paper at the beginning of class that had all the steps needed to turn in an assigment. They were well enumerated and easy to understand instructions. However every single time there would be some students who didn't get the staple right or didn't print their name but wrote it instead or didn't have a folder that had pockets or hole punched their assignment and put it in a 3 point binder thinking it would look extra sharp that way. He would always give 5pts off for every single thing done wrong before he even looked at the code. If the code didn't work he'd subtract even more. Some students who had otherwise perfectly good functional code would get an 80 and get pissed off because they didn't see the point.
He was considered very anal but what he was doing was pure genius. He was teaching the students that computers are NOT forgiving and they do exactly what you tell them. He was engraining it in us early on that you must be a perfectionist in order to get the system to run properly and get 100% correct results.
Very good teacher :)
very misunderstood.
Teach them to drink beer, eat Chinese food and pizza, shun sunlight, and carry removable media around with them.
Worked for me!
Make sure you are teaching multiple levels of your class, and that they are not required for one another. Students nowadays have the wherewithal to be very proficient at everything from applications to programming to electronics and hardware before they ever set foot in a computer classroom. You need classes catered for, at least:
1) Students who have never been exposed to a computer.
2) Students who have used a computer and are familiar with how it works, but want to learn how to be power-users of important working applications such as Office (especially Excel) and how to be effective and courteous netizens.
3) Students who want to learn the basics of programming
4) Students who already know how to program and want to learn the Computer Science behind it.
I think they should all contain some element of web awareness and good netizenship, as those are going to be more important in the coming years, but most of the rest is going to be specific to the class.
Your course for basic computers should probably happen on a Mac. If that's possible. I only say this from experience watching my family: people can find things on a mac by reasoning it out, whereas you have to already understand the organization of Windows to find things there. It should cover the basics of starting a computer up, installing an application from CD, how to uninstall applications, the importance of anti-virus and anti-spyware, how to get and use a basic e-mail account (thunderbird, I believe, lets you sign up for at least one type of email account right within the wizard), how to create multiple users and why that is important, etc.
The Office course should at the very least cover using some of the more powerful features of Excel, how to create and collaborate (read: track changes) documents in Word (especially with automatic section numbering, advanced formatting with sections, headers/footers, etc.
The basic programming course should be done in a basic language that actually has real world applicability. I would recommend perl or C++. Java is an alternative, but I have my own issues with it that aren't relevant to this discussion. The essential thing to make clear to your students in this setting is that you are trying to teach them the basics of programming, not how to code. You need to be very clear about designing the program from the ground up and documenting it all along the way. When you teach them bad habits, make sure they know they are bad habits and why, and also why the better habit is being avoided. They shouldn't have to learn these when they are laughed at by an employer.
The advanced programming class should NOT be specific to a single programming language. Somehow, this seems like a novel concept to a lot of people. These kids know how to program, so don't make them learn your language or your style! Focus on computer science concepts such as recursion, algorithm design, data structures, etc. Obviously you will have to limit what language they can use (BASIC doesn't have OOP, data structures, etc), but anything from Perl, Ruby, and PHP all the way out to C++ could be used for a class of this style. Have a project-oriented class which focuses on deliverables and hands-on demos, as well as having to explain their code and methodology. These are essential skills in the workplace. Bosses don't care about the code, they care about what it looks like, how it works, and why it's better than what some monkey could write.
This is a lot to start up at once, so don't try to start all of the courses at the same time. Try to gauge interest first and start on the ones you can first. Don't stretch yourself too thin, or you'll just be doing your students a disservice.
You need to sit down and say "What should my students be able to do with ONLY the content I have taught them.
If you want them to write a java applett, teach them EVERYTHING that is pertinent to making one, don't assume and leave stuff out and don't teach freaky abstract theories or give out large amounts of information that has no purpose/it too advanced/doesn't apply.
I once took a beginners class for C#, and the professor started out the class by writing a console program that converted measurements in front of the class, didn't explain one thing other than "press F5 to debug" and then told us to have the first assignment done next week.
I was in a class to learn Java, and the prof started talking about theory, history of the language, libraries, different distributions, usability of the code, VIM, theory behind open source and why it was different than other languages. He then sat down and said "Now write a program."
It seems like common sense, but don't ever think that they know anything more than what you've told them, and assign accordingly.
Don't worry about skill sets or previous knowledge, what level you should teach or what the class is going to be interested in. If you want the first assignment to be to write an OS, then do it, just make sure that you give them the information to do so.
No wonder we get the politicians we do. All talk, no history.
You have to be a dreadful person to make the life of people like Allan Turing boring. Heck, such lives are so interesting that movies have been done about them.
It helped me greatly to talk about Chomsky's life and achievements while learning grammar theory, of course it helped that my teacher worked with him, but still, any mediocre teacher should be able to make any life or historic period juicy and relevant.
History gives context to science and technology, it is good time that geeks and nerds were more fond of it.
IANAL but write like a drunk one.
HTML is the worst, it is a formatting standard, not a programming language, all the scripting languages for web development are the abomination of the devil from a programming point of view. Leave those for the poor sods that need to make a living using them, for normal people use some language that are simple and consistent (basic, pascal, perhaps python).
IANAL but write like a drunk one.
Like a simple video game. That will motivate much of the class.
Start with something that the students are interested, ie how the basics of the web work. How when you visit a website, your actually requesting information from another computer not to different from their own computers. Then give them the basics to write a basic "internet" application, using something like the google app engine or a little apache server you have set up. Once you have their interest, then go into coding practices and such. And be sure to teach that programming is about making mistakes. If you don't make mistakes/errors, your not programming right, and your definitely not learning anything.
I taught 2 100 level programming classes as an adjunct professor once and used C#.
I'm a Python web developer now and think it would be the ideal language to use for teaching. It has all of the important OO concepts baked in, and the interactive aspect makes it a very very easy language for beginners to learn.
Frankly though, C, Java, C#, or Python all seem like fine options. Each is probably best suited for certain audiences, but any of them are better than C++ and PHP.
While C++ and PHP are very popular languages, no one should learn them first. They're both hideous to look at (which matters to beginners), and in the case of PHP, just very hackish and lacking in good structure.
Start with pygame. Everybody loves a good simple game.
Just my $0.02 though.
I had trained my sister who just knew how to browse the internet and search for information from google. I started teaching her first the C language (from the book "let us c" by yashwant kanetkar, with basic algorithms) Then taught her C++ (object orientation for her started here) Meanwhile in parallel started HTML, javascript, DOM, css. (from w3cschools.com) Then started with c sharp (Without using visual studio) In parallel to this started ASP (classic) and SQL server for database. Then we moved on to ASP.NET (again without using visual studio) using the ASP.NET quickstart tutorial included in the SDK. Finally started with doing mock projects in ASP.NET using Visual Studio 2005 and Sql Server 2005. This whole training took 1 year, but considering the fact that she ended up getting a job, it was alright. Initially I thought of started with c# straightaway but its just that she would have missed understanding pointers and memory management. -- my 2 cents.
You cannot solve tomorrow's problems with today's level of thinking - by Einstein