[From your comment] P.S need such combinatorics after which I can understand the course of data structures and algorithms.

Combinatorics doesn't factor into data structures and algorithms in this way. If your goal is to understand data structures and algorithms, combinatorics is an irrelevant topic.
Combinatorics is also quite vague, as this can effectively include the integer number sequence, which is effectively "knowing how to count".
While software development will generally expect you to count numbers from time to time, there's a vast difference between counting and the subjects that a book on combinatorics will delve into. Again, the latter is irrelevant to get a basic understanding of data structures and algorithms.

Is there a good book for combinatorics for programmers?

As far as I'm aware and my research could uncover, there is no such book tailored to software engineers. The field of combinatorics is not part of the field of software engineering. Combinatorics is a part of maths, not CS, and therefore is explained in a mathematical context.
Note that it is true that early examples in CS training courses often use simple maths. However, this is done purely because students will generally understand the simple maths and therefore are able to fully focus on the programming challenge without being distracted by the mathematical operations in the example.
If you are able to count and perform elementary operations (+,-,*,/) then you have enough knowledge to learn to program. Additional mathematical operations may be a nice-to-have for more advanced examples, but they don't require in-depth mathematical skills. If you passed high school maths (based on my experience, you don't need anything above the math 14-year-olds are taught in school), then you are as prepared as you need to be.
Obvious caveat: Unless your intention is to delve into programming specifically to tackle more advanced mathematical calculations. But that's not what a learner should be focusing on.


How to answer "functional programming is useless"?

What can I use to show the usefulness of functional programming?

This is the wrong question, and by trying to answer it you're falling into a trap of accepting and reinforcing the students' misunderstanding of what university is. If I had applied that standard of value to the courses in the bachelor's degree I studied, I think I would only have attended 30 hours of lectures over the three years.

You may be right that most of them will not end up earning their living by programming in functional languages, although given current industry trends I wouldn't be entirely surprised if you turn out to be wrong in the long term. But if their goal is merely to gain a superficial knowledge of whatever is currently popular in industry, they're not just in the wrong course: they're in the wrong institution, and should drop out and find a bootcamp.


One example which is actually relatively common in everyday life, especially for people who do a lot of traveling (e.g., backpackers and some business people), is the knapsack problem. The applications section gives several other fairly common situations where this problem is encountered. The Wikipedia article also lists a few methods that can be used to determine a solution, but especially for relatively simple cases, something like the greedy approximation algorithm can be implemented fairly easily, and often works relatively well.
Nonetheless, as that algorithm section states, a basic greedy algorithm may sometimes be far from optimal. I don't know of any examples offhand, but I suspect it should not be overly difficult to construct (or perhaps find online) a relatively simple one that would help to illustrate this point to your students.


Self Learning Quantum Computing and helpful resources that can aid, guide and teach Quantum Computing from CS&E perspective

The answer written here has been referenced from some of the leading Quantum Computing research Journals or Publications. The interested readers are advised to visit their website in order to get the rough idea of research trend and field segments before self reading Quantum Computing.
The publications/journals include -  IEEE Quantum, Quantum Information Processing by Springer, Journal of Quantum Computing By Tech Science Press, Quantum Journal and Quantum Computing by IOP [1, 2, 3, 4, 5]. Trends were mainly picked up from Google Scholar, ArXiv Open Access Repos and Online Courses by Reputed Universities.
The interested enthusiast may start from the notes/cheatsheets before moving to books/online course videos.

Methodology
Books were given preference over paper as it can be more helpful for a self learner or anyone needing assistance/help in the field. The main books are solemnly chosen on the basis of higher citations (quality and research impact), whereas reference books on the basis of citations (atleast more than 50 for the given topic) as well as date of publication (newer material given more preference). The order of listing is on the basis of citations only!.
The answer includes video material/courses as well as papers/cheatsheets that'd be helpful for a beginner in an arbitrary order and not in any preference!

Cheatsheets/Notes

Microsoft Research - Quantum Computing

Books

Quantum Computing and Quantum Information :

Quantum Computation and Quantum Information By Michael A. Nielsen & Isaac L. Chuang

Reference Books:

Introduction to Quantum Computation and Quantum Information By Hoi Kwong Lo, Sandu Popescu, Tim Spiller

A First Introduction to Quantum Computing and Information By Bernard Zygelman

Quantum Networking :

Quantum Networking By Rodney Van Meter

Reference Books:

Schrödinger’s Killer App Race to Build the World’s First Quantum Computer By Jonathan P. Dowling

Quantum Artificial Intelligence:
1.Quantum Machine Learning By Siddhartha Bhattacharyya, Indrajit Pan, Ashish Mani, Sourav De, Elizabeth Behrman, Susanta Chakraborti (Eds.)

Reference Books:
1.Supervised Learning with Quantum Computers By Maria Schuld Francesco Petruccione
2.Quantum Machine Learning What Quantum Computing Means to Data Mining By Peter Wittek

Quantum Optics:

A guide to experiments in Quantum Optics By Hans A Bachor, Timothy C Ralph

The Quantum Theory of Light By Rodney Loudon

Simulations and Hardware:

Quantum Optics for Engineers By F.J. Duarte

2.Dancing with Qubits By Robert S Sutor

Quantum Error Correction and Fault Tolerance :

Quantum Error Correction - DA Lidar, TA Brun

Quantum Entanglement:
1.Geometry of Quantum States: An Introduction to Quantum Entanglement By Ingemar Bengtsson, Karol Życzkowski

Important Papers/Resources on Quantum Mechanics

A. EINSTEIN, N. ROSEN and B. PODOLSKY, Phys. Rev. 47, 777 (1935). Can Quantum-Mechanical Description of Physical Reality Be Considered Complete?;

Introduction to Quantum Mechanics By David J. Griffiths

Spontaneous parametric down-conversion

Courses/Video Lectures

Quantum Information and Computing
Quantum Computing

Bibliography

IEEE Quantum. https://quantum.ieee.org/
Quantum Information Processing. https://www.springer.com/journal/11128
Journal of Quantum Computing. https://www.techscience.com/JQC/index.html
Quantum - The open journal for Quantum Science. https://quantum-journal.org/
Quantum computing. https://iopscience.iop.org/article/10.1088/0034-4885/61/2/002/meta


Working on practical projects as a team - good or bad?

Ultimately it comes down to if the work can be done alone? The purpose of group work should not be so that everyone has less work to do, but rather if the original work could not be done within the given span by a single person. In the workforce, you're most likely to be working in a team and contribute to iterative releasts (Agile Methodologies). If your expectation is that because you're in a group, you don't have to work as hard compared to working alone, then you are set to fail.

My suggestion would be to design a project such that bi-weekly or monthly iterations are presented, building up towards the final product. Incorporate Agile Methodologies into this as it is very useful in the workforce and teaches team management / tracking. Groups should be no bigger than 3-4, otherwise it is too big to be efficient. The number of hours required for the project should be big enough that everyone is kept busy. Of course some will do more than others, however one person should not be able to do the entire project.

If this is too heavy for your course, then I'd suggest stick with single person projects as there is no merit to group work.


Teaching "math function" vs. "CS function"

In mathematics a function is a constrained relation between two sets. You can illustrate that in a number of ways. The constraint implies consistence of operation and uniqueness of result.

If you discuss relations (in math) as well as functions it may be easier to get beginning students to grok it.

In most computing languages, a function is an operation that produces a value (and possibly side effects - horror). There is nothing in the definition of a Java function about constraint, not even that successive invocations with the same input produce the same values. A java function is a machine. Drop in 0 or more inputs, turn the crank, get some outputs. You can illustrate that by drawing a machine with an input hopper, and output spigot and a crank.

Students who know math have a lot of problems early on with things that look like math but are not. Other questions in the "hopper" currently explore other aspects (equality, variables)


What advantages/disadvantages have you seen with Pair Programming in the classroom

I give 11 lab assignments in CS 1, and I assign partners for the first four or five so that students get to know each other, and then I let them choose their partners, or choose to work alone.  I try to discourage them from working alone, but some students just don't want to deal with people, and I feel bad forcing them.  (I also give six projects, worth more collectively than the 11 labs are, and they must work on these separately.)

This is all anecdotal, because I only teach one section of CS 1 a semester, but: I don't see any patterns.  Some more socially awkward students find the right partner and have lots of success building skills and confidence during the semester, whereas others don't, and struggle alone for the rest of the semester.  Frequently, students who come in with previous knowledge (say, those taking the class the second time) will ignore their partners, or do the work and hand them the answer; but others seem to have the "teaching gene" and almost act like TAs for me with the weaker students.  It depends a lot on who the students are, and how lucky I get when I pair them up.

I do give each student a questionnaire the first day, so that I can try to match up the students with similar experience, or students that have already passed Calc I, or something, but (again, based on anecdotal data with a very small $n$) none of these seems to have much of an effect.

I'll be watching this discussion to see if anyone has done a lot of research on who to match up with whom, because I haven't figured it out yet.


How can I help my students to think algorithmically?

Rather than giving them processes to model algorithmically, have them start coming up with algorithms for everyday activities. Here is the formal assignment I have students complete: CS50 AP - Everyday Algorithms.

They begin with a simple pseudocode example:

1   look out the window
2   if it is raining outside
3      put on your rain boots
4      put on your raincoat
5   go outside

After they get comfortable with pseudocode, students write their own simple algorithm:

  Okay, now you’ve learned a lot about algorithms and pseudocode.
  Perhaps we should try writing a few—three, to be precise. First, write
  up algorithms (both in sentence form and in pseudocode) for how to:

  brush one’s teeth
  eat an orange

  Next, think of something that you do every day or nearly every day.
  Write an algorithm in sentence form and in pseudocode for how to do
  the thing you’re thinking of.

Students will take more ownership and may understand it new ways if they are coming up with the processes to model based on something important to them. While your example certainly works well, what about students for whom getting a paycheck is unfamiliar territory? You want to use a student's prior knowledge to your advantage, so the focus is solely on the algorithm, not the algorithm and some other idea.

Another essential element I found to getting students to think algorithmically is to model it in all things I do at the start of the year. Everything is a process as follows: input -> algorithm -> output. Let's say I want to take attendance or assign seats. I think out loud with an algorithmic process. My input is an uncounted group of students, and my desired output is a counted group as a means of attendance. Here's the algorithm I use, which I borrow from CS50's first lecture at Yale:

1 stand up and assign yourself the number 1
2 pair off with someone standing, add your numbers together, and adopt the sum as your new number
3 one of the pair should sit down; the other goes back to step 2

The value of this exercise is it gets student moving. Differentiation is essential for teaching students to think in a new way. Get them moving and talking to each other. Make it relevant to their everyday experience.


When should I scrap my projector for a blackboard?

Shifting to the blackboard/whiteboard from the projector serves two main purposes:

Slows down the pace of instruction. I can type much faster than I can write on the whiteboard. However, this is not always a good thing. When I'm discussing something complex or want to ensure my instruction does not move too quickly, I shift to writing things out. This forces me to be more thoughtful with timing and often times has prevented me from giving students more information than was necessary for a particular lesson.
Shifts focus from code to concept. As I say in a lot of my answers, differentiation is key. Staring at code to understand a concept is not always going to make it sink in. By writing on the board, I often times can draw close attention to a concept (i.e. recursion or variables) outside of its context within a program. When introducing something new and/or something complex, this helps me ensure that students understand the thing before they code that thing. For example, with recursion, I draw out stack frames, naming each one with its function name and arguments and drawing arrows with values passed in and values returned. The magic of a few lines of code that calculates a factorial becomes a little less opaque when there's a visual abstraction to which students can connect the code. Additionally, introducing variable assignment to beginners, especially something like x = x + 1;, works well on the whiteboard where I can number the steps, translate it into "English" underneath, use different colors, etc.

Bonus: It's not always a game of either/or. Projecting code onto a whiteboard mixes the modalities: students can see "real code," but that same code can then be analyzed and annotated by hand.

For my own unique context in a classroom with whiteboard-top desks, I can have students write down what I write down when I use the whiteboard. It becomes a shared task since we are all doing the same thing and forces me outside of the "sage on the stage" paradigm for a minute. Instead of lecture and fast-typing, I can participate along with them in writing on a whiteboard. This has as much to do with engagement and classroom environment as it does with pedagogy.


One lecture on VCS: What needs to be covered?

As requested, I'm expanding my comment into an answer. This is going to echo a lot of what I said in this answer, so you might also check that out for some background motivation.

Version control systems are tools that are designed to solve specific problems.

They're great for stuff like:

Storing multiple revisions of a file.
Allowing collaboration among multiple people.
Handling cases where multiple people are editing the same file or even the same section of code.

If the students haven't encountered these problems, then they might not be ready to start using a version control system.

Another consideration is that students need to understand basic directory and file structure interaction before diving into version control. Do they know how to navigate a directory structure? How to edit and copy files? This is less "common sense" than you might expect, but it's definitely a prereq to talking about version control.

All of that being said, I think you should start by explaining the above problems. Discuss how they might "solve" those without version control. Ask them if they've found themselves trying to manually merge files where multiple people were contributing, or if they've found themselves with files named HomeworkAssignment_FinalDraft-3-ReallyFinalThisTime-6.txt. If students have seen these problems, they'll naturally see the benefit of version control.

Present version control as a solution to the problems that they're already experiencing.

In other words, don't make it theoretical. Make the lesson practical and pertinent to what the students actually do.

Go through some example scenarios. Explain how they might use Git to solve the above problems, and focus on real actionable things they can do:

Here's how you'd set up a code repo so you and your team can edit files without breaking everything.
Here is the command you'd run if you wanted to upload your edits.
Here is the command you'd run to download changes from other people.
Here is how you'd resolve merge conflicts.

Even better: have students run through these scenarios live. Have them typing commands and pushing buttons instead of just listening to you. This should be information that they can actually use, not just theory that they'll forget as soon as they leave the classroom.

Don't spend an hour talking about theory. If students have never seen version control before, then they don't need to know how Git stores changes. They need to know how to setup a repo.

On the other hand, don't spend an hour telling them about all the different things Git can do. If you throw a hundred different commands at them, they'll remember zero of them.

Instead, introduce specific problems (that the students have already seen in their own coding), and show the solution to those problems. Have students work through those solutions and practice the commands right away.

  Is it worth mentioning that every local master downloaded from the repository is a new copy, and is effectively a branch origin/master -> local/master?

Students should understand branches (bonus points for using branches to do pull requests and code reviews), but do you really need to get into this level of detail? Imagine students writing this down as you lectured. Would they really need to know this later, or is it just clutter?

  Is it worth mentioning that a headless git repository is no different than a local one, and that you can pull directly from a non-origin repo?

Meh. This seems like trivia to me. Do I need to know any of the above to solve the problems I'm having?

  Merge conflicts happen; should I mention how to go about resolving those?

Yes, absolutely. Like Michael said, this is a very common problem that students will face, so they should definitely know how to handle this case.


you not going to like this answer, but Don't teach it!!

At least, don't teach it unless your teaching a 300-400 level course in college.

Most code optimization is very tiny benefit, especially since modern compilers are able to do many of the optimizations for you and it's entirely possible for someone to optimize wrongly an slow something down instead.

More importantly code optimization takes time and often leads to less readable code, which is bad.  It's very rare that any optimization other then algorithmic (Big O level) ones will ever be needed, and code readability is a huge and important factor of every program.  You don't want to teach students to sacrifice readable, maintainable, and testable code for theoretical optimizations that often will not have a noticeable impact on rate that the code runs.  Leave that to be learned in upper level coding courses only after they are able to write solid readable code.

The only type of optimization I would every worry about teaching is Big O level algorithmic optimizations, and even then I probably wouldn't worry too much about that until their in 200 level college courses.

For low level courses I would demonstrate the difference between quick sort and some naive sort, to show algorithms can matter, and not much else.  Maybe give a quick example of a nested loop being much slower then two non nested loops, but I would not be emphasizing writing code efficiently, only showing that efficiency concepts exist, it's up to later classes for students to understand and make efficiency decisions.

At 200 level courses I would start stressing how things could be optimized algorithmically to some degree.  You would likely be teaching more about different container types, linked lists vs arrays vs hash maps, so just explaining these algorithms in a way that touches on why one would use one over the other is good.  You will be teaching them how skilled programmers use tricks to gain efficiency benefits by demonstrating the common algorithms they cam up with, which is great.  However, the emphasis now is less about coming up with great algorithms themselves, and mostly knowing that algorithm decisions can matter and they should be picking the best collection/tool for the job based off of it's algorithmic efficiency.

At 200 level you can also start to point out particularly horrible Big O mistakes.  The most obvious example would be including a nested for loop that does not need to be nested.  Telling your students "try not to have multiple loops inside each other if you can avoid it, especially not if each of them can be large" is okay at this level.  Give an example of why nested loops can be absurdly slow and how you can avoid it is okay, often this can be tied in with picking the right tool for the job by showing how iterating over an array once with a precompute phase to put stuff in a hash map before a second iteration is faster then the nested loop, and look here is a demonstration of another reason to use a hash map.

at 300 level courses your ready for a course that focuses entirely on algorithms, this one course should explain Big O vs Big Omega etc, give means of measuring algorithmic complexity, and really hammer in that algorithms matter.  From this point on always bring up algorithmic complexity and ways to make better algorithms, their ready to adjust for this.  However, still be quick to point out when an optimization was needlessly complex.

Sometime around 300/400 level optimization considerations other then algorithmic can be tackled as well.  I would suggest tying this in with study of the physical limitations of a computer though.  When you study how memory actually works you can give an example of how, for example, ensuring you access data 'nearby' each other to avoid cache hits is useful.

At this level of class I suggest explaining how the computer works and how this affects optimization decisions.  Then give them an 'unoptimized' piece of code and tell them to optimize it.  Write some automated testing scripts that will run the same code 1000 times on a large sample size, compare wall clock before/after it's run, and figure out the average speed of the code, then tell them you want them to provide N boost to it's runtime.

I had one such project where I got something like a 25 x speed increase when doing math on a 3 dimensional cube where we had to consider the content of each 'touching' cube.  The biggest increase was changing the logic to minimize cache hits, but things like loop unrolling and replacing methods with macros also came into play, these was using a C compiler with all optimizations disabled.  It really helped to show how drastic optimization can be.

However, it's important to always stress readable code is most important and that premature optimization is bad, repeat constantly to only optimize proven slow points and to test your code to identify where the slowdowns occur before trying to optimize.

If your not teaching high level courses though, just don't do it.  It's likely to lead to worse code most of the time and just adds an extra thing for students to learn and get confused about.  Focus on their writing good maintainable code and only after they have mastered that should they worry about 'efficient' code.


Let's start with the term "Loop Invariance". It is a property of a loop that is true before and after each iteration, thus in-variant, non-changing. So then, what is the purpose of the loop invariance in proving algorithm correctness? That is, it is a predicate about what the loop is supposed to do. Thus with proof by induction on this predicate shows the correctness of this algorithm. I know this is still very theory heavy so let's break this down even more.

A simple insertion sort. The purpose of insertion sort is to sort an array. Therefore the loop invariance would be that after each i-th iteration, the array is sorted up to the i-th element. The magic here is that instead of looking at the nested for i, j, loops of the algorithm you are choosing the loop invariance that contributes to the goal of the algorithm.

To answer (1). There is no sure guarenteed way to choose the correct loop invariance unless you are very experienced in algorithm correctness through countless examples. The best approach is to choose the segment of code that is actually doing what the algorithm is trying to do. Such as the example above, sorted up to the i-th element.

(2). I believe this has to do with the proof itself, rather than understanding the loop invariance. Structurally, to prove that the algorithm is correct, you would have to use proof by induction (either simple, or complete) to pove the loop-invariance and the fact that the algorithm actually terminates. Usually proof of termination is a 1 liner, such as when i > array.length, loop will terminate.

  simply to look at the final item you are trying to prove, and figure out what property of the loop will mimic that statement.

I can tell you are very intelligent as this is something only someone who truly understands algorithms and proof of correctness can say. It is actually very difficult for younger students to see this as they are tunnel-visioned by the actual loops in the code instead of the bigger picture. Instead, I think what you are trying to convey is to look for "what part of the code is doing what the algorithm is meant to do"


Uses of high school Computer Science: where can it lead other than university CS?

The Russell Group of Universities has published a useful list of recommended A level subjects for different degree options which suggests that other than a CS degree, CS A level is recommended for:

Aeronautical Engineering
Biochemistry
Biology
Chemical Engineering
Chemistry
Civil Engineering
Economics
Electrical / Electronic Engineering
Engineering (General)
Geology
Materials Science
Maths
Mechanical Engineering
Medicine
Optometry
Orthoptics
Physics
Psychology
Sociology

Problem solving and computational thinking is a hugely transferable skill in itself.  Almost any science / engineering route through academia into the workplace is greatly benefited by the ability to write / modify some code that will process data efficiently and generate exactly the sort of analysis / evidence that you require.

For example, a substantive part of a Psychology degree involves collecting and processing statistical data. Even without the logical and analytical benefits of CS, the ability to write code to automate the analysis of that data immediately gives you huge advantage over peers without any CS skills.


Homework Policy for Advanced/Honors Students

My students are already slammed with homework, so when possible, I try not to add to their misery.  I have done some formal polling of my students several years back, so I have used real data to balance my own approach.  Of course, as of this writing, I cannot find those numbers any more, so I will be working from rough memory here:

I mentally aim for 50% of the kids to be able to finish labs during provided lab time. In reality, it is usually closer to 15-20% of the kids who are able to finish the labs during the provided lab periods, but there remains a large portion are able to complete their work in <3 hours of outside work (something like 60%).  Only the remaining 20-25% had substantial work from the labs.  While I offer help outside of class, I have not found a reasonable way to prevent this problem; kids who are slow at labs will always take more time than I can provide.

If I am teaching a brand-new course with a brand-new curriculum, all bets are off, as I have very little sense of how long the activities will take.

However, I once found a Williams College professor's labs posted online, and she added a short question to the end of every lab to the effect of, "How long did this portion of the lab take you?  This answer will have no bearing on your grade, it is only used to help me adjust student workloads in future years."


How can we measure proficiency in programming languages?

I think you are taking a good approach with your boot camp. I'd only suggest a warm up exercise/mini-project in which students get some practice, perhaps writing in groups (pair-programming, perhaps).

One useful sort of project is called a fixer-upper. There is a pedagogical pattern by that name, actually. Give the students a program that you have written. Make it fairly large (bigger than they could write themselves). Make it a good a C program as you can. Then break it in a few ways. Some of the introduced errors are syntactical, which the compiler can catch. Others are more subtle and require thinking. The exercise is to fix the program. It is a good "hot" introduction to a language. In another course than those you suggest, I might give them a program that solves a problem they already know how to solve in, say, Python. But here, it might be better to do something that makes them think about memory.

But, I wouldn't worry overly about mastery at this level. Any "predictor" will be imperfect. Students can grow into the language along with the OS concepts, for example. I learned a lot about machine level programming in just such an environment.

The student needn't be perfect in one thing before they move on to the next.

But you may need to provide additional feedback or mini-lessons along the way if they seem to be a bit off track.


Single-dimensional array and simple looping activities of significance

The Dutch National Flag problem is linear in running time. Essentially sort an array with only 3 distinct values each of which may appear 0 or more times. (not length 3). You are allowed only one pass over the array, so the solution is a single while loop with some prior initialization.

It was probably originally posed by Dijkstra. It is mentioned in David Grits's The Science of Programming where it can be solved very nicely by posing pre and post conditions using David's ideas of finding invariants from pre and post conditions.

You can also make it a simple object oriented problem if you like by using objects as the array elements, for example.

A more interesting formulation of the problem refers to the Dutch National Flag which is a Tricolor: Red over White over Blue. You have an array that has some jumbled up red and white and blue cells, zero or more of each. You want to move all of the red cells to the left end, all of the blue cells to the right end, with the white cells in the middle. The restriction is that you may make only a single pass over the array. The correct solution is very creative and demonstrates the power of loop invariants.

I have mentioned this problem in answers to other questions here. A search for "dutch" on the questions page will reveal them.

Solving it without hints can provide a gigantic a-ha moment for almost everyone.

If students can do the classic version, they can also think about a modification that will handle 4 values instead. From that you can talk about the inherent complexity of sorting values from any finite set.


Paired programming with an odd number of students

An extension I've come to appreciate is one where you have a "driver", "observer/navigator" and "keeper".

This last role might be considerably more difficult, depending on the lab. The idea is to have someone who keeps track of the design. This means that at the start of the lab, the students should all (or just those who start as keepers) dedicate a bit of time to read up online about design patterns in the language they are using. It's important "not to delve too deep". Just a general idea of what "design patterns" means.

Then they begin working. Two out of the three work in usual pair-programming workflow. The third keeps in mind the design of the program. As with regular pair-programming, the students should switch roles every now and then. In the case of a trio, they should obviously cycle.

If not all students in the lab are in trios, then an additional for the navigator is to remember design patterns. It should be made clear that it's not their primary task, but that it would definitely help with debugging and maintaining the code.

The added bonus of this extension of pair programming is that students are exposed to design patterns. Seeing as they can sometimes be a complicated matter, starting to tackle them is better done sooner than later.

I have found this solution quite useful in labs about subjects in OOP (the more complex the system, the more important SOLID principles become).


Resource recommendations for teaching OOP via a practice-oriented example

I'm currently teaching OOP using Python 3 Object-oriented Programming by Dusty Philips. Find it on Packt or Amazon.

It's a practitioners book, it covers a bit more than just OOP including some unnecessary bits if you ask me (like concurrency). I've found it works out well when combined with a few other sources like Effective Python and some online materials on design patterns. If you follow it page by page I find it a bit too much focussed on Python details and not as much on the general OOP principles.

I think that in most cases you'll have to make up your own curriculum and fill it with bits and pieces from books you like :) There is rarely a perfect fit.


Placement of App Inventor in high school CS curriculum

The AP course that @AlfredThompson referred to is the Mobile CSP course. It's a
complete College Board-endorsed course for the new AP CS Principles course and is entirely based on App Inventor.  It comes with a complete set of lessons for students (Creative Commons-licensed) as well as lesson plans and professional development (PD) resources for teachers.  The MobileCSP project has been providing PD for high school teachers throughout the U.S. since 2013 and has now trained around 500 teachers. For more information about the project, see this site.


Tools or methods to make projected code easier to follow

I use a program called Zoomit (For Microsoft's Windows, by SysInternals), that lets you freeze and draw on the screen and zoom in on parts of it. I find it pretty useful when teaching, I came really dependent on it. It is free of charge and easy to use.

Here is a very simple example:


Any website or textbook with problems/solutions for Computer Science Theory?

I agree that Introduction to the Theory of Computation by Sipser is good text, but I also recommend taking a look at the Stanford CS103 course page archive, which has a lot of great supplementary resources, including handouts, problem sets, and lecture notes.


What is a (simple definition of) a development environment?

If you write software you necessarily have a development environment. It might help or hinder you as you work. A development environment consists of some set of tools that you use to develop the program. The tools might be integrated into a single framework (an IDE) or not, but you have some sort of environment.
The tools include at least

one or more editors to create files of various kinds, text and otherwise.

one or more compilers to translate your program files into machine code for one or more machine architectures

one or more run-time-environments in which you can execute your code, either on the target architecture or in a simulator

Additional tools that are usually needed are (not a complete list but will do for a start)

a test framework so that you can effectively write both unit tests (the code does what I think it does and doesn't break as I change things) and acceptance tests (the code does what the owner/customer really wants done - irrespective of my understanding).

automated error checkers to trace back exceptions and race conditions (among other issues)

a debugger that lets you interact directly with the target code as an aid in finding and repairing errors.

a design framework in which it is easy (or at least possible) to create design documents, which may be textual or graphical. They might be integrated with code generation or not.

a code repository and version control system so that old versions can be maintained and errors can be backed out of

a team-support system that helps a group of developers work on the same project. These tools may include simple communication tools (email...) or provide things like distributed pair programming.

a database system to hold necessary data used by the program. Sometimes a database is also used to store fragments of the program(s) themselves. The database might also contain required test data to assure the correct thing is built. Likewise it might contain information about the success or failure of test runs

a documentation system that can be used for either or both of program documentation of use by the team and user documentation that gives instructions to the end-user on effective use of the system

a way to make interaction with the file system easy and efficient, such as directory listings that let you easily open/save/close files

a way to maintain various "configuration files" so that the system can be tailored for its various uses

a way to keep all of the tools updated easily

automatic error checkers and style checkers beyond those provided by the compiler

For some kinds of software a sophisticated emulation environment to check the interaction of various components. Mobile apps often need servers and some way test the interactions, for example.

An Integrated Development Environment (say Eclipse or NetBeans) will integrate all of this into a single program that may use one or more multi-pane windows to provide a visual representation of all of the tools. A good one is tailorable by language and by need without cluttering up the workspace. A less integrated system (Emacs, say) provides all of these things through (possibly cryptic) user commands. An IDE requires a learning process itself, but it pays dividends if it is flexible and not restricted to a single language or architecture.
But even a simple text editor, a compiler, and a run-time for testing is a development environment and for many years was all that was available. Way back, the "text-editor" was just a card punch.

Note that not all files in a project are necessarily just text. Some projects require, for example, graphical files to show design.

I don't claim I have a complete list here. There are many other possibilities. Each person's development environment is personal. It is good if it makes them more productive and less frustrated. Is is subject to update and modification at any time that you learn of a new tool or technique.

Also note that not all of these are needed in every project and you don't need to be proficient in many of them to get started. But issues that arise as you work may help you see the need to expand your personal set.


A category to classify expressions, statements and blocks

This is a surprisingly complex question. In many languages one can distinguish between commands and expressions. A command is something that changes the state of the computation. An expression is something that returns a value, but doesn't change the state. This is actually a good mental model even in languages that can confuse the two ideas in small or large ways.

Some languages consider statements to be commands, but in C, for example, an assignment statement is also an expression that has a value equal to the value assigned to the variable on the left. That may or may not be the value of the expression on the right, actually, as when a short is assigned to a long.

Likewise blocks can either be commands or expressions in most languages. A function block is an expression, returning what the function returns (more or less) but it can also have command-like properties if it changes the state generally, say by modifying a non-local variable. But the if-clause in an if statement is usually just a command.

So, I don't think there is a single unifying category for all three of your items, but the distinction between commands and expressions is useful.

It is useful for another reason as well. In C a "function" can return a value or not (void functions). But programs are easier to understand if a function that returns a value does not also change anything in the non-local state. Then functions when invoked will be either expressions (the value returned) or commands (the state changes) but never both.

But C also has a distinction that even command-like functions often return an error state indicator, zero if there are no errors. So common practice gets in the way of the useful rule in the paragraph above. C++ can use exceptions instead of error codes, of course.

But in more "modern" languages, the distinction between expressions and commands is maintained with a bit more clarity. Java, for example.


Teach smart pointers to beginners with no knowlege of OOP or templates

I hate giving advice like this, but my honest advice here would be not to do so.  Or, at least, don't do it without consulting with your colleagues first.
Students (and your fellow teachers in future courses) depend on you getting through the required material in the course.  If you find that you have extra time at the end of the semester, then by all means, go back and try to take a stab at smart pointers.  But I wouldn't endanger your odds of getting to the end of the material that students will be expected to know in future coursework.  That could create far larger problems for the students going forward.


How to keep students heads from exploding from complex, interconnected topics

Students are better able to handle structured information when they understand, at the start, what that structure is.

Explain the situation to your students.  You are about to present a series of deeply interconnected systems, and though they form a beautiful system together, they essentially can't do anything until they're all moving in tandem.  That means that there are two levels of learning that the students must engage in:

The systems themselves; and
how they play with one another.

I would show them a list of the systems at play in as neat of a form as I could.  I am unfamiliar with the topic that you are teaching, so I don't know if this would be possible, but an interconnected graph would be ideal for this.

Explain that you will be going through the systems (the nodes), and that students can make a check-mark on each node as they come to understand them independently.  But you will also be going over the vertices, and these are just as important.  They also need check-marks.

Over the course of the unit, students can refer to this graph as a way to measure their own progress and understanding, and to take charge of their own learning.

This graph has an additional benefit; your own teaching can now follow the same model.  You now have a structure that the students will already understand from which to spin out your lessons.  And if a student seems to be having trouble, pull that graph out and have that student begin explaining certain nodes or vertices back to you; it should quickly become apparent where the confusion lies.

Good luck!


Understanding Introduction to Algorithms, 3rd Edition

The key to learning this, or much of anything, is reinforcement and feedback. Reinforcement comes from doing exercises and solving problems in a course like this and the book has plenty of mid chapter and end chapter exercises and problems. You can do a lot of these. All of them may be asking too much, but you want to be able to answer any of them. Getting more explanation may help or not, but only if it helps you solve those problems.

Feedback, however, may be the bigger problem. Where you can properly seek it may or may not be a problem. If the rules in your place permit study together then you can work with one or two other students in a study group. Each of you solves some set of problems on your own. Then you meet and discuss your solutions. I'm not suggesting you collaborate on formal assignments as that may be treated as cheating (or not, depending on the prof), but all of the "other" exercises are, to me, fair game for collaboration. Doing them gives the reinforcement. Discussing them gives the feedback. Look for insights from each exercise that go beyond that exercise.

In universities such as yours, you often will have access to a TA. That person should also be able (and willing) to give you feedback on what you do. If they are wise and you seek hints from them, you will only get minimal hints, not solutions. Seek the insights, not just the solutions. Go to them for feedback, not hints, primarily. Likewise in a study group. And if your professor doesn't get angry when you spend too much time in their office, then spend a lot of time in their office.

Others may be able to supply online course resources, but I'll warn you that such things may make it harder if they divert you in any way from the main task: reinforcement and feedback.

Try to space out your study so that cramming for exams isn't necessary. It will be counterproductive for almost everyone and almost every situation.

Other hints:
Take notes on index cards. Carry those cards and review them frequently. Carry blank cards so you can make notes as you get insight or have questions that need to be answered later.

Sleep and get enough exercise. i.e. rest your mind and energize your body. The overworked mind is inefficient. The insufficiently oxygenated body is also inefficient.


Effective ways of teaching regex to students who know Java

Many students find them difficult and intimidating.

Then the challenge is to make them fun and engaging and (ideally) interactive. I myself have undertaken the challenge here and there of teaching myself regex, and two resources rose to the top in my own learning: RegexOne and Regex Crossword.

RegexOne is great as a lesson-by-lesson tutorial. Students can type and see in real time what tests cases their regex does/does not match. There are 15.5 lessons and 8 practice problems. The practice problems draw from relevant use cases, such as extracting a phone number, trimming white space, or reading a log file.

Regex Crossword mixes regex with logic: students have to fill in a square grid and track how gradually more complex regular expressions interact with each other. (That sounds a bit vague, but an example like this one makes it clear what I mean.) The crosswords tend to have fun themes/solutions. There are many crosswords to solve, including ones with great complexity, so students will have to spend lots of time working at it if they'd like to complete all the puzzles.

When it comes to working in class, it'd be pretty easy to work with some of the smaller crosswords in a non-digital manner. You could put one on the board at the start of every class as a warm-up or print/copy some of your favorite from the site. Maybe even have students work in groups and complete to solve a series of puzzles in the fastest possible time.

Between these two resources, students will at least have a pretty good start to working with regex.


How Can I Explain The Concept Of Zero Knowledge Proofs To Students

The best example I have encountered comes from mathoverflow.net. Here it is for you convenience.

Imagine your friend is color-blind. You have two billiard balls; one is red, one is green, but they are otherwise identical. To your friend they seem completely identical, and he is skeptical that they are actually distinguishable. You want to prove to him (I say "him" as most color-blind people are male) that they are in fact differently-colored. On the other hand, you do not want him to learn which is red and which is green.

Here is the proof system. You give the two balls to your friend so that he is holding one in each hand. You can see the balls at this point, but you don't tell him which is which. Your friend then puts both hands behind his back. Next, he either switches the balls between his hands, or leaves them be, with probability 1/2 each. Finally, he brings them out from behind his back. You now have to "guess" whether or not he switched the balls.

By looking at their colors, you can of course say with certainty whether or not he switched them. On the other hand, if they were the same color and hence indistinguishable, there is no way you could guess correctly with probability higher than 1/2.

If you and your friend repeat this "proof" t times (for large t), your friend should become convinced that the balls are indeed differently colored; otherwise, the probability that you would have succeeded at identifying all the switch/non-switches is at most 2−t. Furthermore, the proof is "zero-knowledge" because your friend never learns which ball is green and which is red; indeed, he gains no knowledge about how to distinguish the balls.


What hardware can I use when teaching Compiler Language and Assembly Code

The 32-bit subsets of ARM assembly language are fairly clean, orthogonal and RISC-like, as well as being a reasonably nice target for a simple compiler.

Inexpensive Raspberry Pi's run 32-bit ARM code, as well as natively supporting a complete compiler development tool set (lex, yak, bison, et.al.)

Almost every student is likely to possess a mobile phone that will also run ARM machine code, and both Apple and Google provide free development tools that allow coding portions of a mobile app (iOS or Android) in ARM assembly language.

The 6502 and 8051 ISAs were not designed for modern compiler output, even though otherwise suitable for teaching hand-coded assembly language and running it on inexpensive (vintage or microcontroller) hardware.


What is the point of teaching coding and robotics to kids as young as six years old?

I think the intent of such courses is to teach Computational Thinking, not programming as such. Programming is, I think, just one tool among others.

There has been quite a lot of activity recently on computational thinking, which is a good thing. Any "patterns of thought" that can be distinguished and taught seems to me to be a good thing. We teach math and language skills for about the same reason to youngsters. For just about anyone, having several differnt "ways of thinking" gives you an advantage as you grow.

Also, coding implies the "creation" of things. When I was about 5 years old my schoolroom had a set of very large building blocks. We created structures with those and I always look back on that as a good thing to have done. For youngsters the act of creation is a really good thing to teach, no matter the medium (art, music, ..., programming).

But educators aren't trying to create coders as a profession at that age, any more than we are trying to create "professional readers". It is just a tool to aid cognitive development (or should be).

Do a web search on "computational thinking" to see some things about where this comes from. One of my doctoral students has focused her career on these ideas, actually.

See CS Unplugged for a closely related set of ideas.

Let me add a couple of points.

First, robotics, especially, can be fun. Creativity paired with fun is a winner.

Next, in as much as students are able to create useful programs, those skills can be used (and expanded) later in their education. A bit of coding in a math or science course (at least) can add to the learning process of those subjects and, one hopes, help the student generate insights that will deepen their knowledge.

However, I have very mixed feeling about things like Code.org. These are being pushed by large companies with an agenda that is not, fundamentally, education centered. They seem a lot like marketing programs to me. I also worry, at least a bit, on the overemphasis of programming games. While games can be motivating, I think they give too narrow a focus. Commercial games also very likely have an overall negative effect on student learning and growth. There have been recent studies showing young students spending too much time looking at screens in more or less nonproductive ways. The time might be better spent building with blocks and kicking balls around. I'm a much bigger fan of things in CS Unplugged than I am of code.org.


Show students the consequences of their design decisions

I'm not so sure what you're talking about is a great idea.

Students should be writing a lot of throwaway code, especially at the beginning of their education. They should be learning, writing code to test what they learned, and then moving on to the next thing.

Part of being a student is writing code that, 6 months from now, will look like garabge to them. "Why would I have done it this way?" This is a completely normal thing that everybody feels, and it's a sign that they're learning and improving as developers. But it also means that students shouldn't spend a lot of time polishing their code. Instead, move on to the next thing.

The rest of it comes with experience. Don't worry about "design" so much, and just focus on writing code that works. Forcing students to work with code they wrote weeks or months ago is just punishing them for learning and improving.


Software development vs universities and scientific papers

Short answer: yes.
Disclaimer: I'm an Associate. Pr. of Computer Science in a University in France. We have several undergraduate and graduate programs that lead to bachelor and master's degree of Computer Science.
As the degree is about Computer Science, we do teach software engineering (among other topics : databases, networking, logic, architecture, compilers, ...).
Some applied program are very applied (the students are working in a company for the duration of their studies, switching every two or three weeks between their company and the lectures at the Uni).
A computer science curriculum where one learns about software development is quite standard (from working with several colleagues from around the world I now that such things exist in the US, UK, most of Europe, Asia, Australia, …).


How can we best inform potential students of the nature of CS?

If the main issue is that the not-so-great side of programming (to pick one area as an example) is not disclosed, then tell people point-blank, in an admission conversation or while describing programming to groups:

  Programming is one of the most frustrating and difficult things that
  humans have ever devised to do.

I say that to all my students right out, usually the first day. I also tell them about the big egg-shaped rock I used to wave threateningly at the (glass CRT) screen when I got particularly frustrated. And I tell them about the time I had to go back to the bookstore to buy a different book about the intricacies of writing DOS interrupt routines for networking with IPX over Novell: the first book had a missing line in a code example.

It certainly is true that one can succeed with poor background and preparation. I hated math classes, and they probably would have helped me become better faster at programming (my first chosen career that I attended college to get to). There is no substitute for being really interested in something, interested enough to defy your parents and change your major in college, interested enough to press on through many difficulties, come what may. "Being carried along is not enough."

Loving it even when you don't really know what it is will work, I do not know what else will. As it says about qualifications in the book At the Feet of the Master:

  Love, if it is strong enough in a man, will force him to acquire all
  of the other qualifications, and all the rest without it would never be
  sufficient.

We are supposed to do what we love. Freud said that the keys to a meaningful life are Work and Love. Really, they are one.


Where one can learn CS in very rigorous way?

Be careful of what you wish for. Assuming you want rigorous self study, I'll recommend a few books. They are fairly old, but are classics.

The Art of Computer Programming. Knuth is a mathematician at heart. The link is to the boxed set, but you can buy individual volumes.

Elements of the Theory of Computation. This is as rigorous as you want to be and addresses directly the question of run-time bounds of various sorts.

Similar is

Introduction to the Theory of Computation by Sipser

A somewhat different view of computation is found in

Structure and Interpretation of Computer Programs: A classic introduction to functional programming in Scheme - yet quite deep.

For what it's worth, I have a doctorate in Mathematics and taught CS for over 40 years.


Encourging Growth mindset, in computing lesson

I like both of the existing answers, but I wanted to add another technique that I think is very important: you should show that making mistakes or not knowing is part of the process.

Don't: Make your lessons all about perfect example code and only best practices.

I'm a student in your class. I've understood most of what you told me in lecture. Now I'm at home, sitting down at my computer looking at a homework assignment. I have no idea what to do! Then I start writing code, and I get a ton of errors. Ugh, maybe this computer stuff isn't for me!

Do: Include mistakes, debugging, and looking stuff up in your lessons. Do live coding exercises.

I'm a student in your class. Now I'm at home, sitting down at my computer looking at a homework assignment. I have no idea what to do, but I remember from class you told me I should break problems down into smaller steps and then take those steps on one at a time. Now I'm writing code, and I get an error. Good thing you showed me that errors are a normal part of programming, along with how to debug the issue. I even know how to look stuff up in the reference if I'm confused!


How important is learning Binary for first-year college students?

I see no reason to teach binary in an introductory programming class. It is not generally needed (see exceptions below) when programming in high-level languages, which is usually what is taught to freshmen students. If you have extra time in your course, rather than introducing binary, why not introduce them to other areas of CS that freshmen don't usually see, such as human-computer interaction, algorithms, computing history, Moore's Law, assistive technology, internationalization, etc.

I teach binary when there's a need to: in Computer Architecture, which is a required (2nd- or 3rd-year) course in our undergraduate CS minor and major. It is absolutely necessary in that class, to understand how processors work, how caches work, and how numbers and Unicode characters are represented. I don't teach Computer Networks but could imagine its being taught there.

If a curriculum does not include Computer Architecture, students should still learn enough about binary numbers and floating point encoding so they know why floating-point arithmetic is inexact.

If/when you do teach binary, teach them how to count on their fingers in binary.

I give extra credit in Computer Architecture for counting up to 31 on one hand. Just be careful...

See also this cartoon.


Concern over plagiarism in designing online course

So, as a matter of fine distinction, what you are doing cannot be plagiarism if it is credited.  It could still be theft, and it could still be unethical, but plagiarism is passing someone else's work off as your own.
If you are having the students purchase the textbook, I would reach out directly to the author and explain what you are doing.  Since he will be compensated by the textbook purchases, he may well agree to allow it, which would eliminate the ethical issue.
Even if you are not having students purchase the book, some authors are simply generous enough in spirit that they would nevertheless agree to such an arrangement.
The ethical alternative is to come up with your own exercises and explanatory texts.  These can closely follow the spirit and outline of the author's text if you think he has a great approach, and you can point students towards his book as an excellent and highly recommended source.  (You would still have to credit the author to the degree that his contributions and organization of the material is a resource for you, but if you do not use his text or exercises, then that would be all you would have to do.


Make it easier, and quicker to get to the start

This question seems like a minefield. The obvious answer is "Don't Do That." No group of people, students or professionals, is going to interpret two pages of instructions in exactly the way the writer intends. It isn't going to happen. They will misinterpret individual steps, skip steps trying to optimize, crash the machine when they don't have a conceptual idea of the goal, etc.

In the first place, your instructions may be clear to you, but until you vet them with others they won't be clear to most other people. This is why textbooks have editors and why authors re-write continuously.

There are, however, a few things you can do.

You give one answer yourself here - Automate It. In fact you can improve the automation if you distribute the code yourself and execute it yourself from a central server. Automation isn't foolproof, however, as some of the machines in the lab will, perhaps, have different initialization parameters baked in that defeat your script.
Another possible solution is to decide on a standard startup process and configuration that you always use. The students can learn this and only struggle with it for a day (or week, ...).
Make the startup description shorter. As short as possible. Then a bit shorter. Vet it with someone else who is skeptical about it. Re-write it using their feedback.

But even then, you will fail. Different students will interpret your writing differently. That is pretty much guaranteed. Your writing won't be perfect. Neither will their reading (and understanding) be perfect. If you need different instructions each day and they can't be vetted, I wish you the luck you aren't likely to have.

You can do more, perhaps.

If you can live with students always working in pairs at the machines, then you have cut the interpretation problem roughly in half, maybe more. Only half as many machines need to be set up and there are two minds working on each machine. (Of course they could disagree making the problem harder, but usually this helps.)
If you can manage to have an assistant wander around the room helping the students with the most trouble it can help, though pairing is better. (Paired programming has been shown to be more efficient and require less intervention by the teacher, but that is not quite the same problem you pose here. Students working alone get stuck and wait unproductively for assistance. Pairs work it out.)

There is one special difficulty that you need to address. Minutely detailed and extremely precise descriptions are often especially hard to follow if the person trying to carry them out has no overall context or goal that they understand. The reader likely has no way to check that each step was faithfully executed in the correct order. Any glitch will cause a serious problem for that person. With a group of individuals, there will be many independent problems simultaneously. Whack A Mole.


Ways to do live polling (aka ConcepTests) during class

My students are all on a Discord server with me, so when it comes time for polling, I hijack the reaction system in Discord to get it done.
One nice feature is that it does syntax highlighting for any language that you specify, and you can also install mathjax on your server if you'd like to be able to represent mathematical functions.  Here's a question I polled recently.  The question itself is quite a lot of fun, and is from Java Puzzlers by Bloch and Gafter:
**What will this Java code output?**

```java
public static void main(String[] args){
   final String pig = "length: 10";
   final String dog = "length: " + pig.length();
   System.out.println("Animals are equal: " + pig == dog);
}
```

React with:
:one: `Animals are equal: true`
:two: `Animals are equal: false`
:three: `false`
:four: The code will fail on an exception

This outputs in Discord as:

Students then react with one, two, three, or four.1
It doesn't allow reactions to be hidden, so if this is an important feature to you, then I would look elsewhere.
I've also found it useful for getting a sense of where my students are in an activity when they go to breakout rooms to work in pairs or trios:

This is very informal polling, but you can see how useful such information can be during virtual instruction.
1 - The answer is 3.  Surprised?


When teaching Web Development, should server or client side come first?

Starting with frontend does not necessarily mean starting with JS. You could first do HTML and CSS, which is engaging, as you mention. Then proceed to Ruby for the backend (whether Ruby is suitable as a first programming language is another debate), i.e. generating static pages dynamically.

JavaScript could come at the end of the course. This is also how things went historically, more or less. I would say this order makes the reasons for JavaScript (faster and smoother interaction, a.o.) stand out better.


The way it was explained to me -- how this distinction without a difference came about -- is quite simple. If we are storing text in a file, it is quite natural (for users of ASCII, which has one byte per character) to place the characters one after another, starting with the first one at position zero. If more is added to the file, it easily goes on the end. This agrees with the convention of writing left to right, say on a board (white, green, brown, black, or otherwise.).

The wrinkle in the rug is that numbers are often larger than one byte (gosh darn it) and so we have two choices for how to write them in to a file, send in a stream, transmit data by radio from one Hawaiian island to another (the founding of the internet) and so on:

send the most significant byte first
send the least significant byte first

Huh. Now there is a stumper for you. Which should we do? It is natural when the digits of a base-10 number are written in a text file, like "12,345", to send the first byte, well, first, eh? But someone decided that numbers should send the least significant bit first and then forward from there to the most significant bit. This makes total sense if you are writing out, say, the bits of a data stream (image file, encrypted data, etc) and so then it would be just like the ASCII text case, except bit-wise, and the bits should ascend as we write them on a board... uh, left to right. Yeah.

Bits, bytes, schmytes... What does it really matter? Well, just like how we ended up with cars going on the left in some parts of the world and otherwise right, just like how we have 220 V AC in parts of the world and 110 V split phase in other parts, just like how some languages are written in letter-scripts and others are written using ideograms, it makes no difference whatsoever, unless moving from one system to the other. The real question is:

  "why can't we all just get along?"

Or in other words: why do standards emerge only after two or more groups have already made a big investment in different schemes? That is the subject of a larger course.


I would suggest two things. Both of them, however, require that you give them printouts of the code so that they can make notations of their own without having to use any tool. Just write on the paper. Also, I'm assuming that your code is in small pieces, say, short methods. For me, a method is long at about five lines and a method that covers a page is incomprehensible. I have anecdotal evidence from industry that the latter is also true.

One method, assuming that you have given students the code is to just project it from your normal IDE and highlight it with the mouse. Ask the students about it and talk about it. Asking is probably more effective. You don't need to write anything.

Another uses a tool like Powerpoint. Build a deck in which each page shows exactly the same code but with different sections highlighted as you desire, using one or more colors. You can flip between pages as you talk, flipping both forward and backward as needed. But, again, ask the students to explain, rather than giving your own explanations. This way you can pick up misconceptions they might have and correct them. Make sure that the code itself has the same alignment on each page. Then when you flip, only the highlighting changes and students don't need to readjust the context.

Perhaps you can project against a writable surface rather than a screen. If you project on a whiteboard (and can ignore the glare) you can use marker pens to annotate - especially when the students say the right thing.

Make it interactive. Broadcast is much less effective.

Also, since you are putting effort in anyway, make sure that you always use intention revealing names in your demo code. Don't use x, y, z, i, j, k. Make the names come from the problem being solved, not the solution. For example counter is a name from the solution. But negative_value_counter is a name from the problem (of counting negative values - duh). In this way, if you are primarily teaching them about how to structure programs, you can focus on the structure (if, while, ...) rather than having them wonder about the purpose of abstract names.


Database theory (normalization) for beginners (adult education, MS Access)

Based on the comments, the minimum for theory and technical is how the nomenclature of MS Access relates to Excel.

If they've been doing everything in Excel anyway, they've developed habits for, or against, normalization that you're not going to break in a couple days, intensive or not.

If they haven't discovered the pitfalls of redundant data in Excel, they probably won't in MS Access either. If they have, then they've already learned the lesson, and developed their own methods of "normalization."

You can bring it up, and have resources available for them to access, online in their own time, if they develop the interest in "doing it right." Otherwise, concentrate on helping them become fluent in MS Access, an hopefully reduce the calls for help you get when they don't remember how that works in two weeks.


How can we motivate students to review each other's code?

You have an opportunity for several things here:

You can make it a small-team effort rather than a whole-class thing. Say, a team of about 5.
The team reviews everyone's code in sequence so all get to participate. Instead of a "code-review" it can be a "code-quality-workshop".
The team has to write up the results of the review, with an addendum by the code's author about how the code was improved. (Writing is good.)
A whole-class retrospective on the process and its effect. (Retrospectives are good.)

If you have several groups working at once, you will need to wander around and participate in each group, giving pointers on process (rather than product). But you also need to do that if you have the whole class as the set of reviewers, of course.

An alternative to code reviews, of course, is pair programming, where the need for reviews is lessened or eliminated. Two minds working together are stronger than than the two working separately it turns out when creating code. Code quality has been observed to improve and quantity (statistically speaking) doesn't go down by enough to overcome the quality issue.

You may need to add a level of peer evaluation/review to this as well. Something like the following has worked for me over several years. In any group assignment, each member of the group also submits a peer review sheet. For a group of two (e.g. pair programming) I ask each participant to detail the most important contribution of their partner AND their own most important contribution. I don't ask who worked harder or ask them to make an evaluation. I ask them for the contributions.

In a group of about five, I will ask each member to name the (say) three most important members of their group and to mention the key contribution of each. I tell them that they can include themself in the list of three. I also ask, separately for their own most important contribution.

I let them know at the beginning of the course that this will happen and its parameters, so it isn't a surprise.

Students see that they are supposed to contribute to a group and are not asked to speak ill of anyone. Keep the questions entirely positive. But you also learn a lot from what is not said and who is not included in the contributor list.

If the project happens outside your view, you also learn things about individuals that you can not otherwise know. I've had students I thought were slacking who were praised by teammates for making the team work properly.

These peer evaluations are not optional.

This same idea was also discussed here: https://cseducators.stackexchange.com/a/2578/1293

Let me note that there may be cultural limitations here. In some cultures it may be odd to name oneself as a top contributor. In others it might be very natural. You can modify the scheme, of course, either requiring or forbidding naming oneself as one of the top people. Use your judgement here.


The Librarian

Application to help your local library to organise book catalogue and offer students a way to check which books they have checked out from the library.

Who will use this app?

This app will have two interfaces and two user roles. The first role is a "Librarian", a person who uses a computer inside a library for one of the following tasks:

registering new books and editing number of each book.
registering students
assigning borrowed books to the students
noting down returned books

The second user role is Student, who have account and password, allowing the following tasks:

see which books you have borrowed and when they are expiring
extend borrowed books

Data Model

We need to have the following models:

All the books (includes ISSN, title, author as well as number of copies)
Student (student code, password, email)
Librarians (librarian code, password, email)
"Borrowed book" (record for each borrowed book, date when borrowed, date when book must be returned, link to student and link to a book)

Reports

A Librarian should also be able to see several reports:

List of Student ordered by a number of "Borrowed books" which are Overdue


Computers are down; what's in your bag of tricks for teaching CS when they can't get on a computer?

There are lots of great activities at CS Unplugged that do not require a computer. Excellent activities in their own right, you don't have to wait for the days when systems are out. Well worth exploring these resources.

This resource is provided by the Computer Science Department at the University of Canterbury, New Zealand, and shared under Creative Commons BY-NC-SA 4.0 licence.


Why is the critical-section problem always presented with code in infinite loops?

One reason infinite loops are used could be so the problem can't be solved by letting one thread complete the code before the other thread starts it. With infinite loops, no thread ever completes the code. Of course, using a bounded buffer has the same effect.


What is the best way to teach JavaScript functions to middle schoolers?

I apologize in advance, but I'm going to be a bit hard on you.

First, your goal of keeping it simple is a good one that I applaud. You are right, IMO, not to bring in advanced features too early.

However, this is not the sort of code I would show to a beginner. Ever. It is the kind of code that, if submitted by an early teen would be fine, but not the sort of code that a teacher should show, lest it be emulated. If this were submitted by a college first year student, as part of some project, it would be severely downgraded.

I think students should only ever be shown code, from instructors, that they would be proud to emulate. But I think the lessons taught in this code need to be unlearned before the student can gain a proper understanding of how to program. I would use some completely different example, even if I was only interested in syntax, which I don't think you should be. You can also teach deeper lessons, just by example, by choosing what code you present to students.

Let me list a bunch of criticisms of the code, that are easily corrected, but using a different framework possibly.

First, the function names aren't descriptive in any way of what the function does. Also, they aren't functions in the classic sense since they return nothing, but that is just an issue with how javascript is built. They are procedures (actually commands since they don't have arguments either). But "intention revealing names" are a really good idea so everyone should use them, and novices should see them. So, askCirculatoryQuestion is preferable to askQuestion1.

Next, the formatting is a bit sloppy. A minor issue, but, if you are only a bit sloppy it won't be easy to teach them not to be.

Next, your var should probably be a const. There is no intention to change it. (Note: I'm not a javascript wizard, so I hope this is possible in this context.)

Next, you use an identity comparison, so, in the first function neither "the circulatory" nor "circulatory system" would be accepted. This is a human factors issue and may be the main objection to the example overall. An example without such an issue could probably be easily devised. But code that frustrates uses is not what you should show beginning students. But parsing user input is a genuinely difficult problem, of course.

Next, you make assignment here to a global variable, which is a tool that shouldn't be in the beginner's toolbox. It is an advanced incantation suitable only for trained wizards. Such practice makes larger programs much harder to understand and debug. Even wizards use this "spell" sparingly.

Finally, blasting alerts from a function is likely to mislead them when you try to teach real functions (that return values). Too many students have a very hard time with the notion of "return", and think that blasting out the answer is the correct way to write a function. You are laying a trap here that can cause issues later. (Confession: I once had that misconception. It made it difficult to understand program flow.)

Overall, my suggestion is to show students only the sort of code you'd like to see from them, not just now, but in the future. Yes, keep it simple and yes, keep it motivating, but make it poetry.

The code you will get from them is probably going to be worse than the code you give to them. So, always show them something they can emulate and that any teacher would be proud to see from a student. Make it easy for them to build good habits from the start.

But note that your concerns are not the same as mine. I agree that it is too early at the start to stress things like the "say it once" principle and such. And an exercise in which you have them write the analog of your second function after giving them the first wouldn't be a bad idea. It reinforces some skills, which is a good thing.

Again, sorry to be so hard on you.

But lest I be entirely negative, let me also give an idea for something similar that works on more levels than syntax. I'll stick with functions and if-else as the primary lesson.

Show the students a function maxOfTwo, that returns the maximum of two arguments. The function doesn't "alert" but, instead returns the value. Then write a driver to test it and have the students execute that a few times. Note that the function needs no local values.

After that, work out with the students a maxOfThree, that has three arguments. Do this one two ways. First with nested if statements and again by employing maxOfTwo instead. Don't give this as an assignment, but work out the logic with them and then write the (poetic) code. You may want to introduce a local value, so it is a bit more sophisticated on two levels (locals and nesting). But using maxOfTwo twice is a truly beautiful solution that shows the power of abstraction and reduces complexity.

Then, you can assign medianOfThree to them to work on. I suggest that it might be worthwhile to have them work out the logic of it in small groups and then come up with the code. They can either write out the code individually (probably a good thing) or in their group. Then critique the code as I have done here.

And don't lose track of the point that writing functions is more about abstraction than anything else. It makes programs easier to understand. The only code hidden by the maxOfTwo function is a single if-else statement. But calling the function (assuming it has a good name) makes the intent of the program immediately clear at that point, where the expanded if statement does not. This, I think, is much more important than the ability to call the function from more than one place and know that the effect is the same. Note that obfuscated code still runs correctly, but it is the understanding that separates the programmer from the machine. So, always use intention revealing names.


Is there evidence of differences in the outcomes of objects-early vs objects-late?

tl;dr/ Students tend to do what they have the most practice doing. But timed contests can advantage/disadvantage some students independent of skill and background.

I have to admit I'm not a big fan of timed contests for programming. I don't know if that is the situation here, of course. The problem is that they favor quick thinking over deep thinking. If you don't have time to get something for every question your score likely suffers even if your solutions to the ones you work on are brilliant.

My advice to a student taking such a challenge would be to get something for every question.

That said, I would expect that students who have seen a lot of OO, and, in particular, have written a lot of classes themselves would naturally (and quickly) put down a class framework and then write methods. Less likely (given time constraints) would they do a problem decomposition into appropriate helper objects and composition of objects to solve any problem. It just takes too long, unless they have an IDE that will produce class/method templates at a click, or use JUnit or similar to build the application scaffolding for a given test.

Likewise, I'd expect that a student with little experience in creating classes would be more likely to just write functions, even if they had seen objects/classes. In a way, assuming that the test judging criteria allow either approach, these students may have a bit of a time advantage since there is less to type.

The psychological effect here is that you tend to do what you have the most practice doing. So Object-Early students automatically start by writing class ..... and Object-Late students may not. But there is little time for reflection on the quality of your overall structure in any case. And likely none for refactoring.

A possible countering psychological effect, since the competitions/challenges take place during the school year is that there is a tendency to repeat what you have most recently been focused on, being fresh in your mind, though less settled.

My bottom line, however is that programming isn't best tested in a timed environment, especially when the questions can be tricky in some sense, where you get an advantage, perhaps serendipitously, if you just think of the trick involved or have seen it before. Some students (my history says I'm one of them) is disadvantaged in this situation.

On the other hand, I can write code very quickly (hundreds of correct lines of code per day) with good tools and practices, including test-driven development with a good IDE (Eclipse). But if you give me a variation of NIM or some other mathematical puzzle, I'll stare at it for too long.

I also teach objects from the start (before if and while) since I value large scale structure over small. That is, providing a solid framework for the smaller scale issues.


Use of “learnable programming” (via direct manipulation) software, in teaching

App Inventor syncs with a tablet so that as students change the app's code, it changes the app running on the tab. It can't auto-sync media, so you have to re-sync the app when you add new sound or pics. It syncs via wireless network or usb.

Khan Academy offers this slider concept with its Javascript Animation lessons.


Using Oracle's Java Documentation as a Teaching Tool

One obvious benefit, which is really a good goal in and of itself, is that students get used to utilizing documentation.  Many students don't use the internet as a resource at all, and those that do often wind up on StackOverflow.  It has been my experience that the very basic searches that those students often perform wind up at SO pages that are rather too complex.  If they want to know how to find a subset of a String in Java, the Oracle documentation is really a better place to begin than Google.

Being able to read and understand documentation gives them a powerful research tool that they can utilize for future explorations.


Which of the following programming languages will help me better to teach the basic concepts of CS and why?

Of the languages you mention knowing, I'd recommend Python.

Advantages:

You know it.  This naturally applies to the other languages in your list, but there are other languages that would also be candidates if you knew them.  It's certainly possible to learn a language and teach at the same time, but best to avoid it if you can.
It's succinct. You want them writing code, not boilerplate.  It'll be simpler for them to learn to understand code logic if every line is actually doing something meaningful instead of just existing to fulfill syntactic requirements.
It has a REPL environment. The ability to do easy interactive debugging and testing of individual lines quickly will make it easier to try things out early on.
The annoying "whitespace is syntactically significant" thing, while pointless and occasionally counterproductive for experienced programmers (who would already be formatting things correctly) is actually a good thing for beginners who need to be trained in proper indentation.
Simple GUI (and other) Libraries. Anything that lets them see the results of their coding on the screen as quickly as possible will help get their interest.  And GUIs are hardly the only libraries available; chances are anything they want to play with has an associated library out there.  You want to get them writing real (albeit simple) code instead of toy programs, so they can get excited about it.
Support for functional programming. Not the first thing they'll be doing, but an advantage of Python over dedicated teaching languages that were never intended for practical use is that the advanced features are there once the students are ready for them.  They can learn the basic syntax, then start playing with, e.g. list comprehensions, then move on to a fully functional style (when that's the best approach) when they're ready for it.
Free, portable and open source. No need to tie them to a specific platform if you don't have to.  This also makes it easy for them to work on projects at home one whatever hardware they have available.

Disadvantages:

No real low-level facilities. Python won't teach them about memory management, pointers, etc.  They'll need to switch to something that does eventually (I recommend C for that), but that can be the second language.
No variable declarations. This is going to be an annoying source of bugs for beginners as well as experts; if you misspell a variable you're writing to, it'll just assume you're declaring a new variable and silently do just that.  Python could really benefit from something like Perl's use strict.
Poor scope resolution and visibility mechanisms. In, e.g. C, you can have variables that are global, local to the file, local to the function, or local to the block.  Probably in part due to its lack of explicit block delimiters, Python doesn't really have that kind of granularity; everything's either global or local.  And since it doesn't declare its variables, there are positions in the code where a write to a variable will have local scope but a read from the same variable would have global scope.  Python 3 has improved this somewhat  due to the introduction of nonlocal scope.
Python 2 vs Python 3.  Python 3 is the better language, but since it broke backwards compatibility, sometimes you have to choose between Python 3 and a library you want to use.  Less of an issue with beginners than it is in real practice.

I would also strongly anti-recommend PHP and Java; the former was put together in a very hackish manner and will teach them bad habits, and Java is a full-on new BadHabitFactory().createBadHabit().getInstance().getHabitSet() generator.


Classroom use of a limited port scan in the wild?

I taught a Cisco networking class for a couple of years and we had to stay off of the district network any time we were doing networking stuff.

What I did was build a separate network in the middle of my room with old computers. Ran network drops from there to the racks in the back of the room so we could hook into switches, routers, and stuff.

Once we got to the point where they knew how to program routers over IP instead of wiring directly in I started messing with them. For one of the labs I closed the ports they needed on the router. One student figured it out and started scanning ports on the router to see if I had changed it. I had.

We spent a lot of time going over the reasons you would want to do certain things like port scanning. When it's the right thing to do and when it's not. I also posted links to several articles about people getting arrested for computer crimes each week.

Since our network was segregated, we could do pretty much anything we wanted to on it though. A couple of times I setup a web server and had them try and break in. My personal favorite though was having a student put their iPhone on our network and had about 20 computers constantly pinging it. You could watch the battery meter dropping and by the end the phone was seriously hot.


You may very well have some examples where you can discuss state machines and hence state diagrams, that is, graphs.

For example, if you're creating a game with a computer controlled character, that character might be in different states: pursue, search, attack <-- you can introduce a graph representing the states and transitions.

I wrote about this a bit here: https://cestlaz.github.io/posts/2012-12-17-layers-of-a-lesson.html

If you have a class that goes beyond the APCS-A curriculum and do more recursion, you can look at a maze solver (as I do), knights tour, etc - this lets you discuss searching the state space graph - DFS (and allude to alternatives including heuristic search and such), paths, etc. You can also talk about circuits and cycles (knights tour variants)


Let them be creative and try to think of a use for a priority queue, and let them implement that usage on their own.

If you want something to stick, heed your own advice in bold: "Let them be creative ... on their own."

When students can use their own creative powers to synthesize everything they've been taught, then they've truly learned it. "Show and discuss" is not necessarily a bad approach, but it won't have nearly the same long-lasting effect as putting the onus on students. If you're the one working, you're the one learning, so if you're the own showing, you're really the one doing most of the work.

Plus, why not do both? Start with option #2 then analyze their own work with option #1. As with most things, it's not either/or. Imagine if the efficiency conversation were about their own implementations, not some you had shown them. That would be a powerful set of lessons.

One heuristic I apply to my own lesson planning is this: is this lesson giving students the option to take ownership of the material? When you challenge them to create, you are giving them that opportunity to -- and challenging them to -- take ownership of their learning.


Lesson ideas for introducing macros in C

I introduce C macros as a convenient way of using a single source file that can be used both when debugging code in development and for final delivery, without having to edit and and edit out test/debug code.

I am doing it, in particular, in the context of using the compiler development tools flex and bison, but it would be equally valid when using just C.

For example, say some particular function returns a value:

return(THIS_VALUE);

The student may find it helpful to know what that value is. They could use an interactive debugger, in an IDE (such as Visual Studio), or a stand-alone debugger, such as gdb. Mentioning this makes them aware of the variety of development tools available to professional developers. I also mention that it can also be done without such tools, and code developers need to be aware of these wider varieties of debugging mechanisms. I indicate one of the primitive methods of doing is to add a printf, such as this:

printf("%d\n",THIS_VALUE);
return(THIS_VALUE);

I show, using an example (in flex actually), how this can be helpful. I then explain some of the risks and weaknesses in doing this:

We spawn two versions of the code, a production and debug version of the code
We have to keep editing the prints in and out and may miss some
We may make typos and not actually print the value being returned!

I then illustrate with using the preprocessor, which they may or may not have encountered:

#ifdef DEBUG
printf("The Value is: %d\n",THIS_VALUE);
#endif
return(THIS_VALUE);

I then explain how this can be enabled by using flags in make or gcc or other such tools. The next stage in the explanation shows what can happen when this debug coding happens in many many places:

ONE:
#ifdef DEBUG
printf("The Value is: %d\n",THIS_ONE_VALUE);
#endif
return(THIS_ONE_VALUE);

TWO:
#ifdef DEBUG
printf("The Value is: %d\n",THIS_TWO_VALUE);
#endif
return(THIS_TWO_VALUE);

THREE:
#ifdef DEBUG
printf("The Value is: %d\n",THIS_THREE_VALUE);
#endif
return(THIS_THREE_VALUE);

/* The code does not really look like this. I'm just making paradigms */

I point out how really poor this code is, and how it should be re-factored. This provides an opportunity for discussing re-factoring code and the options available. One option that will immediately occur to the student might be to use some form of procedure or function, like this:

int Trace(int The_Argument)
{
#ifdef DEBUG
printf("The Value is: %d\n",The_Argument);
#endif
return(The_Argument);
}

ONE:
   return(Trace(THIS_ONE_VALUE));
TWO:
   return(Trace(THIS_TWO_VALUE));
THREE:
   return(Trace(THIS_THREE_VALUE));

Students can see that this re-factoring may have improved the code, but now has inefficiencies that the original did not. It also has become type specific, as types were introduced for the first time (not quite true as the format is typed).

At this point Macros can be introduced as a neat and useful way of conditionally including debug code with the problems of editing statements in and out from the source. Something like this:

#ifdef DEBUG
       #define RETURN(x) printf("Returning " #x ": %d",x); return(x)
#else
       #define RETURN(x) return(x)
#endif

ONE:
   RETURN(THIS_ONE_VALUE);
TWO:
   RETURN(THIS_TWO_VALUE);
THREE:
   RETURN(THIS_THREE_VALUE);

This then enables me to explain about the concepts of Macros versus functions. It also shows C stringification and initiates further discussion of these techniques.

I'm now ready to point them at some more professional discussions of the value of Macros, and in particular I like Jonathan Leffler's Stack Overflow answer.

I reinforce this by putting in the specification of their assignment that their code should implement certain specific debug flags which I will enable when assessing their work. They have to then master the technique to get grade points, in addition to having just working code.

Finally, now they know about Macros, I can talk about inline functions, how a Macro can be used to define one, based on the examples above. It also enables me to talk about compiler optimisations and how the compiler might introduce inlining itself without explicit macros from the programmer.

(This is part of a compilers course so such topics will be core knowledge for them).


Are there problem sets for trace table problems? If not, what are some good topics to cover?

I'm not aware of such resources, and I expect that there wouldn't be. These are great problems, but you (hopefully) only need to do a few of them until the concepts click into place.
I didn't know these were called trace table problems, but I have often provided them to struggling students in three different contexts:

Absolute beginners, where it helps students understand the ideas of assignment and execution order
Strugglers, where it helps students understand whatever has them lost, and
Students working on very low-level problems, such as assembly, or on processor design.  Here it is more of a basic survival tool. There are few, if any, meaningful variable names, and working your way through the values is a straightforward way of figuring out what is going on.

And this gets me to why I don't think you'll find a specific resource for problems like these: in all three of these scenarios, the actual prompt is the specific code we're studying.  Tracing the values is just a tool to understand the code that is in front of you.  The value-add (and the overarching purpose) comes from that code, not from the trace table per se.