Mini-Projects that can be covered in an 1 hour Haskell tutorial

The ideas in your question are far too difficult, for a one hour introduction.
Yesterday I had a look at Haskell and learnt some. I have over 30 years programming experience (20 years professional). Have experience with functional programming. Yet it took me several hours, and did not get far enough to be able to do your suggestions.
Mathematics
You say that your students have a maths background.
Take advantage of this. Choose some math problems. That Haskell is ideally suited to solve. And explain why you are doing this.
Ensure that you have more than you think you will need, as some students will be much faster than you expect, but don't expect to use them all.
There are some good ideas here https://stackoverflow.com/a/15110828/537980 also some of the other answers, to the same question: sort, search, interpreter (this one may take too long), factorial.
Avoid bad examples
Don't do problems that are more difficult in a functional language than in a procedural one (Reversing a list, using procedural techniques, in $O(n)$, is easy. If by using functional they will probably get a $O(n^2)$ solution, and $O(n)$ is hard, then you are teaching a disadvantage on day one.)
Fibonacci is, I think $O(2^n)$, for simple recursive implementations.
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)

I did it in $O(n)$ once, that was the day I learnt a lot about caching. It was hard, it took me a whole day.


Should teachers enforce standardization of spacing and braces?

Our two deities are clarity and efficiency.

Standardization makes a great deal of sense in industry, where large numbers of programmers may work with the same lines of code and must be able to make sense of each others' choices. However, I don't see value in enforcing particular style guides in an educational setting.

Different companies can require different norms.  If your students eventually enter the industry, a style guide is easy to read through if they can code, and is irrelevant if they can't.

When I teach my kids to worry about indentation, vertical spacing, variable names, etc, I teach them to always use this question as their foundation and their guiding star: "what does this choice communicate?"

That is honestly already quite a lot to tackle, and I have found that my kids really do start working quite hard and thinking quite deeply about how to make sure that every line of code is as clean and clear as it can be.

If my students can learn to scale this mountain, why would I ask for 4 spaces in place of a tab?


The difficulty of CS (true or imagined) and the drop out rates are not the same thing. Let me start an answer, but it might take several iterations to get all my thoughts together on the two ideas.
Two themes come immediately to mind.
The first is periodic and I don't know where we are in the period at the moment. But in certain combinations of economic factors and media hype, a lot of students go in to CS not really understanding what they are getting in to but are lured by the, perhaps elusive, draw of big salaries. There is a lot of hype out there about AI at the moment, and self driving cars, and going to Mars, etc. People get in for the wrong reasons and decide they really didn't understand what it was and that they don't really like it. It doesn't need to be hard to drive people away, just boring.
The second major theme is that there is a lot of bad teaching around CS as has always been the case. Some people teach it as misspelled mathematics, which it is not. Some people in elementary and secondary schools are forced to teaching CS and especially Advanced Placement CS when they have little understanding of the topic and just try to stay "one week ahead" of the students. This is, and has always been a recipe for disaster. I don't blame the teachers who have to do this as many are forced in to it (in the US) simply because schools are underfunded and understaffed with too few specialist teachers.
WRT the second theme, it might even be that the current push to teach "CS" in elementary schools is actually part of the problem, not the solution. A serious college level course in CS might be shocking to someone who has only dabbled in trivial elements of programming. In particular CS is NOT programming, though skill in programming is needed.
Too many beginning students and teachers think that programming is "if" and "while" and "assignment" and nothing else. The current AP curriculum, I think, is seriously flawed (dropping interfaces, in particular). Students program in "rich" languages and environments using only the lowest level concepts, never really understanding abstraction or (gasp) polymorphism. Compare that with big ideas that you find in a philosophy or (hopefully) history course.
And if you combine that with asking them to write programs that they find boring, they aren't likely to stick around for long.


Coding assignments for algorithms and data structures?

I'm not aware of any singular, central repository for assignment ideas.  My sources for project ideas when my own well begin to run dry are:

Textbooks.  Often, a problem in a problem set will trigger an idea for a full-blown lab assignment.
Other similar courses posted by other professors.  Obviously, it is important not to simply steal someone's idea.  I will adapt the assignment and make it my own.  If it is still substantively similar to the original when I am done, I will credit the original professor with a link to the original assignment.  (I have also on a small number of occasions reached out to a professor directly for permission to simply use one of their assignments directly. It has been my experience that people have been very gracious in these situations, both granting permission, and sometimes providing additional supporting materials such as rubrics, exemplar answers, and autograder test cases.)
I just generally keep an eye out for fun lab ideas and write them down when they come to me, even (especially!) if they are for classes that I am not currently teaching, because I have found this to be a useful resource when I begin to teach a new class.
We assign a fair number of open-ended projects.  I have not historically used these as source ideas for future lab assignments, but there is no reason that I couldn't do so, and thinking upon it now, I probably should.  I would, of course, share this with the students in question.  Most students would probably be flattered at the idea of their project being adapted to a full course lab, though if someone had objections, I would not press them.  Ideas are hard to come by, but not that hard.


If I'm interpreting your question correctly you'd like real life examples that translate to code. Maybe something like the following.

You want to drive or ride your bike to the ice-cream shop a few miles away. You don't know how far it is exactly but you will recognize it when you get there (while), VS You want to ride your bike 15 miles out and then return and you have an odometer on the bike (for)
You want to shoot baskets until you have made 100 attempts (for) VS You want to shoot baskets until you have made 50 successful shots (while). Outside the US, substitute free kicks.
You want to write a 15 page paper on looping in Java (for) VS You want to work on your "looping in Java" paper until you are satisfied with the result (while).
You want to boil potatoes until a fork can be easily inserted (while) VS You want to boil potatoes for 11 minutes (for).

To translate these into code you need some imagined functions for the actual activities (void boilPotatoes()).

For some of them it is useful to discuss the empty case: you are already at the ice-cream shop, etc. For others, a discussion of "at least one iteration" might be useful to have.

If you want to include foreach in the game:

You want to polish all of your mom's teacups (foreach) VS You want to polish her ten most valuable teacups (for) VS You want to polish teacups until you run out of polish (while).


The Tao of TeaChing (Making Mistakes in Front of the Class)

If I catch it quickly and can easily explain the error, I use it as an example of failing up. "Ooops, look at me, here's my mistake, here's how I can learn from it."

If students catch it, and I'm not immediately sure who is right, I make a note to do some research and come back to it in the next class.

If I don't realize it until class is over, I make sure to correct it the next day so that I don't reinforce a misconception.


Who should own the intellectual property on a program developed in classes?

Who should and who does are often different. There are laws and contracts to consider as well as "common law." In my own view, forcing a faculty member to give up all rights to the intellectual property (IP) that he/she develops is just wrong. However the law is the law. Contracts intervene. A program developed in a class for a client is normally done under contract and the client likely owns everything. But you know this going in.

However, a faculty member can't, morally at least, appropriate a student's work unless contracts are in place. Faculty member should, of course, give proper attribution for anything used and also seek permission if there is something useful to be reused. I don't think it is wise for a professor to assume otherwise.

One possibly useful suggestion is to ask the students at the beginning of a term to agree that code they write is done so under GPL or similar license. But it needs to be agreed to.

In general, though, "if you create it, you own it". That is probably not universal, but widely held.

In situations in which contract or the law do give faculty rights to IP created by students everyone is better served, I think, if the faculty member still respects the more general rights of the student. Just because you can appropriate someone else's work doesn't imply that you should.

On the other hand, if the professor provides the question and guidance in the solution, he/she may have some IP rights to the product.

For what it is worth, companies also appropriate the work of employees, but under contract. That is mostly well justified and needed, but there are some variations on it that are also immoral in my view. Preventing a researcher from ever working on the same problems after employment ends should not be allowed in a contract and such should be struck down. But, then, I'm not a lawyer or judge.

Beyond the narrow question it is possible to think "outside the box." If a faculty member normally publishes work on a website he/she can, with the student's permission, publish a student's work under the student's name. This gives the student some visibility and adds a bit of the professor's reputation to that of the student, providing a boost.

I've also heard of situations in which a student and prof go into business together based on joint work.


First, some caveats come to mind. The difference between languages isn't primarily syntax, even languages in the same paradigm family. Once a student has a solid basis of programming in a single language, say Java, they have developed a way of thinking about transformation of problems into solutions. They have ways to assure that their programs are correct and complete. One hopes, at least. Changing to a different language requires that they learn to think in a different way, whether it is small or large.

I once considered applying for a job where the focus was to be on languages (my specialty). They wisely specified in the call for applications "Principles of" not "Examples of".

The basis of my suggestions, following, is to focus on the principles, not the examples. And the principles involve ways of thinking, not syntax. It is pretty common for people moving from one programming language to another to just write in the old style. A Python program that is just "misspelled Java", isn't really a Python program. It isn't pythonic, in the jargon.

In a university curriculum there are often (or were) two courses devoted to languages: Language Principles, and Languages and Compilers. I taught both of these for many years. By the time students take the first course in the sequence they are well grounded in at least one language and have likely seen a couple more, mostly in passing.

I think you are correct in wanting to stay mostly away from other OO languages, except:

The difference between Java and Python (or Ruby) isn't the syntax. It is that Java is statically typed and the others are dynamically typed. If a Java program compiles (and you haven't used casting incorrectly), then it is type correct and will not fail for type errors when running. That isn't true for a Python program since the (still strong) typing is done at runtime, not at compile time. So, one major problem for the Python programmer that isn't faced by the Java programmer, is what tools and techniques (ways of thinking) does the Python programmer need to employ to assure that the (compilable) program they write will actually run to completion.

But, if you want students to learn to think in a different paradigm than what they learned first, you will need to give them time and experience. I think that six weeks per paradigm is probably sufficient if it is done well and fairly intense, focusing specifically on how to think like a whatever programmer.

Some possibilities for languages after OO.

Scheme (Racket) or Standard ML (aka SML). A minor point, but some functional languages use eager evaluation of function arguments (like Java) and others use lazy evaluation. The programming style is a bit different for these two cases.

Modula 2 (or Dijkstra's presentation language) or Oberon. These are for pure procedural programming. Top down problem decomposition, solution of simple problems as procedures, bottom up solution integration.

SQL and the underlying Relational DB theory that underlies it. A really different paradigm. Recent versions are Turing Complete and can be used (awkwardly) as general purpose programming languages. A chance to explore Turing Completeness and maybe even Turing Machines.

Some concurrent programming language. Maybe Rust, which is both modern and a C replacement, Erlang. Or even a data flow language like Swift -- note: That isn't Apple's language of the same name.

Some simple and uniform Assembler Language (not Intel). You need an emulator, though. A simple memory model. A uniform Register set.  Both pdp-11 and MC68000 fit the bill-- more --

Prolog  Logic programming where the program is descriptive, not algorithmic. Actually, SQL has that characteristic also. The algorithms are (almost) all built in.

Perl or bash scripting language

Lots of choices - the list isn't complete at all.

Late in your sequence you could have students work in small groups to produce a report (with examples) on some language of their choice, taken from a list that you supply. You could use a lottery system of some sort to make sure each group has a different language. The language can be wildly different, There are a lot of possibilities. I would probably include R, Self, Processing, Forth or Postscript, Bash, ... -- more -- for my own list. You could also let them make proposals for languages not on your list if they can give you a (written) reason for another language. Don't let them misspell Java, of course. And make sure a processor is available to them for any language.

I suggest that the last few weeks (you say six week terms) would be to summarize what has been learned in the previous segments and make some things very explicit. For example, dynamic v. static typing. You could also give them an idea about what a compiler might look like for a simple language, in particular the separation of lexical, syntactical, semantic, and optimization components of a compiler. A good source for the latter (instructor resource) is Per Brinch Hansen's, On Pascal Compilers. You can probably find a copy in a good academic library. Another good source (again, for the teacher) is David Gries's The Science of Programming. The latter book does an interesting thing beyond its stated purpose, which is to you how an imperative programmer should think in terms of pre and post conditions while developing algorithms. It uses a simple language for exposition that is the same as that used by Edsger Dijkstra in his scholarly papers. A compiler for this language is, like the Hansen book, quite accessible.

You obviously can't do all of this. Nor would a university course. But, I would use at least the following in developing the course.

Choose languages from different paradigms and focus on that - the deep semantics, not the syntax.

Think about all the variations open to the language designer and try to cover as many as you can. Static v. Dynamic typing. Concrete v. Abstract syntax. Strong v. weak typing. Garbage Collected v not. General purpose v. special purpose. Many v. Few abstraction mechanisms. -- more --

In going from one fragment of the course to the next, I'd think about how different the next language is from the previous. Scheme is very different from Java (no syntax, no variable state, dynamic typing,...). SML, at least has syntax and a very interesting type inference system that permits typing at compile time in a functional language.

Summarize at the end. Provide room for a lot of discussion. Have the students write reports and not just programs.


How to prepare students for bias in industry

[I asked the question. Even though I don't have the full answer, I want to share what we do, in case it is helpful.]

Role Models

Throughout the entire graduate and undergraduate programs, there are female professors and guest speakers, including women of color. In lecture, I highlight the work of all types of people.

Connecting Students to Support Communities

When surveying students at the beginning of the semesters to get their preferred name, contact information, pronouns, etc., I ask them to optionally provide demographic information that can help me match them with conferences and special programs for which they are eligible.

We encourage students to attend the Grace Hopper Celebration of Women in Computing, the ACM Richard Tapia Celebration of Diversity in Computing, Lesbians Who Tech summits, AlterConf, etc., and we subsidize their attendance. In some cases, faculty attend with them.

Fighting the Impostor Syndrome

I educate students about the Impostor Syndrome, repeatedly. I tell them that it is normal to feel overwhelmed and incompetent at times. It does not mean they don't belong in CS; it means they're being challenged. When I correct students' mistakes, I let them know that I've made the mistake too.

Direct Discussion

When an event is in the news and on students' minds, such as the publication Susan Fowler's essay about Uber, I mention it in class and provide context. (On the negative side, her experience was awful. On the positive side, people are listening to her, which would not have been the case in the past.)

In the capstone course this spring, I assigned students the following readings (which, in hindsight, were overwhelming):

Why is Silicon Valley So Awful to Women? by Liza Mundy, The Atlantic
Monthly, April 2017.
Reflecting On One Very, Very Strange Year at Uber by Susan J. Fowler, February 19, 2017.
Silicon Valley's not-so-secret bias: Ageism by Jon Swartz, USA Today, September 15, 2016.
Squarespace staffer claims exec told them "you’re so black, you blend into the chair" by Rob Beschizza, March 15, 2016.
Woman in Tech Tweets About Sexist Dudes in Tech. Dude Gets Fired. Internet Meltdown Ensues by Lindy West, Jezebel, March 21, 2013. [I chose this article for the summary of events, not the subsequent analysis. I told students they could stop reading after Richards' firing.]
Ask For A Raise? Most Women Hesitate
by Jennifer Ludden, All Things Considered, February 8, 2011.

I asked them to write a one-page essay with their reactions to the readings and suggested the following optional questions:

Are you concerned about your work environment after Mills?
Have
people ever told you it will be easier or harder for you to get hired
because of your sex, race, age, or other non-work-related
characteristic? Do you think they are right?
Why do you think people
sometimes stay so long in bad work situations?
Have you or anyone you
cared about experienced mistreatment in the workplace? Was it
remedied?
Have you ever negotiated a job offer or raise? How did you
feel about your experience?
Are there other articles on these topics
that you've read and would recommend? If so, cite and summarize them.

Their answers allowed me to discuss their specific concerns with them individually and in class. For example, some women of color worried that they would be given jobs for which they were not qualified, either directly from companies or through special programs targeting minorities. I let them know that I (a white woman from an upper-class background) got my first programming job through family connections: I was qualified for it, but there's no way I would have been considered (fresh out of high school) without connections. If their families lack connections (which is overwhelmingly the case for my students), they should take advantage of other ways to get a foot in the door, paying it forward later.

Alumnae Examples

On the day we discussed the above readings, a recent graduate came to speak about her job and how she successfully advocated for herself, such as not letting herself get interrupted and telling people when they attributed to someone else an idea that she had originally suggested.

Pre-coaching for Industry

I advised students that they should maintain a network inside and outside their company, keep their resume up-to-date, and save some of their money (if possible) so they can move if necessary. If a bad situation arises, they should consult their support network for perspective/affirmation, document everything offsite, and not blindly trust HR or management. I let them know they could also come to us any time for advice.

Career Counseling

When students are considering accepting jobs, I steer them to companies with good reputations for their treatment of people like them and where we have alumnae or friends in mid-level or senior positions who can help them. If a student gets an offer from a company I don't know, I use my network (LinkedIn, Systers, etc.) to find out the company's reputation.


Opening a machine learning course in high school

There are all sorts of things you could cover — machine learning is an extremely interesting and growing field, with many different approaches and tools you could explore.

Some of the more popular tasks for machine learning algorithms include classification, regression and clustering. Not every application fits into this grouping (e.g. AlphaGo, the Go playing program which beat Lee Se-dol).

I might suggest starting with Naive Bayes classifiers. Your motivating example here could be spam filtering; Naive Bayes classifiers were used in some of the first 'learning' spam filters, dating back to the 1990s. If your students are familiar with Bayes' theorem, the assumptions of NB classifiers shouldn't be a huge leap (you may find this derivation interesting).

There are also various other interesting options such as random forests (apparently used by Quora to find duplicate questions), support vector machines and so forth which could be explored potentially.

Many of the most 'fashionable' techniques involve neural networks, and I would recommend spending a decent amount of time with the theory. Unlike some of the classifiers and regressors I mentioned earlier, neural networks tend to be a bit more involved — a Naive Bayes classifier essentially just needs to be given some data in an appropriate form and is "plug and play", so to speak.

The (free) online book Neural Networks and Deep Learning gives a reasonably accessible explanation of neural networks in their various forms (starting with perceptrons, leading towards sigmoid neurons, gradient descent, backpropagation, deep learning, etc.). As you can imagine, there is an immense amount of content even in just the field of neural networks.

Likely you won't want to cover all of the book's topics, but you don't need to go too far to reach another interesting motivating example: classifying the MNIST dataset of handwritten digits. That's something which is relatively hard traditionally, but much simpler with the usage of a neural network.

Note that I've discussed a lot without ever actually explaining how you could write any programs. Of course, any machine learning class would be a little incomplete if your students had never actually applied their skills.

Since your students know Python, I can highly recommend scikit-learn. It's widely regarded as an exceptionally good ML library, and the API is very friendly — you can almost treat it as LEGO, and plug together the pieces needed to do your classification/regression/clustering... even without really knowing how each piece works entirely. You can get functional (though not exactly effective) solutions simply by connecting the appropriate pieces in a pipeline.

For example, if you wanted to classify some texts, you'd just:

collect some data
setup a Pipeline of a CountVectorizer and a classifer such as LinearSVC
train it, and then test it.

There's an awful lot of stuff included, but then again, all the batteries you'll ever need are included, too.

For playing with neural networks, Keras might be worthwhile.

That said, your students may derive some value from implementing the algorithms themselves, at first. The key is to be able to find truly motivating problems:

  Struggling with a project you care about will teach you far more than working through any number of set problems. Emotional commitment is a key to achieving mastery. (source)

It's not always easy if you're supervising many students, but it is worthwhile advice to consider.


Explain to someone that programming isn't just all "if"s and "else"s

Obviously your friend is using a bit of hyperbole, and in truth, however annoyed you may be by his blithe dismissal of our entire field, he may not be open to being persuaded.  You may have to resign yourself to not "winning" this argument.  From what you've written, this is what I suspect is the real answer.

For what it's worth, he's not, strictly speaking, wrong.  Data storage and branching are a huge portion of what computers actually do.

But if you still want to attempt to capture him, you might point him towards image recognition.  Sure, it's "if this then do this" in theory, but two different images of birds will share not a single pixel in common, so how do you teach a machine that can only look at one pixel at a time to identify one?

  "Computer Science is no more about computers than astronomy is about telescopes." -misattributed to Edsger Dijkstra

Of course, even if he concedes the complexity of the problem, that's still a ways away from seeing the joy in trying to solve it. I'm not sure there's truly a way from here to there if he's not interested in taking an honest look.


I have found jshell to be very useful.  It can be used to inspect classes quickly and easily.  You can import any standard library class.  You can also import user-generated classes using the /open command.  It can be very helpful in generating test cases.  You can save your explorations to a file by entering /save foo.jsh.  You can place them in a main method and you have documented the vulnerabilities in the class you created, so if something goes wrong down the road, you know where you don't have to look.

I found it very helpful for teaching about workhorse classes such as the wrapper classes, BigInteger, and ArrayList.   It also came in handy for teaching about polymorphism and interfaces.

It will be a valuable asset in the toolbox in my classes.


How to answer questions about how I became interested in programming?

If you are doing a good job of teaching then your students probably think you are smarter than you really are. They may also think that you arrived magically at your current position without effort or setback. It is good for them to know the truth. That what looks to them like brilliance was more likely just hard work and never giving up.

It is also good for them to know that the world they are entering (sometimes called adulthood, or the real world) won't always offer them what they hoped it would, but that if things are bad they will probably get better. But also, if they are good, they won't always remain so.

It is good for them to know that you are a human being who makes mistakes, admits them, and learns from them. Letting them think you are perfect is probably a mistake as they may be overly disappointed if you ever falter.

So, my advice, even to a question that may not be the best fit for this place, is to open yourself to them as honestly as you can, letting them know that it takes effort to succeed, but also that it takes plenty of desire.

It is especially useful if you let them know that some, perhaps many, of them are "smarter" than you are on nearly any scale. Whatever "smarter" really means. Just don't let them get the idea that you don't work as hard as you ask them to do.

You can teach these lessons in small bits without really taking much class time. I wouldn't devote a lecture to it, but a stray comment now and then ("I found this topic really hard when I first learned it.") might give them the confidence that "yes, it really is hard", rather than the fear that "I'm so dumb".

A few, at least, of your students might be inspired enough to follow a similar path to yours.


Advantages and Disadvantages of Teaching Block-coding Languages Such As MIT's App Inventor?

Student's Opinion

Not a definitive answer by any means, but thought that I might add what I have learnt...

I am 16, but first got exposed to block-coding at the age of 9. While I continued with more advanced forms and still make use of them (notably, LEGO Mindstorms), I grew out of block-coding very soon, and progressed to what one may call "real"-er programming languages.

That said, I'm the head of the programming/computer club at my school and have noticed that students who were first exposed to scratch (A block-coding language developed by MIT which it taught at junior-middle school at my school) pick up "real" programming languages quickly, since all the basic concepts are already known to them.

While teaching my juniors JS or C++ I'll often compare a concept to its equivalent in Scratch. That said, the obvious disadvantage is that scratch is basic, and doesn't cover advanced concepts (return codes, arguments, etc.)

Scratch and MIT App Inventor are very similar, and both are taught to my juniors at school, and students generally appear to enjoy these.

However, it is, indeed boring to those who have already had experiences with programming, and this is a problem to which you really should find a solution if you wish to move ahead with GUI-based programming languages in your curriculum.


What "process instruction" should instructors give students when assigning a team project?

Before you assign students their first team project some instruction is needed. You can't assume that they will understand teamwork any more than that they will understand recursion without instruction.

But first, you should decide on how you want their teams to behave. In this answer, I'll consider only a team structure that requires a team leader who will assign tasks and be responsible for the overall project, including the integration of the pieces done by the various team mates. This is only one of many possible team structures but here I'll stick to just this.

If this is the team structure you assume will be used, don't assume that it will just happen and coalesce without your efforts at the start and throughout. Among other things they are too likely to spend far too much time at the start on organization, leaving too little for the actual work.

The first consideration is to decide on both the teams and on how the leader is to be chosen. You can force it a bit by choosing the leaders yourself, assuming that the scale of things permits it and you know something about the students. One way that I had success with in such a situation is to use a round-robin sandlot baseball method. I would choose the leaders/captains and the captains would alternately choose team members until everyone was chosen. This assumes that the students know one another generally.

Teams can choose their own leaders, also, perhaps via an election. But make sure that the choice is made immediately and that you learn who the leaders are.

Alternatively you can choose the teams yourself, either randomly or using some knowledge you have of their abilities. It is probably a mistake to let teams just coalesce into groups of friends as things are likely to be too lopsided in many ways. You want the better students distributed around the teams as well as the strugglers.

This structure is asymmetric, with a few students, the captains, having a special role. Let them know that "equal participation" isn't the same thing as saying everyone does the same thing. People can contribute differently to a successful programming project, with some doing most of the programming, others writing user manuals, others doing research or testing. But they will need some instruction on the kinds of roles and the leaders will need some instruction about how to assign roles (or take volunteers) for the various tasks.

Let the leaders know that their job is primarily coordination and communication (with you). Encourage them to have frequent meetings with their teams, and constant feedback if there are any problems. Let the leaders know that flexibility is needed and that some members who take on a task will need help in completing it. Make sure that the leader make allowance for such things.

One way to communicate all of this to a team is to give them a few descriptions of projects that succeeded and a few that failed, with an explanation of why. Horror stories to help them avoid the most common pitfalls. And one of the big pitfalls is not having adequate time for integration of individual efforts. It isn't going to all fall together in the last few hours. Emphasize that.

And, since the team members will play different roles in the project, give them a "role book" that describes how to carry out one's own role and interact with others. But everyone should know not only their own role but that of others as well.

One of the big lessons that some of them, at least, won't have understood, is that it is a learning experience, not product development. Students can learn even if a project doesn't really build much. Put the emphasis on learning, not getting over a finish line on an arbitrary (and possibly too short) time scale.

Another thing to communicate to the captains is that if trouble arises you need to learn of it immediately. Perhaps the project needs refocusing or rescaling. Perhaps the captain will need help in dealing with a non-participant. And if you have frequent meetings with the captains (perhaps in a group) you can feed them "management" hints for the teams.

One way to have meaningful meetings with the captains is to do it with the entire class present. You and the captains discuss issues while the others listen and take notes. These can be quite short meetings if the scale is small enough, say five or so teams.

Part of the instruction of the teams, perhaps through the leaders, is to encourage team members to help one another whenever needed. A team project isn't just the sum of a bunch of individual projects thrown together.

If you intend to use peer evaluation at the end of the project, make sure that they understand that at the start. In fact, it is best to give them details, such as what precise form it will take. My own preference is to have people say positive things about the most productive members rather than to rate or grade everyone. I also require a self evaluation along with any peer evaluation: "What was your chief contribution?".

Note that this style of project is not my favorite, but it is for many.


Actually, I think a better choice would be a true functional language (Scheme, ML, Haskell) rather than a multi-paradigm language.

Of course it depends on your goals. If you really want them to learn the functional programming mindset then don't use a language that lets them escape to other paradigms so easily. F# permits programming in many ways, including imperative and OOP. So, if they have a multi-paradigm language, you can either just let them program using what is available or you can try to enforce a style that may not be natural in the language. I think this would be frustrating - more frustrating than just pushing through the needed transition of thought.

However, in a true functional language you don't have the option of just "making it work" using thought patterns you have already developed when learning a different paradigm. The transition to functional can be difficult, but it isn't made easier by letting students not do it.

If you want them to run, don't let them crawl.

I'll note that I with a bit of a library I can program functionally in Java. But I wouldn't use that as a way to teach functional programming.


How do I convince my students that visual programming is real programming?

Two thoughts:

I'd start with telling them why you think it's worth their time.  Whatever I or anyone else says on here, you're the one who thought it would be fun and worthwhile, and you must have reasons for that.  Your reasons are more authentic and probably more applicable to your students than our reasons will be. Just be straight with the kids about what they are.
You mentioned assembly, C, Java, and Python, which means that the kids not only have experience with "real" languages, but they have experiences with languages with a wide range of abstraction.  You can present DnD/block programming languages as yet another level of abstraction, in which common language structures (blocks and certain bits of syntax) are abstracted visually rather than textually.  This is not so radically different from what Python does when it visually presents code blocks as indented regions rather than as text sandwiched between curly brackets.  You can point out the similarities between the block interpreter and the Python interpreter. You can compare the power, efficiency, learning curve, and programmer time requirements for each language and maybe even make a nice chart on the board.  This will reinforce the idea that when comparing Snap! to Python to C, they really are comparing apples to apples.


How to encourage participation in the national olympiad in informatics?

Personally, assembling a team (or club etc.) of those students and teach them the relevant material would encourage most (if not all) of them to participate.

Also, finding a guide\mentor who can teach them would give the sense of, for lack of a better word, prestige.

Here, where I live, there's a national competition and it's very popular, due to the use of the aforementioned method.


I think there's one step between knowledge of HTML/CSS and writing userscripts: knowledge of Developer Tools in Chrome, especially the "Elements" tab. One demonstration students loved seeing was when I "changed" the school website. I simply right-clicked, selected "Inspect", and modified the text. I had to explain to students that I didn't really change the page but that I modified it locally and could "restore" it by refreshing, but it was a lasting demonstration, something they continued to bring up throughout the semester. (This demo also relates to what I said here about the value of CodePen because you can see your work live.)

Even if there are thousands of LoC, you can get right to where your element is and see the entire path down the "tree" to this element. One fun demonstration is to show students how to "delete" a pop-up from a site or remove an ad or some other obstruction/intrusion by inspecting the page to "search and destroy" what you want to get rid of.

Consider Bloom's taxonomy here. You have an opportunity to move up the ladder as follows: Comprehension/Knowledge (basic HTML/CSS) --> Application/Analysis (Developer Tools/Inspect) --> Synthesis/Creation (Userscripts). This progression is important to keep in mind so as to adequately prepare students for creating something meaningful of their own, and I think the study of how popular sites are structured will aid in this process. Hacking away for fun at a page may give them an idea for what would be cool to script themselves.

The teaching benefit is such that you can unleash students' seemingly unlimited creativity as they write helpful scripts for their own personal browsing experience. Yet, as you note, it does not come without challenges and must be approached methodically.


The first thing that must be discussed in the matter, is the mathematics involved.

Deep learning is first and foremost a mathematical model. An overview of this big subject is given quite well in its Wikipedia article. The page showcases a summary of the subject, as well as links to more resources (2 birds in 1 go).

To explain the mathematical model, I recommend reading this article. This gives a relatively good basis of understanding for neural networks (which are a "supertype" of deep learning algorithm). Afterwards, page 4 of the article is a good place from which to progress towards Deep learning. For example, the neural network in the image from that page:

But what if we had more than 1 hidden layer? Now that's classified as deep learning.

A short google search for "deep learning neural networks" gives this handy website. It, too, gives a brief summary of the mathematics, increasing understanding.

After reading these articles and that website, you and your students should be good to go, and start gaining hands-on experience. Usually, the basic example for a deep learning algorithm is to fit a linear function to a dataset of points.

Another article (again, found through google search) explains the subject with more specific information. I recommend reading it to gain greater understand of the subject.

Because links sometimes go broken, it might be a good idea to download those articles (they are pdf files). Then again, they were found with straight forward google searches, so that's more reliable, especially in such a quickly evolving field.


Should Java Static space and Memory Model be a part of AP CS

Static is within the AP subset and is fair game for the examination.  Oddly enough, the memory model of Java that operates here is not, so students could, hypothetically, memorize a series of arbitrary rules and be fine here.

If you think it seems silly to teach about static without at least giving a passing understanding of how memory works, then you and I are on the same page.  However, in this instance, I provide a simplified (and terribly inefficient!) view of memory usage, because I don't want to delve too far down this rabbit hole in what is essentially an introductory class.  (Especially because we haven't yet covered the all-important idea of passing this as a parameter.)

Here is a picture of the PowerPoint slide with the setup itself (sans animation).  Also not seen is another slide that says, "Hey class, when can a lie serve the truth? ... Right now!")

There are more slides, and quite a bit of discussion.  But in essence, this model allows me to ask discussion questions like:

Why are there 3 Doublers in memory?
Why is there only one count?
What did static actually accomplish?
What would happen if we called val++ from inside method(). Is there any reasonable way for Java to interpret this?
What would happen if we called count++ from inside doubleVal()?  Is there any reasonable way for Java to interpret this?

Now, as for the situation you are in, it sounds like you've already devoted a lot of time to this.  I would not spend a great deal more time on static.  There is a lot in the exam, and static is not heavily tested.  I might do one more quick attempt to try to clarify this idea, but then move on.  There is, as you said, plenty else to do.


How can I convince my fellow CS teachers that reaching every student is a worthwhile goal?

Please don't...

...give the students who are ahead more of the same kind of work to do. Please. That's just boring. If they get it, they get it.
...make groups by mixing the students who are ahead with the students who are behind - often, the students who are ahead won't teach the behind students, but will just do the whole thing themselves. I say this from personal experience, and my friends' experience.
...categorize students by listening to them, or watching them, or their friends, or anything like that. I know one of the shyest people ever in class, but with her friends, she's talkative, and excited about tons of different things. I know another person who isn't classified as "gifted" by my school, but we have had multiple very interesting talks about physics. There's also people out there with autism or Asperger's (I know one there, too) who have a harder time with some things that to us seem "normal" but are actually quite intelligent.
...listen to stereotypes (this goes with the previous point) - the girl in our school that was voted "most likely to be an olympian" is also in the gifted program, and so on. The nerd stereotype also isn't often fulfilled - I have friends who are very intelligent but also dress nicely, do not have trouble with social interaction, etc. Though of course, people can fulfill the nerd stereotype, or whatever stereotype. Just be able to see past that.
...think that those who are a little behind aren't working hard, or aren't interested. There's people out there who don't care, but those people often hide from sight those who do.
...expect less of certain groups. It is hard to rise above expectations. I remember reading about an experiment that was done, where teachers were given a student group (none of whom were gifted) and were told that a few students were gifted. By the end, they were gifted, because the teachers had treated them differently. From personal experience - I've been given assignments that were just kind of easy (for a lot of people). Did those people go for the really hard option (not provided for extra credit)? No. Why would you? I certainly didn't. Have high expectations for everyone. (According to BenI., this is called the Pygmalion Effect.)

Know...

...that reaching every person takes more work than aiming at a medium. There's no curriculum that can be created in advance that will tell you about the student who's got dyslexia, the student who's tired of school because it's too easy, the student who is tired of being looked at as average, the student who has depression...every student is different. These are people we're talking about here, with personalities, hopes, and dreams.
...I have been inspired by teachers. Why is it important to reach every student? Because you will never know what will happen when you do. I once talked to someone who was kind of interested in physics about, I don't even remember, quantum mechanics, I think. I'm definitely a nerd, so I was really excited talking about it. And they said, "You have any books you can loan me?" That was kind of an understatement =P We've had multiple physics conversations since then.
...Be EXCITED! You get to show the next generation why your subject is awesome! I know it sounds exaggerated, but people feed off of excitement. Have you ever been in a baseball game, and the whole crowd is cheering, and even though normally you wouldn't bother, you're up on your feet chanting with everybody? I have a teacher who is so incredibly excited about their class. They joke around, they jump up and they make their point, you can just tell that they love what they do. I mean, you chose this for a job. Make it fun. Love what you do, and I guarantee you people will notice.

Often, an amazing way to persuade people is by showing them. As they say, a picture is worth a thousand words (though I'd say a demonstration is worth ten thousand). So, in this case, try to show other teachers with your class. One of my teachers is kind of an amazing guy. He teaches 8th grade science. So he made up a few songs, and sang them in front of the class (which to a bunch of adolescent awkward teenagers was kind of jaw-dropping), and taught us about the layers of the Earth that way. And he told stories to make a point. I really think everyone in the class liked him, as a person at least. And he told us at the beginning of the year that every one of us could get an A, if we worked hard enough, that he would make sure of that.

And the other thing about this is most teachers, I think, know that they should try to reach everyone. It's a matter of doing it. Another teacher of mine pulled a couple of us aside and told us we were to be her guinea pigs - she was trying to start figuring out a system to start trying to reach some of the different levels of students. So I'd say, most people recognize it - then take the plunge! Ask students to help you out. In the end, though, it's the teacher's choice to do that.

Another thing I should point out - yes, there are kids out there who are total jerks, or who seem not to have picked up that yes, they are in 9th grade, and yes, acting like a 3 year old is no longer an option, but there are also tons of kids out there who are more mature than some adults. Please, don't blow us off.


Instructional Methods for In-class Code Demos

I think this depends on the curriculum and goal. If the goal is not to teach them specific algorithms, but to teach them problem solving, then have them write the code first. I come from adult education, and this approach works fine there for me.

What I do is I give gradually more complex exercises, and give them time to develop a solution. I also give them a few keywords, commands that they will likely need. I go around and help with individual solutions. They are allowed to work together, communicate, help each other if they want to. They can use the help, internet, the course book, whatever they can get their hands on.

This means a lot more work for the teacher, as you have to run around, understand different approaches, and not force your solution on them.

If I find a particularly good or interesting solution, I show it to the class (after everyone has finished).

I only solve the program in front of the class once everyone has a solution. (Pretty disappointing, but even this way I see some of them just delete their working solution and mindlessly copy mine.) I always try to emphasize there is no one good solution. There might be better, faster solutions, but as long as theirs is correct and works, it is a good solution.

As for the inevitable speed differences in the group, instead of giving one exercise, I give 3-4. The first is the mandatory, the rest is extra. (Maybe for + points or such to motivate them; luckily in adult education I don't need the extra external motivation.) When the last person finishes (or gives up) the main exercise, that is when time is up.

So I say the most effective way for teaching with sample programs is let them try, fail, suffer, find their own way, then finally succeed. Don't spoonfeed them.


Order of parameter / variables on stack in C

I haven't delved into the details, but if a language doesn't define its own implementation (few do) then the implementation will vary depending on the architecture for which it is compiled. It will also vary over time as research provides hints and clues about efficiency (both compile time and run time efficiency).
So, one stack protocol might be appropriate for one architecture, but wildly inefficient on another, depending on the registers available for the stack as well as, perhaps, paging systems, and all the rest. So, the implementer will take advantage of whatever hardware is available on the machine of interest.
The normally thought of "normal" architecture (register-transfer) disappeared in the 60's or so. It is fun to think about and to simulate, but not especially realistic. C was designed originally for the PDP-7 architecture, which is pretty much obsolete.
Also, if a compiler uses some top-down techniques derived from LL processing as well as more "normal for C" bottom up processing, the parameters, in particular might wind up in a different order. For example, a compiler might use an intermediate language that is itself compiled and who can say what the characteristics of that intermediate language might be.
It doesn't affect your question, I think, but heap implementations might differ wildly between implementations.


How to deal with students that don't like CS?

On the first day of class, I ask students how Google search can work -- returning an answer to any query over billions of web pages in a fraction of a second. Usually someone mutters "magic". I say, "That's right. What else would you call it when putting together words and symbols enables you to control powerful entities?" Computer programs, I argue, are spells, and robotics is transfiguration. The wizardry in Harry Potter isn't real, but computer science is. Whatever you want to do, computer programming will make you more powerful. (The good people at Code.org similarly call coding a superpower.) I challenge students to name a field of interest, and I tell them how computer science can be applied to it. Whatever your goals are, I say, being able to create computer programs will help you achieve them.

Within the bounds of the curriculum, try to come up with applications that interest the students, and help them keep their eyes on the prize. Stress that they're going from the majority who only knows how to use other people's programs to the minority that can create programs.

I can't say how well this would go over in a high school class, but it seems effective in workshops for high schoolers and for classes at the college level. Of course, as Aurora0001 pointed out, CS isn't for everyone, so there will be some students who don't respond well, but you should be able to capture the imaginations and respect of many students by making sure they understand they're not moving semicolons around, they're exerting god-like power. :-)


Teaching interaction design to potentially disinterested students

Engagement
Get them hooked. Find interest for them.
Give them some software, and real life items, that have poor user interaction. Have them use them, and then tell you and the class, what they think of them. What they would to to improve them.
The book The Inmates Are Running the Asylum — Alan Cooper, has some very good real-world and software examples. Including:

Doors with pull handles, and the word PUSH. Can you guess what people do?
Some software bundled with a scanner that had only 3 features, compared with the 1000s in the competitors (want to be adobe) product. It was described as the most feature rich product in its class (it had 3 features, that worked, and were easy to use. That is 3 more than the competitors).

Designing interfaces is boring for a programmer (it is the job of the artists). However “user interaction design” is not. User interaction design goes deeper, it is not about slapping an interface onto a poorly design think. It is about designing it from the ground up to be easy to use.
Computer programming is about two things. The computer, and the humans. Most of the courses are about the computer. However we also learn high-level languages, and how to write programs that are easy to read and maintain (closer to the human). We also need to get closer to the users. By making it easier for them.
Databases
From a database point of view. Imagine a database application with a simple elegant interface, easy to use, but no join. How imagine trying to find some info. Do a query, write the result to to some paper, do another query copying data from paper. However with joins, we don't need to do the remembering for the computer.
Computers should not make us have to remember stuff. Computers are much better at remembering that we are.
Get them screaming at examples of bad stuff from the “Experts”
Which button do you press to cancel? Clue: it is not cancel.

Types of easy: There are two types of easy to use: for the first-times / casual user; for the expert, that uses it regularly. Making it easy for the first-timer, will often make it harder for the expert (often having to work much harder, click, click, click).


What are good class exercises on design patterns?

Design patterns covers a broad area. I'm going to assume that your students are beginners, more or less.
Elementary Patterns
A few people have developed some interesting elementary patterns for things as simple as loops and selection: http://www.cs.uni.edu/~wallingf/patterns/elementary/
These patterns help students program at the lowest level and, after introducing the patterns you can easily come up with small exercises that see whether the students actually use the patterns to guide their programming. Any exercise that requires a sequential if structure can have the students factor out the structure as a method and apply the "Return, Not Else" pattern, for example. There are many possibilities.
Organizational Patterns
In addition to coding patterns, organizational patterns can be used to both teach beginners good skills that will serve them well in the classroom and later in employment. For example, you can consider Extreme Programming (XP) or Scrum to be defined by simple pattern languages in which the practices are the individual patterns. Some of those practices may not be appropriate for beginners, but others are just good practice. For example, Pair Programming and Test First Development work well together and help students solve their programming problems. An in-class exercise in which you let students practice just those two skills under your guidance is, in my experience, very valuable. I've also presented larger projects to students as a deck of "stories", the Product Backlog that gives beginners an overall decomposition into the parts of the solution they need to build. Often this is better than a narrative explanation of the problem when the still have no design skills.
Classic Patterns.
Many of the classic patterns are amenable for use in the beginner's curriculum. They will likely do these things anyway, but by formalizing the discussion of them introduces them to the value of patterns. For example Iterators are now ubiquitous in many languages. If you are doing GUI programming then the Observer Pattern is now standard. At a slightly higher level Model-View-Controller (MVC) can be discussed. This gives you a good way to discuss separation of concerns in programming. You can also organize your course so that you make it clear that, say, at the beginning the students build a Model without concern about how it is manipulated. It has a public interface of a few methods only. Then, once you have a model you can talk about the possibilities of (perhaps multiple) views and the associated controllers. But this is an organizational issue about the course. If they have to just build everything, they might wind up with a "Big Ball of Mud" (a pattern in fact, but not a good one).
Once the students are familiar with the idea of patterns you can introduce them to more complex ones with many parts. I find the Strategy and Null Object patterns to be useful in teaching polymorphism. With these patterns you can modify the behavior of an object dynamically, which leads you to program by composition (an object has interesting parts), rather than by inheritance. For example a situation in which an object must perform in one way the first time it is sent a message, but otherwise thereafter can use strategies, formalizing the behaviors, without using ad-hoc if-statements.
I realize I haven't given you many "exercises" here. My suggestion is that you can adapt many/most of the ones you are already familiar with to the use of patterns.
Pedagogical Patterns
You can also formalize your teaching methodology using patterns, so that your student interactions are guided by well-tested methods (patterns) that can make you a better teacher and make it obvious to you (and maybe to your students) why you do the things you do in the course.


I believe that after getting to know html and css, starting with Vanilla JS or with a framework are both the same thing to a new student that knows nothing, he'll be learning new things from the beginning so if you think learning a framework is more valuable than starting with Vanilla JS then go ahead start with a framework.

When it comes for professional working, most of the jobs require working with frameworks.

Now some people will ask "but how do you want to teach them a framework without giving them the basics of JavaScript?". That's a wrong question. Again, to a new student they both aren't related. Vanilla JS is not considered the basics of a framework, the basics is JS yes but why not learn JS through the framework. PS that's how i learned about the new ES features, started with react native directly.


Basic OOP practice exercises for inheritance and polymorphism

You could have a hierarchy based on an abstract class or interface Car, with implementations/subclasses for ElectricCar, HybridCar, GasBurningCar, etc. This illustrates that there can be very different implementations for an interface.

Each class would have different additional members. For example, a GasBurningCar could have a maximum amount of gas (in gallons or liters), represented as an int or double, or it could have a field of type GasTank. Having members gives students practice with has-a relationships, in addition to is-a relationships.

You could discuss trade-offs in whether an individual car model, such as Prius, should be an instance of HybridCar or a subclass.


Online Platform for practicing Object Oriented Programming in Python

replit.com allows you to code online and you can also set up tests for the repl, as well as embed the code into a blog or lms.
I've an example here based on a tutorial here. You'd need an account to "collaborate" but the images are below.
The code runs the main.py file when the "Run" button is activated.
I made a Point class in point.py and this is called from the main in main.

There are other features such as version control, sharing for collab, database, forking etc.

Repl introduced classroom some time ago- the demo video shows some of the capabilities for assignments.  Last year this was replaced by Teams for Education.
While better, it is not free, but there is a 4 month free trial- you can see a demo of this "update" here.
Each student "gets their own copy" of an assignment, and the interface is quite pleasant- they can see due dates, status etc, and you can build in unit tests that they should pass before submitting an assignment.

Github classroom (demo here) is another option but may not be the easiest to start with.  Using repl you could at least share code and have the class make their own repls and write code to pass tests, or code a class given a class diagram or problem statement.
Hope this helps.  Not exactly OOP Codingbat but might give you some ideas.


Which topics should one cover in teaching a course titled “Artificial Intelligence and Machine Learning”?

Here's my proposal.

A little bit of math to "refresh" the concepts needed in the next module.
A little bit of statistics. This is my opinion can be used to analyze data sets from a statistical point of view, useful for some machine learning trained algorithms.
The basics of one programming language you want to use across the course. Not knowing all the details I would say Python because there are a lot of libraries for ML available.
Main neural networks and examples.
Expert systems. Not very much hype about these currently, but in my opinion a good option.
Machine learning algorithms and examples.


Teaching coding paradigms and concepts with specific context

Based on my two years of involvement with FIRST, I have a few suggestions:

Teach students to read the documentation. This site covers Java programming for the 2017 FRC Control System. FIRST programming, while requiring general programming skills, is specialized for the roboRIO and for the competition as a whole. We ran into a couple issues this year whose solutions were found by methodically reading through these documents. There can be a rush to jump right to coding, but it is essential to understand the WPI library and its API fully. This also serves the purpose of seeing which programmers have the discipline to follow documentation to the letter. Having the patience and thought to do so is a necessary condition for being a successful programmer.
Use a simple chassis for coding/driving practice. Each year's game has its unique twists and challenges. However, underneath the superstructure  is a drive base that in many cases can be used from year to year with slight modifications. Treat this as essentially a learning robot. Give it working code, let students drive it, then teach the code itself. Make changes from one run to the next. Since the code has immediate, real-world consequences, show the results of minor changes in action. This way you can then go back to the classroom/IDE knowing that students have a context in which to operate. Have them observe and reflect on what happens from run to run when one variable, say, is changed.
Research other teams' code. Most, maybe all, strong FRC programs have well-developed websites and numerous GitHub repositories. Look at best practices from these teams. Reach out to them. Have students try to read and understand their code.

Ultimately, students need to know Java, and understanding classes and objects, inheritance and polymorphism, will be as needed with FRC as anywhere else. However, to help them see how Java applies specifically to FRC, start with something that drives and work backward from there. Maybe start with #2, move back to #1, and lead them to #3, maybe even with examples you have found of how teams use the WPI library in different ways.


I think that the assumption of the question is overly deterministic. I am also pretty sure that I'm a living counter-example, though my case won't prove much. I was a terrible student into about 10th grade (say age 15), especially in math. My teachers once wanted to hold me back because I hadn't learned my multiplication tables. A plane-geometry class was my first positive educational experience of any kind. A bit later, a writing course appealed to me. Up until that time, I would rather have been anywhere but in school.

I was also told once, in high school, that, based on a standardized test, I probably wouldn't be successful in College and so should set my sights lower.

I later earned a PhD in Mathematics.

But there were no jobs for mathematicians at that time so I taught myself programming, with plenty of halts and stumbles. Then some deeper Computer Science. Still later I was lucky to have been mentored by some of the CS superstars in education.

But my early history would predict none of that, nor were my teachers particularly enlightened when I was young.

I worry about the question from another standpoint also. I don't think many individual teachers have much power over the overall curriculum. Groups and associations can make a difference, however, but this site doesn't really help with that sort of question.

However, if you are a teacher, you must not have a defeatist or deterministic attitude about your students: they can't learn so why bother. Every student in front of you, given some desire, can learn. You  have to be there to help them. You may even need to teach them how to learn in general, since their background may be like mine was. I eventually got desire, and the rest followed. Your job as a teacher is to educate them no matter what their background, be it advantaged or disadvantaged. The prime directive.


Is it OK to use "informal" systems such as TeamSpeak or Discord to support classes?

We've been using Discord as a central place for all class discussion, and Zoom only for live lessons (rare) and small group meetings, and unpublished YouTube links for most lectures.  So far this has been working quite well.  If I'm totally honest, Discord may be the best part of our workflow.

Discord gives a nice sense of community and comity. Its informal nature is a real boon to keeping class spirit alive, with reactions and animated gifs easily accessible.

You can "pin" important announcements so that they stay at the top.

It also allows for code formatting for short code excerpts just like here on StackExchange, with ` around text to get this effect:

You're using x in your function, but shouldn't you just call getRemaining() instead?

And you can format code to any language using three backticks and a language nane

```scheme
(define nekst (cadr (last lyst)))
(perform-func nekst)
```

That will create syntax highlighting in a Discord comment, and you can replace scheme with the language of your choosing.


Should he start learning Java on his cell phone or would he better off learning how to program Java on his PC?

These aren't your only options.

IMVHO, Java, especially Android, has a pretty steep learning curve. I would recommend starting with something like Processing to learn the fundamentals, and then I would use those fundamentals to transition to core (desktop) Java. When you have a good grasp on that, then I'd move to more advanced topics like mobile development.

Since you've tagged your post with curriculum-design, here's how I would design a curriculum. I would split it up into at least 3 different courses:

Course 1: Intro to Programming. Use Processing to introduce the fundamentals: functions, variables, loops, control flow.
Course 2: Advanced Programming. Use Java to introduce OOP, inheritance, data structures, algorithms. (In the US I believe this is the standard AP CS class?)
Course 3: Mobile Development. (After course 2 you can branch out into many topics, not just mobile development.)

That's my two cents, but I know other people approach it from other directions. For example I know many folks teach web development first. And Google has at least one curriculum that uses Android to teach the fundamentals.

The question of how to learn the fundamentals of CS has been asked here a few times before, so I'd recommend starting with a search. Here are a few posts to get you started:

How to teach a person to enjoy programming?
Programming language for teenagers
Order to Teach Topics in an Intro Programming Class
Explain to someone that programming isn't just all “if”s and “else”s
Programming languages specifically designed for beginners
Using Processing as an entry point in an Introductory Course

There are many potential paths through computer science education, and I think the best thing you can do is try a few out and see which one works best for you.

Also, like Buffy said, you probably don't want to program on a cell phone. Even if you're programming a mobile app, you're almost always programming on a computer, and then exporting the app to a phone.

Shameless self-promotion: I've written a series of tutorials that take you from Processing all the way through core Java and onto web development and Android, available at HappyCoding.io.


Why and how is it efficient to process sorted arrays than unsorted arrays?

First, it is not "well accepted" that processing sorted array is more efficient. It depends on what you do. If you spend your time inserting, for instance, then sorted arrays are not necessarily a good choice. You are better off inserting at the end (say if you have resizable arrays such as Vector<X> or ArrayList<X> in Java), and then sort afterwards (you'll pay $O(N*log(N))$ instead of $O(N²)$).

It is true that if you don't have insertions (or very few insertions with respect to searching or other operations for instance) then it is more efficient.
If you want to find an element in a sorted array, you can use binary search which is $O(log(N))$ while if your array is not sorted you have to scan the whole thing which is $O(N)$.

Likewise if you want to perform set operations on two sorted arrays (intersection, union, difference), then doing so on sorted Arrays is linear. If they are not sorted you will be either quadratic (naive algorithm) or have to use an auxiliary data structure (such as a hash table).

Sorted arrays have the same complexity for these operations than the more involved tree structures (AVL or red-black trees) and they have a very compact and simple representation. But you pay the price that insertion is more expensive, since it has to maintain the order of elements.


How to teach a flipped course based on the AI MOOC?

I've hated the term flipped classroom since I first heard it. It was as if those young kid teachers invented a new way of teaching that us old folks could never have done.

We had flipped classrooms back in the day - it was called homework. When the history teacher said "watch the debate" - flipped classroom. Reach Act IV of the play? - flipped classroom. Reach Chapter 5 and try to do exercises 1-3? - flipped classroom.

So, you'll have similar issues with the MOOC but your homework are the videos and related content.

Some thoughts:

Will all the kids watch the videos? How will you handle it if a number don't or if they superficially watch it. There are embedded exercises but you can still "skim" the video and get through those. You'll want to have a plan if this happens.
The lectures are pretty good (I went through the MOOC when it first came out) but there are a number of holes and ambiguities. If you haven't already, go through all the videos with a teachers eye and you'll find a number of holes that the kids can fall through unless they think exactly the same way Norvig and Thrun are teaching.
This may have changed since I went through the MOOC but it was designed for individual participants working in isolation. Most of the exercises and the programming assignments thus are solo you'll want to work out group projects in advance to supplement what they're asking.
This also might have been addressed but there were a number of ambiguities in the lectures (depending on ones interpretation) which became clear after doing the online quizes (and depending on your interpretation, maybe getting them wrong) - this can be disheartening for a kid - you want to prepare them for this.

That's all I can think of for now.


The cheating issue is real, and it caused me to rethink how I approached labs entirely. I think of them as learning laboratories now, and don't give them a tremendous weight in grades (though I do spend a huge amount of time grading them, as I grade during code interviews.)

If you want some context for my approach, I have previously outlined some of the ways that I think about lab work here, here, and here.

In general, though, I come to the grading with the expectation that there will be many rounds of refactoring.

This year, I started a new procedure, and it has worked very well for me and my students. It utilizes my school's SMS (we use PowerSchool, though I imagine that any online grading system would have similar functionality.)

At our first code interview for a lab, I walk through their code in depth with them, and ask them to explain their approach (big picture) to me verbally. If they start  walking through their code like by line, I stop them and ask for "just an overview". They are allowed to look at their code as they talk, but I don't want a play by play. (Students who have trouble with this raise some potential red flags for cheating.)

I also create a wish-list of comments as I go. "It would be better if you...", or "This code is not clearly written because...". I notate all of these in the comment field for the lab's grade.

As the interview gets to an end, I put on my best unforgiving professor hat, and award a rather punitive grade. So now, the student hasa 33% (or some other vileness.)

Then, in the comments section of the grade, I put on my kindest professor hat, and imagine what grade I would give if they came back in week with all of the problems fixed. Students with better initial labs might wind up with higher grades here, but everyone has rather high grades available.(*) I also leave in the list of problems that should be fixed.

Now, the students have to come back to me with the problems all fixed to receive the higher grade.  I can draw this proccess out as much as I want in order to ensure that my students produce beautiful, clean code. I don't change the grade to the higher one until the code is wonderful. (This may take several attempts.)

(*) - Not cheaters. If you work through my extremely forgiving system and still cheat, I will give you a zero for that section with no way to make it up.


Ruby backend framework choice: Ruby on Rails vs Sinatra

Personally, I'd introduce Sinatra first.

Which one of these is going to be easier to explain? Sinatra's "Hello World" example...

require 'sinatra'

get '/' do
  'Hello world!'
end

Or all the boilerplate that Rails generates...

$ rails new commandsapp
 create
 create  README.md
 create  Rakefile
 create  config.ru
 create  .gitignore
 create  Gemfile
 create  app
 ...
 create  tmp/cache
 ...
    run  bundle install

(and that's just from the script that generates everything!)

I would imagine that Rails would feel a little bit overwhelming for a beginner to web development. It brings a lot of baggage with it, like the MVC pattern and a lot of handy generators that are useful to experienced developers, but hide the logic to a learner.

It seems logical to me to teach using Sinatra first, and then let your students realise what the problems are. They'll be more inclined to go through the process of learning Rails, with all the extra boilerplate involved, if they see why using an opinionated MVC framework is useful.

For trivial backend applications, like you'll probably be developing at first, RoR is overkill, and there are too many concepts that you'd have to teach before actually getting to make anything. I'm a fan of teaching from the basics in this case—showing why each additional layer of libraries and frameworks is needed is far more valuable thank saving some time by skipping Sinatra. And, of course, the motivation to make something can be more easily satisfied by starting with Sinatra, and you can later introduce the 'batteries included' framework of Rails.


Pick-me-up exercises for after-lunch brain death

Some conferences actually have "nap time" right after lunch. Let people nap if they like or catch up on outside tasks. Such conferences are usually residential, of course, so a nap is a real option.

A lecture immediately after lunch is going to lose a lot of people, as you say. Your teaching should account for human nature of course. But an active learning session - say role playing an algorithm - might work. If you have to hit them hard for the complete two days (no naps, no games), make sure that it isn't all just lecture and powerpoint. They will be too passive and will zone out too often. Break it up: lecture, discussion, exercises, role-play, feedback, pairing, group work.

Even a discussion session after lunch would be better than a lecture. You can pose a question to the class about some related topic, preferably one that might generate some differences of view. It could even be somewhat orthogonal to the topic of the course. If the course is about programming, make the question about software process. A simple strategy to start might be to elicit their experiences in development.

You don't win, nor do they, if you lecture beyond their point of caring.


I would suggest that you start each "session" with each one of you going over what was learnt in the previous session. Devote ~15 mins for it.

This is not in spite of the fact that you "don't have a ton of interest in each other's topic", but because of it. This "review" of the last session gives, as I see it:

You are exposed to some other field. Who knows? you might end up finding interest in it. Even if you don't having someone listen to one's recount of one's learning provides a platform for a sanity check. The person telling their friend checks each part of what was learnt, as they talk.
It makes it easy to "get back in the game", and you continue learning after those 15 minutes, as though the previous session was just moments ago. This is especially useful, and is overall what makes this suggestion worthwhile.

Plus, showing interest in what your friend is learning is nice, and no one1 ever got hurt from learning something new in an unrelated field.

To elaborate on what I wrote as 1. above:

The sanity check and telling about what you learnt are also useful, because ideally, you'd lower the stem of details. You'd want to keep it to examples and simple explanations. This is extremely good for your own learning2 because as you explain the material, after reducing the number of details and making it simple, you focus on the core of what you learnt. It might be difficult at first, but that's why you each have 15 minutes. Don't be afraid to extend it to 20 if need be. This is a very important part of my suggestion.

Over time you'll be able to extract the core of the material more quickly, and that's a useful skill, unrelated to learning in pairs.

I highly recommend this technique (you can modify it to your hearts content; I won't hold it against you :P). I employed this method with a friend and, although we were both studying CS (but different branches; I was studying machine learning and statistic approaches and he was studying networking), it was very useful (also self-learners ;)) to both learning the subjects and the aforementioned skill.

1That's probably incorrect, but it's highly unlikely that listening to what a friend learnt in accounting would do any damage.
2and for your friends, when they talk about what they learnt


Is it more effective to teach low level languages before high level ones or vice versa?

Well, straight-forward: It depends:

If the low level language you are thinking about teaching has complex code paradigms and is very abstract, then teaching it first would not be a good idea.
However, if your low level language is one that caused newer, high level language to be created, then teaching the low level language can aid the students in understanding some core concepts of the newer language. They might be able to spot those concepts in other languages, too (making a sentence like "oh, just like in <insert low level name here>!" quite common)

Personally, if I faced a low level language like the one described in 2, I would only teach a few things. The students needn't be "fluent" in the low level language, as it isn't widely used in the "career market". I am not quite sure how widely C is used, but I am pretty sure that it is used less than C# or java (and certainly less than python).

So in essence, knowing the main ideas of the low level languages can be useful, but it is less important and useful than knowing high level languages.

As for a foundation for building knowledge, it goes back to teaching the main ideas of low level languages (rather than teaching the entire language), and then teaching the high level languages.


Does teaching an intro course with a functional language really help level the playing field?

Let me mention, at least, another dimension to this. There are various functional languages and some of them are closer to what your students may have in their backgrounds. A language with dynamic scope and abstract syntax is a very different beast from one with lexical scope and a rich syntax.

The only functional language that I really worked at was ML and I got quite good at it. But I learned that I really want the concrete syntax that it offers as an aid in my thinking. The underlying concepts are the same, of course, but I'm pretty worthless in Scheme. But then, I didn't learn Emacs from my mother as many schemers seem to have done.

So, if you want to level the playing field then I will guess that you want something as unlike their previous experience as possible. Say Scheme, rather than Haskell.

However, some students will pick up the new ideas faster than others no matter what you do, so it is good, in my view, to take advantage of that.

And of course, if you are going to do something very non-standard, make sure that you have the necessary expertise first. That isn't a situation for staying one chapter ahead in the book as some instructors are forced by circumstances to do.


How should I handle over-demanding assignment providers?

We run projects with real-world clients from within our school building.
I would add to Buffy's beautiful answer one idea that we've communicated to the clients that our students will be working with:

As gifted and wonderful as our students are, recognize that they are still students, and the primary purpose here is educational.  The work that your group does should not be mission-critical.  An ideal project is in the nice-to-have category.
If you have discussed doing something more significant with your group, and they understand the challenges and are willing to undertake the project, then we will not stand in the way.  Such projects can be valuable learning experiences!  While we do provide support and oversight to the project groups, our ultimate target is learning.  Please be prepared to provide extra support as needed if you are relying on the outcome.

I think this nicely captures an important aspect of internship projects.  They can be useful.  Heck, ideally, they should be useful.  That's part of what makes a good internship so motivating!  But students are still developing their skills, and the results can be uneven.  I wouldn't rely on it for mission-critical pieces of my work.


Dealing with students who complete labs very quickly

I have 3 tiers of labs.

First are the required labs. They're worth 100 points each and every one must do these. If they don't do one, it goes in the gradebook as a zero. These are also the labs that I think are the best of each topic for practicing what they need to work on. My calendar is based on how much time I expect 90 plus percent of the students need to finish this set.

Second and third tiers are bonus and challenge labs. They're worth 110 and 125 points respectively. If a student does these they go in the gradebook. If not, the grade is omitted so there's no penalty for not getting them done. These tend to be extensions of the required labs, but might be a little more difficult.

Generally the students that are the fast finishers are also the ones that like doing the labs, so throwing a few more their direction will keep them working. Plus, it's an AP class so the 10 or 25 extra points on a lab grade will be a motivator.

I also have a page with a list of websites they can go to if they're finished with all 3 sets of labs. It links out to sites like code.org, codecademy, Code Combat, and CodingBat. Sites that are related, but a little more fun than just cranking out labs.

And I'll also let students come up with independent projects to work on.


Is the CRT still relevant when introducing display hardware

I haven't taught about analog television but thanks to my gaming related experience (both as a gamer and game development trainer) I know that the topic of horizontal and vertical sync is very important for understanding one of the more core things of computer science, the display. Further, I am all about the cutting edge stuff.

Yet, when it comes to getting the concepts of display, I am all for going to the roots, and CRT is by far the easiest way to explain these things. So, to answer your question, yes, the analogy is still relevant. And going further, It will and continue to be the starting point for studying this display stuff.

Eventually, you will have to upgrade to modern screen but CRT is definitely the go point on the table.


How to handle students who excel at coding but aren't interested in theory

I suggest 2 possibilities:

Talk to them. Explain that at some point, they won't be able to rely on just being able to code well. For AI theory, at some point the algorithms are dependent on so many parameters, making it impossible to write working code without knowing what each parameter does. (A simple example for this is neural networks. The simple ones have ~5 or more parameters which need to be fine tuned). If they know the theory, then they'll be able to write good code much faster, with fewer bugs and mistakes.
Throw them in the water. If the other approach doesn't work then you can just give them an assignment, an assignment to show them that they simply can't go too far without learning the theory. I personally like examples from machine learning theories (Also, it's one of the fields I'm more familiar with). If you ask them to write a genetic algorithm, they'd quickly find out that they need to learn the various methods in the field. They'll be lost without learning those. The same is true for anything in the field of Deep Learning. If you give them such an assignment, and let them work on it for a while, they might produce results that are not too bad. However, if they were to read and learn the theory, they would produce far better results. As pointed out, it's important to give them an assignment that is authentic, and preferably something that is used in "real life" (like advanced search algorithms, which require heuristic functions, which in turn require1 knowing some theories)

The main idea is stressing the necessity of knowing the theory, and making it clear that as the project becomes more complicated (and as the project they make are at higher levels), the need to know the theory grows exponentially.

Another nice example is heuristic functions. Most students find these very difficult to learn and use, without in-depth learning of the theory behind it.

PS:
I used to be a student like the ones you described, and I went through 1 (self-reflection-ish) and 2 and I fully understood that theory is necessary.

1Well, maybe not require, but sure makes it easier and faster to write and debug.


A beginner example of xor, that is functional (does not switch to procedural)

I can't tell whether I've missed something in the other answers or comments, but the natural language equivalent of XOR is to ask "is there any difference?"

Used in a sentence which follows the broad format of those in the question, you'd be saying something like "the light is on differs-from the door is open", with the compound 'differs-from' element being the XOR operator.

Even in computer science, the XOR and XNOR operators typically go by other aliases, such as Not-Equal and Equal operators, respectively.


Interview lesson on "Computational Thinking"

I would like to suggest my absolute favorite lesson from my intro to CS class. I usually teach it over two class periods, the first being "unplugged" and the second on the computers, but I think you can cut some corners and still offer a valuable experience.

Overview: "How do computers sort things?"

I start by asking what computers are good at. The answers vary a lot and you usually have to guide them towards "counting", "adding/subtracting/multiplying/dividing", "true and false" and "comparison". If you've done a unit on binary, it's helpful to link that in with the last two and let them show you why it is so easy.

Then I talk a bit about how sorting is absolutely fundamental to Computer Science. I spend a little time explaining how almost any significantly complex program they have ever used will sort something at some point. It's a great algorithm to start with because it is so visual and so intuitive.

So we're going to have a tournament to see who can sort the numbers from 1-16 the fastest. At this point I have them fold and cut a piece of paper into 16 pieces and number them, but in the interests of time, you should do that yourself and just bring in enough sets for ((the number of kids) / 2).

Pair off the students and give each pair a set of numbers from 1-16 and tell them to put them in a line in front of them in random order.

One partner is going to be the "computer". They can not talk and they are "blind" (they can not arbitrarily choose specific numbers). They can only point to two pieces of paper at a time.

The other partner is the "program". The can only say "switch" or "stay".

The partners have to come up with an algorithm such that the "computer" points at two numbers at a time and moves from one pair of numbers to the next pair in a consistent and logical fashion. The "program" tells the computer whether to switch those numbers or leave them where they are.

Almost all of the groups will come up with bubble sort. Occasionally, one group will come up with selection sort.

I put them in head-to-head competition, with the numbers randomized the same way for both groups to keep it fair. Winners play winners until the champions are crowned. Usually there is some sort of prize at the end (chocolate goes over well with 13 year-olds :)

Second 30-minutes:

Here is the crux of the problem for you, as you mentioned: they don't have any programming experience or accounts. So my recommendation would be to ask them to set up Scratch accounts for the students in advance, or (possibly even better) you can just set up 15 "test" accounts and have the skeleton program ready to go in each one.

I am a big fan of pair programming, so I keep them in the same pairs that they were in for the competition. I set a repeating 4-minute timer on the board to change the "driver" (on the keyboard) with the "navigator" (helping figure it out).

I ask my students to "remix" this program: https://scratch.mit.edu/projects/125507639/

But for those that need a little more scaffolding (or have less time, like yours), you could include a little more code, like this: https://scratch.mit.edu/projects/125587510/

Their goal, obviously, is to sort the blocks. How much you let them struggle and how much help you give is obviously up to you, but I can not express the satisfaction you'll get when you start hearing the shouts of "I GOT IT!". I like to err on the side of the struggle. I try to explain that if they are not frustrated, they are not learning - they're just doing what they already know.

If they are done early (or want to continue with a harder challenge after class), they can try the "sorting 300 starter" in my Scratch Shared Projects. It allows for more a random assortment blocks, negative numbers, etc.

Once most (or all) of the students have a working program (or you have 5 minutes left), bring them back in to talk more about the power of sorting.

What kinds of things do we sort all the time in our daily lives?

What if you are sorting REALLY HEAVY objects (buckets of sand) instead of just pieces of paper? Would you use a different algorithm? Why?

You can also show them this great visualization of different algorithms: https://www.toptal.com/developers/sorting-algorithms/

If you have any questions at all, please feel free to contact me!

Good luck!
John


First, Critical Thinking is a deep concept and in a first course only simple aspects of it can be taught. To explore the depth of it you need to have context and a novice, by definition, has little of that. See Wikipedia for a start on understanding how broad and deep Critical Thinking really is.

To me, the most important question to be answered by Critical Thinking is "What should be built?" (and what not built). But a novice has no basis on which to answer such a question. They have enough to do to try to understand what can be built at the start, so you can only give a glimpse of the deeper questions then.

I would suggest that any true education explore Critical Thinking in many ways and in many courses - philosophy, history, .... And that later in the CS curriculum the topic be taken up, again in several courses/classes to explore its complete depth.

However, the detail in your question seems to indicate that you are more interested in Deep Thinking rather than Critical Thinking as such. I'm a big believer in teaching problem decomposition and abstraction from the first days. My courses delay if and while constructs for as long as I can manage while the students think about abstraction and polymorphism. I don't always do it, but prefer to teach recursive thinking before loops and polymorphism before selection. That is true even in a course in Java. It doesn't require Scheme.

But some aspects of critical thinking are useful to novices. For example, the idea that if what you are doing isn't working, then do something different. Also "Ask for help" when you are stuck. "Don't make assumptions" is another good idea that can be taught fairly early. "Test your assumptions."

Ultimately you want them to use evidence based decision making, of course rather than wishful or magical thinking, but that, as I said above, requires context and some "seasoning." Novices are naturally focused on the "how" rather than the "what" - especially the "what is appropriate" and "what is important."