What is the best way to learn an object oriented programming language with framework, data structure and alogrithms? At first I will say, I known some basics Python and Haskell. For now I decided to follow my programming road with Python. I have chosen a few issues and their learning path, hence I would like to know if they will be a good way to get to know Python programming language better, with the implementation of algorithms including languages, with the implementation and knowledge of data structures and modules and frameworks.

Also I would like to ask what should I add to my list or delete? Of course, the issues will be mixed up so that you do not learn only data structures all day long and maybe it is a good idea? Additionally, I would like to know if additional projects or exercises are needed in all situations? I know that some issues are very easy and after reading I am able to notice the problems, advantages, disadvantages or exemplary implementation that arise.

If I have mistaken the forum, I am sorry and I am asking for appropriate redirection.

So the list looks like:

Programming and some other derivatives

Object-oriented

Classes
Objects
Interfaces
Abstraction
Encapsulation
Polymorphism
Inheritance

Duck Typing

SOLID rules

one responsibility
open + closed
substitutions Liskov
segregation of interfaces
reversing dependencies

Tests

Unitary
Functional
Integration

Monkey Patching
REST

HATEOAS

PEP8
MOCKS
VirtualENV
Asynchrony
Python Idioms

Decorators
Gneratory
Mapping
Meta class

Any other things from Python

Mutable and immutable objects
__init__
__str__
iteration
self

MVC

MVT

Frameworks

flask
pandas
tornado
django (basics)

Patterns
ORM

Modules

NumPy

Database

NoSQL

MongoDB

SQL

MySQL

Additional items

Git
Docker

Project patterns

Observer
Builder
Facade
Factory
Singleton antisense

Data structures

Basics

Stack
Queue
List

One directional
Two-directional
With the sentry

Trees

Binary
Binary searches
BSP
AVL
T
B

Graphs

Algorithms

Operating principles

divide and conquer
greedily
dynamic
linear

Techniques

procedural
recursive
object-oriented

Sorting

Bubble
Insertion
Quick
Merge

Search

Linear
Binary

Graphs

Dijkstra
DFS
BFS
Kruskal
Prim

Data mining

C4.5
k-means

You certainly don't need a list longer than this one. If you do even half of this you will have learned enough to know pretty much what should be next. Having a complete list now gives you very little.

What you really need is practice and feedback. For practice, find some significant problem and build a program to solve it. Use the best methodology you know about (including testing) and if it works, fine, otherwise look at some other methodologies. You can often find problems in books or online, but knowing that something is significant is harder for a self learner.

But the biggest impediment for the self learner is getting adequate feedback. Just because something works isn't evidence that it is actually good or well structured. For feedback you need someone with more python knowledge than you have and who can comment on your code and even on your approach. That is one of the big advantages of taking regular courses. A teacher/professor can provide problems that are just hard enough to stretch your skills, but also give you the feedback on what you are doing and point to the next steps.

But reading about all those things won't make a programmer out of you, nor will building a "complete" list.

Write programs. Get feedback. There is no shortcut.


How to structure a Predictive Keyboard project similar to GBoard Many are now familiar with GBoard, the Google / Android predictive Keyboard. I don't actually know how it works. Obviously it must gather usage data on the device where it is being used, but it probably also includes a database of general usage patterns, downloaded initially and perhaps updated periodically. (Well, that is how I would do it.) In this way, it would be like a spellcheck database that let the user add (and subtract: manger is not too good in a business context) words.

I have long been brushing aside the obvious question of "how does it do that?", but this morning as I was texting, I suddenly recalled the article in [Scientific American* (long ago, can't find it on the web) about Markov Chains and a simple program called Mark V. Shaney that would learn and then output words in a sensible order. That is how it could work. It should be quite easy to store and compress such a simple database.

The particular thing I am focusing on is how GBoard offers three word suggestions as I type, so that I can just pick words instead of typing the words in. The prediction is at the word level, not the letter level. What frustrates me is that it usually does not offer the proper tense for a word, making me type far more letters until the proper word shows up. For example: I want to type "He has started on it" and I type H and choose 'He' from the suggestions, then ha and pick 'has' then type sta and the suggestions are: start starts starting, none of which agree with has. Why doesn't it go right to started?

Has anyone implemented a similar project for analyzing and predicting or even uttering strings of words? It seems dead easy using Markov Chains. Do you think this would make a good project for using things like a 'dictionary' data structure to store words, and some kind of tree to encode the word association weights? Sounds like it would be very interesting to present-day students, already using the product.

The SciAm article mentioned is likely: Dewdney, A.K. (June 1989). "A potpourri of programmed prose and prosody; Computer Recreations; computer-generated commentary". Scientific American. 260 (6): 122–125. doi:10.1038/scientificamerican0689-122.

Markov Chains are great for putting out nonsense based on statistical data. However, a predictive keyboard that outputs nonsense isn't very useful. It needs much more context than a Markov Chain can produce. Such a program would base its next output entirely on the most recent entry.

That said, a project to do something like the Mark V. Shaney program might be fun in an Introduction to Data Structures course. However, it is unlikely that students would have previously seen Markov Chains at that point in their studies so some background in that would also need to be incorporated. Markov Chains might be taught in a Discrete Math course, but that usually comes later. Some schools might teach these two courses in tandem, however, making it a bit more feasible.

Such a project would, however, also have the advantage that the statistical basis (the Dictionary) used could introduce concepts of Big Data and how to process it.

You are correct that a predictive keyboard uses past data, but I'm pretty sure that it is based on a much more complex predictive model than could be provided by a Markov Chain. "Predictive Keyboard based on Markov Chains" is probably an oxymoron, though. You can do either or, but likely not both together.


Best practices for letters of recommendation in CS As a college professor, I am often asked for letters of recommendation by my CS majors. I have templates, for whether the student is applying for grad school, for an internship, for a scholarship, etc. Each of my letters ends up being 1.5-2 pages. When I read letters, they are often much shorter, sometimes only a paragraph. I have no experience with CS jobs outside academia, and I'm starting to worry the letters I'm writing are too long (though I do have a good track record of students getting what they applied for). First question (with an eye towards CS internships or jobs especially):

  (1) How long are your letters of recommendation?

Another question is scalability. Each letter I write takes me about 1 hour, and the original templates took longer (probably 3-4 hours each). Every year, more and more students are asking me for letters, so I wonder if I should find a way to do it faster. Hence my 2nd question:

  (2) How long does it take you to write a letter of recommendation?

I write a paragraph saying who I am, and where and how long I have taught.  This is standard for all letters.

I write a brief second paragraph stating how long and in what capacities I have known the student.

I then answer these four questions from an old Columbia form.

A.  Please tell us about the candidate's intellectual qualities and
academic work.  We are interested in the nature of his or her motivation for scholarship, breadth, and depth of intellectual interest, originality, and
capacity for growth.  Cite specific examples where appropriate.

B. What are your impressions of the candidate's character and maturity?
How do fellow students, teachers and you regard him as a person compared with
contemporaries?  Does the candidate show open--mindedness toward opinions,
values, and backgrounds different from his own?  Does he have any special
strengths, weaknesses or problems of which we should be aware?  We would
welcome any additional comments you think might be helpful to us.

C. What has been the candidate's most valuable contribution to your
class?

D. Do you have any reason to doubt this student's integrity?

Lastly, I have a closing paragraph that looks like this:

Thank you for taking the time to read this letter.  If you have questions,
please send me e-mail at XXXX@gmail.com; this account is entirely separate
from the school and you may communicate in complete confidence.  You may also call me at home in the evening at 919-XXX-XXXX.

My work phone and address appear in the head of the letter.


Is there some meaningful percentage of students who can't learn to program? A few days ago, I had a high school sophomore (who is now in her third CS class, having passed the prior two) look at this Java code for a solid 3-5 minutes, and was unable to figure out what it did:
int answer = -1;
while (answer < 1 || answer > 5) {
    System.out.println("Please enter a number from 1 to 5.");
    answer = myScanner.nextInt();
}

She couldn't identify the ending condition of the loop, and didn't understand why answer was initially set to a number outside of the 1-5 range.  The understandings that she would need to comprehend this code was covered in a prior class by a different teacher, and it was covered a second time from first principles in mine.
I don't particularly need help with this student.  I will tutor her and give her extra worksheets.  She will almost certainly skirt by and do okay, but if the past is a good indicator, she might never be able to quite put it all together, and larger projects will be impossible for her without some outside help (which I will make sure that she receives).
However, every year, I find a small number of students who just don't seem to get it.  They muddle through, but the CS major program becomes harder and harder for them as their four years go by.  Must it be this way?
Is there any evidence or reason to believe that there are students who genuinely can't learn to program?  Or, flipping the question around, is there any evidence or reason to believe that every student really can learn to program?

There are a number of reasons why students don't learn, but few non medical ones why they can't. Leaving aside the medical reasons, such as hormonal imbalance or other disorders, I think that students who don't learn either have little desire to learn or have had poor teaching in the past. Even students with some learning disorders can learn given desire and patient teaching, but it can take a lot of work and understanding of the student to enable it. Once common problem with students is extreme introversion. That can make it difficult for the student to seek help and ask questions. It is good if you can find ways to help students deal with that in a positive way. See this question for more on the idea here.
Desire
Some students don't learn what you are teaching because they have little desire to learn it and no incentive to put in the work required. They may be in your course for the wrong reasons and would rather be anywhere else if it were only possible. They put in the time, but nothing else. There is probably not a lot you can do for them as that desire needs to be internal. Some students develop desire after a period of indifference, but I don't think this is common. I've had undergraduates in CS who were only in the major because their family (father) would only support them if they stayed. Such students can be counseled to study something more interesting to them if possible, even if it requires doing that in addition to computing. Better, though, if you can counsel the parents to better support their child.
Some classes are required, of course, and so interest for some will be higher and for some it will be lower. If you know something of the goals of the student you might be able to connect the current class to those goals, increasing interest and desire.
Poor Teaching
Many students do poorly in CS (as in mathematics) due to poor or indifferent teaching; especially the attitude among some teachers that it is OK to leave some students behind. Not every student takes the same amount of effort to teach and every student learns differently. My usual mantra in this situation is that "Your students are not like you." They learn differently than you did. Your presence in the classroom as a teach is proof enough that you are a special case.
Some especially bright kids do poorly in school because they are simply bored and nothing is exciting enough to them to put in the effort. Some students find other subjects especially easy and don't really know what it is like to have to work to learn. Some students don't learn because no one ever taught them how to learn. Some think that hearing something once means they have learned it and are surprised later when they can't recall something, wondering why you never taught it to them. Some students have a fundamental misconception about some small thing that has snowballed into a big block. Some students have never had a positive learning experience (maybe generally and maybe just in some topic) and simply hate everything about the process. Some teacher say incredibly stupid things to students and even some institutions have incredibly stupid ways to deal with students, actively damaging them.
I have examples in my learning and teaching background of each of these things.
As a student I was a thought not very bright when I was a kid and was nearly "held back" to repeat an early grade. However, I was just deadly bored with school. No one ever bothered to tell me why I was there or why or how I should try to succeed. Being bored I was a bit of a troublemaker, leading to lack of support from teachers. Later on, I was given an IQ test and the results were reported back to me as "You probably have the skill to succeed in a Junior College, but probably would only be frustrated by a full undergraduate program." I later earned a PhD, of course, so the assessment was a bit "off". The first course in which I actually learned anything was in Plane Geometry in HS. I got entranced by the problems there. Prior to that, mathematics was, perhaps, my worst subject. The doctorate is in Mathematics, of course.
In teaching, I once had a student with two problems. First he was dying of a chronic condition, but also he had been given misinformation about the precedence of operators by some early teacher that was reinforced when he used a too-simple pocket calculator. He couldn't seem to get it right in elementary programming and learned to hate it. He thought he was stupid that he didn't get it and he thought that all of his teachers also thought he was stupid. I think I managed to convince him otherwise before he died but we banged heads a bit before the reason for his difficulties became clear to me. It took a bit longer to convince him that I wasn't actively trying to deceive him.
I once had a class of students who were almost all doing very poorly. Since my teaching style then was to face them, rather than lecture with my back to them, the diagnosis was pretty simple. No one had ever taught them how to learn in a classroom. They sat passively and listened and watched, taking no action themselves. I asked one why he didn't take notes and he pointed to his head and said "It's all here." Well, I had evidence otherwise, so had to interrupt the syllabus to actually teach them how to learn and to force them to actually do it. I've discussed part of the method in another answer on this site.
Solutions
If you want to teach every student, however, you need to know every student. If someone is doing poorly, you need to try to understand why that is and to tailor a solution to their needs. To do that you need to be dealing with a reasonable number of students, of course, so if you are a professor of 800 students, the individual care must be given by your army of helpers. But even wit 20 or so students you need help. This is why pairing and group work is so important and why you can't always let students choose their own groups. You need to get feedback from the members of the groups (peer evaluation) and you need to find ways to act on what you learn.
The solution to teaching every student is not to individually tutor every student, but to find ways that every student can learn what they need to learn on their own terms. Not every student wants to earn first marks. They want to learn "just enough." They are satisficing rather than optimizing. You can make that work for them too, so that "not earning first marks" doesn't mean "failing."
Success Story
I once had two students (compiler course) who were repeating the course after failing it. The classmates of these two were generally among the best I've ever had in one group. But these two had, seemingly, never had a positive experience in CS. They seemed to be dull, requiring repeated explanations of the simplest ideas over and over. Fortunately the course was taught in an incremental way in which the students could accumulate points toward success rather than by demonstrating it on exams: a project course. I convinced them to come to my office hours and there was never a time thereafter that they weren't there. Fortunately the other students didn't require such high maintenance. I also had simple ways for students to ask questions when they were working on their own and so these two could get small helps whenever they needed it. It turned out that these two wound up (a) explaining things correctly to me by the end of the course (b) earning the highest grades that term, and (c) angering the other students who thought I'd put these two in the class to make themselves look bad. My last contact with them was to remind them of what they had done and that they could repeat that elsewhere if they were willing to put in the same amount of work. I think that teamwork also helped here and they supported one another throughout. Note that I didn't need to put additional time into the course for this to happen. The office hours were required and the mailing list for questions was a common feature of all my courses. Another question here seeks ways to make this out-of-class communication easy, though I think it needs better answers at this time.


Is there any formal education for programming? Other than a CS degree? Are there any universities that give you a Bachelor's in programming? I am aware of Computer Science BSc, but it's a little too broad in scope.

The short answer: no!

The long answer:
In my opinion if you really just want to focus on programming either a paid programming course could be the correct choice or just self-taught learning by doing. Of course you'll miss lots of theoretical things that will be important for an abstract view of programming. And also more complicated problems might need the theoretical knowledge you would gain at university.

If you want some certification of your knowledge, I would recommend you to gain enough knowledge in a language that has certifications and just get this certification.


How Can I Explain The Concept Of Zero Knowledge Proofs To Students One of the trickier concepts that comes up in the realm of cryptography is the notion of zero-knowledge protocols (also referred to as zero-knowledge proofs).  This is a way to verify an end-user's identity without having to store a password or some other sort of proof of user identity on the server. As you can imagine this is a lot more secure because if a hacker hacks the server, there's no secret for them to discover about a given user.

How to explain this idea to students though?

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.


Teaching OOP in Java, to students who already know Java I am going to teach a course in object-oriented programming in Java, and am looking for materials - textbooks and slides. It is a course for 2nd-year undergrads. In the 1st year, they already learned an introduction to programming course, also with Java. So, books that just teach Java will not be good textbooks. What are good textbooks for such a course?
Additionally, are there existing courses where I can get slides and other course materials, so that I do not have to prepare everything from scratch?

I'm going to jump the gun a bit here and make a suggestion with less than complete information. Assuming that the students have seen a fair amount of Java and its libraries and also assuming that the book they used isn't terrible on OO concepts then I'd suggest that you run a project course. There are a fair number of possibilities for projects

One is to use your own doctoral research interest as stated in your profile and have students build a software system to solve fair cutting problems.

Another possibility is to use an old APCS Case study that was quite well developed and used for a few years in the APCS course in the US: Grid World. The study comes with a starting code base and a student manual.

You might also join the Greenroom and look at the various projects available there. It is also a community of educators who might be able to offer assistance. The Greenroom resources use the greenfoot IDE which is simple but complete, but the advantage in your situation is the various projects that you might be able to develop into a course.

The BlueJ IDE is a bit more sophisticated and the community there also publishes a number of projects via the Blueroom. Many of them might be considered as the basis of a project course.

Of course, another consideration is how well you know Object-Oriented programming yourself, as you don't say. If you are less than an expert, you might consider for yourself to look at something like Polymorphism: As It Is Played by Joseph Bergin. I don't think it would be suitable for a course text, but it might give you some background in OO thinking if you haven't already acquired it.

I also note that in a project course you have the opportunity to introduce students to some of the additional personal practices they will need as they advance, such as teamwork and, perhaps, pair programming and test first development. Moreover, to ease your own workload, a project course could be very flexible, with students starting work on early requirements while you develop later ones. I'm thinking of something like an agile methodology here, of course, with yourself as the students' "customer".

Of course, if you want them to learn OO style and not just build code, then you need to watch over them. There are a few ways you can do this. I'm assuming that your class is reasonably sized (say 20 or less). I'm not sure how to make it work for 80. You can use the class time as design sessions for coding. You can have students work in groups for a while and show you what they come up with. Initially you can suggest designs for sections of the project. The idea is to "nudge" teams in the desired direction, rather than to lecture on the ideal.

I used to teach the Compiler Course in which a goal was also to improve OO thinking. I would review the student's code every two weeks. Student pairs (or teams) would submit printouts in a folder every two weeks. They needed to use a highlight marker to mark the changes from the previous report. It is relatively quick to go through 10 or so folders if marked up. You don't need to note every detail in these, nor do you need to grade them, but just give any needed feedback. For many groups as check mark is enough. But for some, you know you need to provide more guidance.

If teams are larger (say around 5-6) I would do two things. One is that I'd appoint a "captain" who was responsible for keeping me informed (not for team management). I could discuss the periodic report with him/her. Depending on the number of students, you could have a weekly "captain's meeting" as part of class or office hours, perhaps. I also named teams with names they though clever to give them a sense of belonging. "Lions" and "Tigers" might work, or "Earth" and "Sky". I made up the names to avoid possible improper "creativity."


How can I explain the difference between CS and coding to a layperson? I was at a party a few days ago with a doctor (the medical kind, not the research kind) who was thinking about writing a computer program to solve a scheduling problem at work. Someone introduced him to me because I have a CS degree and worked as a software engineer for a few years.

It wasn't long before we moved on from the specific problem he had (for which the answer was "hire a freelancer" or at least "I can't solve this for you just standing here with a beer and without a computer") to talking about computer science in general. To his credit, he asked good questions, picked up on the answers immediately, and asked smart follow-ups. But a lot of stuff that's second nature to us CS people was totally new and surprising to him.

The big one, which isn't surprising in hindsight but which we didn't get to until late in the conversation, was that computer science isn't the same as programming. There was also the fact that complexity/Big-O makes a real difference, and that the Halting Problem/unsolvability exists. It kinda made me feel like I wasn't a great ambassador for CS.

My actual question here is: how do you explain computer science to people when you have not a year or a semester, but just an hour, or even only five minutes?

(This question might be a little outside the typical scope for this site, but it's still relatively early in the beta, so I figured let's give it a shot.)

I regularly have to explain what computer science is to parents, and I have lately settled into this explanation:

Technology keeps changing all the time. You get used to the menus in Microsoft Word, and then they change it to the Ribbon. You learn to program buttons in Java using Applets, and then Applets get removed from every major browser as a security risk.

But there are some things that never change, because they're in the realms of mathematics, or they are fundamental organizing principles.  For instance, computer right now work in binary, 1s and 0s.  The properties of binary numbers themselves aren't going to change no matter what new technology comes around tomorrow.  We might create a computer that's not based on binary, but the properties of binary itself are fixed.  This is the realm of computer science.  Computer science is the foundational stuff that doesn't change.

It's highly mathematical, highly theoretical, and there are a lot of proofs involved, but when you study computer science, you are studying the deeper question in the nature of computation itself, and that's stuff that never gets dated.


The use of the Octal system I was teaching the Octal number system and a student raised the question "Why should we use the octal number system, if we have binary and hexadecimal?" I was very confused, trying to explain the importance of this topic.

For context, I am teaching a course about the relationship between hardware and software.

The value might not be in knowing octal itself (although as noted in the comments, there is inherent relevance to it). Rather, it might be what learning different bases teaches about abstraction and the representations of numbers in general.

I think of this Essential Knowledge statement from the AP CS Principles curriculum:

  EK 2.1.1G Numbers can be converted from any base to any other base.

The transition from decimal to binary is one step, and the move to hexadecimal can be an even bigger jump. To then have students see that there can be base-8 or base-32 or base-60 or base-37 is at times mind-blowing. The design of a particular base system, while not entirely arbitrary, is a design choice that comes with advantages and trade-offs.

Moreover, this process of conversion to and from different base systems strengthens students understanding of the underlying algorithmic process. The example I share with students is that 100 in any base system is equal to the value of that base squared. (Indeed it verges upon tautology.) Part of that is breaking down the idea of the 1s place being followed by the 10s followed by the 100s, etc. and replacing it with 10^0 followed by 10^1, etc. Replacing 10 with 2, 8, 16, or any other integer becomes trivial.

Having students see that 100 is not so much "one hundred" but a combination of base numbers and exponents and why that is is powerful.


What Notation for Teaching Boolean Logic? I'm a retired college teacher now teaching things like Boolean logic to students in several middle schools (ages: 11-14).  I taught that module for the first time last week and discovered to my chagrin that I had mixed two different notations.  I'm teaching specifically logic expressions, with very little manipulation using the identities of Boolean algebra.

I started out with the standard notation of logic: ∧, ∨, and ¬ but used center-dot, plus, and overbar by accident in a table of identities.  I worry that using + for inclusive disjunction will confuse students, and I know that implicit multiplication, i.e. AB for A∧B is confusing.

I hesitate to use the notation of programming because it seems Java and Python are equally popular, but with very different notations.  Java's use of ^ for exclusive disjunction further muddles things.

Does anyone know of research or have practical advice on what notation I should use to teach these concepts?

Edit: OK, I've accepted an answer, and decided to use the engineering notation, but to present a table comparing notations near the end of the module.  I chose end rather than beginning because I want the students familiar with one notation before I present the others. I'm going to start another question about how to explain + as OR.

If your students were a bit older, I'd be more comfortable with the following, but suggest it anyway.

There is an advantage for a student to know that the concepts exist independent of any notation and that historically  notations have differed based on use and context.

I would, myself, provide them with a handout giving names to the concepts and various notations used for each. Then, I'd use the various symbols as naturally as possible, responding to the inevitable questions.

The only caveat would be that you don't mix the different systems in any given lecture/conversation. You should also suggest that the students be consistent as well.

The rationale here is that students will likely see different symbols sooner rather than later if they do any reading or research outside your instruction. It is better that they have some preparation and at least a hint that the terminology isn't entirely consistent or standardized.

Some of the terminology, by the way, such as + for "or" is actually tied to the concepts in interesting ways. For example, the similar shape of ∧ and ∩ help students understand the relationship between logic and set theory. Some of the symbols, on the other hand, were chosen for no better reason than that they exist on common input devices such as keyboards.


Online classes: Any good ways to avoid having too many interruptions but at the same time not leaving anyone behind? I've attended a couple online classes and I'll be teaching my own in a short while. And what I noticed is that usually the lecturer has a lot of interruptions from people who ask them to repeat something, to clarify on a topic, or they even divert the topic to ask something else (like "can I do the same thing with a different IDE?").

When I teach on-site I notice I don't have as many questions as I've observed here (probably because "hiding" behind a computer screen makes people more comfortable to ask questions). And I really welcome all kinds of questions and hate it when someone gets behind just because they're afraid to ask.

So I'm trying to find a balance here. It would be a great thing if I had someone assisting students, so they can go on a private chat with whoever is asking a question and answer without disrupting the class. But that's not a possibility here. It's just me. And I also know another option would be to say all questions will be answered at the end of the lecture, but I'm hesitant on this since the risk of leaving people behind during the class is higher.

Any other ideas on how to handle this? I'd hate to be one of those lecturers that talks non-stop with people just nodding without understanding too much of what's being said.

If you go through your lectures, you'll find most of the them actually cover between 3 and 6 separate distinct topics. We can take advantage of this to improve online delivery. Well before an online class meeting, look at your notes and identify those topic areas. Now instead of one meeting, think in terms of a separate session (usually 10 minutes or less) for each of those shorter topic areas.

Even better, you can almost always find good content freely available online that will cover those topics. Where finding a single replacement for the complete lecture would not have been possible, the smaller topics will each likely have a good option or two available. This online content will often be produced, in that it has good lighting, supporting animations, edited closed captions, etc. If you define the topic narrowly enough, this often even holds for upper-level undegrad work (graduate coursework may be different).

Now you can assign these videos as prerequisites for your class meeting (often with a very short and low-value quiz, just to provide the extra incentive for students to complete this work). You may still need to cover one or two of your original topics personally, but finding the videos is often much less work than creating or delivering your own.

This now lets you change how the conference session is run, whether on Zoom, Hangouts, Teams, Skype, WebEx, BBB, BlueJeans, or whatever. Lecture content is now much shorter, if it happens at all, and therefore less susceptible to these interruptions. Instead, these meetings are about handling class business: introducing homework, setting expectations, providing review material and guides, helping students understand where to pay the most attention in the outside material, and answering questions... you know, the kind of question that would have been an interruption before. It's now part of the primary purpose of the session.

Pedagogically this is called a flipped classroom approach, and it has a number of documented benefits outside or our current situation: Students learn better with the shorter 10 minute sessions, they have the original lecture material for review, they can catch up much easier for missed class times, they can use their video player to slow down or speed up delivery, or pause to take notes without disrupting other students, and it increases student access to the instructor.


Classroom use of a limited port scan in the wild? Under what circumstances is it ethical for teachers to teach the existence of a tool such as MXtoolbox? Under what circumstances is it legal and ethical to use a superficial scan with protocol-adhering requests to scan a target that is not your own?
Portscanning a school district's web or mail server is likely to be regarded as hostile under any circumstances without working with the school's IT department. Students are likely to do so if they know about such a tool, even if warned about the consequences.
Background:
The Computer Fraud and Abuse Act (CFAA) makes it a felony to access computer resources that are not your own without written permission from the owner if such access causes $5000 damage or more. The CFAA identifies as damages the cost to investigate any potentially unauthorized use and harden the resource against such future access.
No one has ever been found guilty under the CFAA for portscanning, but only one judge has ever ruled on the matter and it is considered ambiguous under the law if it involves thousands of ports across thousands of computers, especially if the scan uses requests that do not conform to the expectations of the protocol at each corresponding port.
Ports and protocols are important concepts early in a student's learning. Tools like MXtoolbox perform non-damaging scans and send a dozen or so requests, one of which is identical to directing a web browser to the target.

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.


How can I integrate teaching source code control (Git/Mercurial/etc) into my introductory CS class? In the words of Andrew Clay Shafer, “In software development, version control is the foundation of every other Agile technical practice.” (Allspaw & Robbins, 2010).  Yet, 57% of CS curricula does not provide practical exposure to it. (Betz)

How can I teach the use of source code control as part of an introductory CS class?

To put it another way: How can we introduce source code control early in the curriculum?

There are quite a few solutions which allow you to make a VCS part of your teaching.

For example, GitHub Classroom allows you to create assignments with some starter code, then invite your students to work on it and submit their changes through Git. They provide a promotional video here, which shows the workflow with it.

Scaffolding Version Control into the Computer Science Curriculum states:

  VCS and other professional tools are often introduced
  later in the educational curriculum, possibly in a software
  engineering course, generally a second-year or later course,
  and may not be reinforced through repetition and application
  in later classes. This is unfortunate, because powerful
  tools such as VCS can also be difficult for new users and
  especially those new to programming and software in general.
  The power and flexibility of new distributed VCS can
  make them especially challenging, unfriendly, and distracting
  for students already fully engaged in developing core
  competencies required in the computer science curriculum.

They propose GitSubmit as a helpful solution here, describing it as "A Custom Environment for Introducing
VCS to Novice Developers". Clearly, it's helpful here to introduce VCS as soon as possible, to avoid the issues described later in the paper, where higher level students have virtually no experience of using a VCS, despite its importance in industry.

For the pedagogical challenges, the presentation Challenges and Confusions in Learning Version
Control with Git seems interesting. They conclude:

  Introduce authentic/relevant use cases to motivate the use and
  learning of the system
  Authentic practical courses cause students to see the value of
  VCSs
  However, use VCSs throughout the curriculum, as, for instance,
  limited resources available during authentic project courses may
  limit how the system is adopted


What evaluation methods can be used that don't involve testing but are adaptable to online courses The current situation with the spread of a serious disease worldwide has caused a number of universities and schools to move courses to an online model where students don't meet face to face in large groups.

The problem of evaluating students then arises, and traditional tests are ill suited for an online model as it is much harder to monitor them or assure validity.

Ideally, any evaluation method should foster learning, not just memorization, so traditional testing has its own downside. Perhaps the current emergency can result in finding better evaluation methods that are also amenable to use online, as well as in traditional classrooms.

Have you used innovative evaluation methods - beyond testing - that foster good learning and proper student habits but which can be adapted to courses that don't meet face to face for instruction or testing? Can you describe what you do.

My own preference has long been to replace traditional tests in ordinary classrooms, and especially high risk, anxiety inducing, tests with small group and pair projects. This was combined with peer evaluation. In the current situation, it might be acceptable for students to meet in pairs or small groups with less risk than meeting in larger groups. But, it would probably have to be done in a way that meeting face to face is optional.

As part of an algorithms module (first-year undergraduate level), I got students to choose a computational problem from a list of options I provided, write an algorithm to solve it, and write a 750-word report explaining:

The problem in their own words,
How their algorithm works (with code), and
How they tested it.

Students had a few weeks to complete this task, worked in their own time, and then submitted their report to the university's Moodle site; so this kind of assessment could work equally well in a non-face-to-face course.

The idea behind asking students to explain their algorithm came from the fact that interviewees for software jobs often have to solve a problem during the interview and explain how their solution works. Being able to explain how one's code works is also important for many other things a programmer might do, like rubber-duck debugging, code review, or writing good answers on Stack Overflow.

Your question doesn't dwell on it, but one of the key differences between in-person and online assessments is the opportunity for cheating and the difficulty of detecting it. As a convenient side-effect of having students explain the problem and their solution in their own words, suspected cheaters can be identified in two ways:

A student who is unable to write the code themselves is usually also unable to adequately explain how the code works.
A student who also copies the explanation (or parts of it) can be detected by standard tools such as TurnItIn, so you don't need a more sophisticated tool for comparing code similarity.

In the former case, a poor explanation deserves a low grade anyway, whether or not they cheated. In the latter case, my experience of running the assessment over two years with ~250 students each year is that TurnItIn works well enough for catching students who copy from an online source or from each other. With fewer students, you can group the assessment submissions by which problem they attempted, and probably notice any collusion yourself even without a tool like TurnItIn.


Are programming contests beneficial to students? Background: I’m not entirely a CS educator, but I did run into a debate on whether programming contests are good for students.

A lot of people around me have fun in programming contests. Usually, those contests require participants to “solve” several problems (like 7 to 8) within certain time (2 to 3 hours). Students are ranked by their scores, calculated from the number of problems they are capable of solving, and then the time spent. There are test cases on the submission system to which students have to submit their source files, and the submission “passes” when it compiles to a program which passes all the test cases.

Given all these, while students are (probably?) good at problem solving skills, there are several problems:

Students focus too much on the time spent on writing their programs. Therefore, they employ a lot of poor practices. For example, they always use short variable names, universal headers (#include ), using namespace std; etc in order to speed up their typing. They claim that iostream is implemented on top of C’s stdio and so they use printf even in C++.
They always put extra assumptions. For example, while they know how to find the “unpaired” integer in an integer array (by taking the XOR sum), they won’t think of how to check whether the array has only one unpaired item. Also, they usually allocate large arrays in advance and skip bounds checking (they believe the array is large enough), which create concerns in both program stability and security.
They don’t understand how to maintain a large project. Since OOP (usually) requires them to type more, they, for example, manipulate raw arrays with a part of custom heapsort algorithm, instead of creating a struct representing a heap, when they are writing in C. While sometimes OOP is unnecessary, for them code reuse is either impossible or requiring a lot of copy-and-paste.

Programming contests are useful for some students in some contexts, but they're harmful to other students in other contexts.

Contests are useful for students who already self-identify as programmers, are motivated by competition, and enjoy the high-stress environment of a competition. But like you said, the skills acquired by participating in programming contests aren't always useful outside of that environment. I'll also note that your examples are all very math-oriented, so the contests might be geared towards students with a more mathematical background.

But they're less useful for students who are not motivated by competition. Notably, students from under-represented groups or who don't self-identify as programmers are less likely to participate in these, and requiring them to participate can actually discourage them from pursuing computer science.

So, while programming competitions might be one small part of a course, I'd recommend balancing it with other activities that might help other types of students, and pointing out the problems with "competition code" that you mentioned in your question.

I'd also recommend focusing on "hackathons" or "game jams" more than competitions. These have the fun and motivation of a competition, but it's more of a collaborative / cooperative environment. This can be beneficial to students regardless of whether they already self-identify as programmers.


Is there a free platform to host coding challenges within a class? I've seen many platforms that allow companies to interview prospective developers by means of coding challenges, but those are always paid.

So I'm trying to find some tool where I can create my own exercises and test cases and tell my students to go solve the challenge and see if their code passes all tests, and then maybe get a rank list of whose code has better performance (in order to make it look like a "competition").

In the past I tried to host a contest through Hackerrank but it was too cumbersome and there was no way to hide lots of auto-generated code that would just confuse my students.

It doesn't do ranking in any manner, but CodingBat permits you to create challenges with tests for your class in either Python or Java.

While the interface begins assuming that you will have one method, you can add as many methods as you wish.  However, you are limited to one class (so no inner classes), and you are forbidden Exceptions, so the projects would have to be fairly small in scope.


Reference request for resource with difficult programming exercises I am asking this question on behalf of my brother. He is taking his first programming class. So far he has just learned the basics (if-then statements, for loops, while loops, etc.)
The class is using the book Problem Solving and Program Design in C, but it's exercises are too easy. Is there a programming book or other resource that has more difficult exercises? Of course, the book doesn't have to be for C specifically, as we just need the problems.

If he wants to have a blast biting into some very fun and challenging problems, Project Euler is fantastic, and entirely language neutral.
He may find that certain problems are out of his grasp until he learns a bit more programming, but there will be many that will be possible even with what he has.  (Arrays, structs, and pointers should make all of the problems accessible, even if some of them are still possibly too hard as problems before he has a good understanding of linked lists and trees.)


How to keep students heads from exploding from complex, interconnected topics My students will soon be learning ADO.Net in C#, adding on to the Windows programming skills that they recently gained. Just a few pages from one chapter in the textbook introduce the set of layers and interconnected objects needed to do the simplest first program: a DataGridView that allows full update of a table. I have taught this once before, so I have some idea what landmines to avoid, but the fact is that they will need to know pretty much the whole picture to do anything. As Chogyam Trungpa said (about the spiritual path), "It is like swallowing a porcupine: once you start, you have to eat the whole thing."

I was able to learn and understand all of this last year because I had the fortunate accident of a very intense introduction to database programming in my first "real job" in 1989, taking over the development and support of a PC distributed database product written in C. I had no significant instruction in databases before that except to do some work with dBase III. I know the concepts that dictate the structure of the ADO.Net classes, because I learned these fundamental, invariant ideas in an entirely different context. Thus, I can also teach these concepts.

But with so many moving parts to master up front, I think that the students get very deeply lost, and it is hard to disentangle their errors and help them even start on some lab exercises. Do you have any suggestions for how to introduce a subject where one must know so many new ideas all at once in order to begin?

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!


How do I approach teaching Python to 12-year-olds as a first-time teacher? I'm currently teaching Python, to three 12-year-olds. They have no experience at all, and my task is to introduce them to programming concepts, and to Python. I'm fairly experienced in programming, and I'll be starting my third year of computer science at university next year.

What I'm trying to ask here is, how do I get my mindset to their level? They struggle with understanding what a variable is, have trouble understanding flow of the program. What can I demonstrate to make them understand better?

I've already tried introducing variables, print function, and some flow controlling through conditionals (all came together in a little calculator), but I seem to fail at making it easy for them to understand.

Check out the Python books written by Al Sweigart. His homepage Invent with Python includes some great, free resources that are geared to the age range of your students. In particular he focuses on creating games which is, in my experience, an effective hook. Two books to use to inform your teaching are the following (in order):

Invent Your Own Computer Games with Python
Making Games with Python & Pygame

You can read the books for free online and download each one's respective source code.
I've spent time teaching the age range in question, and most students just starting out aren't really fascinated by the finer details of variables, loops, and conditionals. They want to see something happen, to make the computer do something fun. Games are the perfect vehicle for this to take place.
Part of what makes Al's approach inviting is that there is a lot of supplied code that students can then customize. They might not get why variables matter at first, but if it becomes a discussion about tracking the level of a game or the current high score (or a list of all-time high scores), then the students' interest will be piqued.


Research On Teaching A Second Programming Language/Paradigm I've tried googling for this but I'm not sure I'm searching for the correct terms.

Is anyone aware of any research on the differences between teaching novice software developers how to write code and teaching experienced software developers a second or third programming language?  Even higher up Bloom's taxonomy, teaching them a different programming paradigm (e. g. functional vs. imperative).

I would be surprised if the approach were not quite different but what I'm looking for is some sort of empirical basis for certain practices (or avoiding certain practices).

I don't have research on it, but some experience. In this case it was teaching functional to those with some other background as part of a language principles course.

I'm a terrible Lisp/Scheme programmer so I was as outside my comfort zone as the students were. I did two things. First, I used Standard ML instead of Scheme. I can program effectively in ML, though I realize that the concrete syntax is a crutch. I need that crutch but also used it to teach students who were used to programming with such actual keywords and such. Thus, I used syntax to keep them closer to their own comfort zone.

The second thing, was comfort zone breaking. I taught by focusing specifically on the functional thought process, rather than teaching the language as if it were something fresh. "This is how you have to conceptualize the program!" "Yes, they call them variables, but they are really constants! Deal with it." "You are used to thinking this way. Now you need to think that way."

Functional programs also have a number of design patterns that are pretty ubiquitous. These patterns are part of the programmer's tool kit because if you aren't careful you can write some terrifically inefficient programs with lists if you don't know the patterns (tricks, if you will). An example is appending one list to another. It is a linear time problem, but a naive program is probably quadratic. This is probably hard at first sight for any new functional programming novice, but what is obvious to an imperative programmer just doesn't work efficiently. So, the instructor needs to know those patterns as much as they know the paradigm.

A pedagogical trick you can use, especially for manipulating lists, is to simulate the operations/algorithms using students as values and building up a list (a lineup of students). They walk through an algorithm and see how values are manipulated.

But, teaching novices with no background at all (do they still exist?) is a bit simpler. Start with simple things that build confidence for more complex things, never leaving the paradigm.

But as response to your observation that it is probably different teaching novices and others is yes. Otherwise the experienced programmers will assume too much that turns out to be wrong. The novices have fewer assumptions to make.

I'm pretty sure I've said this before here, but paradigms (consistent ways of thinking) are difficult to change. My go-to example is the change over from highly trained knights on horseback, typically noblemen, to mass armies of lightly trained peasant infantry. The Battle of Agincourt was in 1415 and proved decisively that knights were obsolete as the French army (and much of the nobility) was destroyed by an army of English longbowmen. But in about 1500, Henry VIII (1491-1547) started his training as a knight. He was the last English king who went through the complete training. So, it took about 100 years to recognize that a paradigm had died and been replaced with another. Even in England, which won at Agincourt. Henry's armor (and I think that of his horse) can be seen in the White Tower within the Tower of London.


What is good age to start learning programming? I am thinking of offering classes for people, maybe take 5 to 10 at the time. There would be 4 hours every Saturday, twice a month, for three months. So in total 6 such sessions. The language thought would be Javascript (and HTML, CSS).

I was planning to offer it to adults and kids, and especially interesting would be for a parent and child to do it together.

What do you think is a minimum age for which I should accept students, alone and with a parent?

Let me urge a bit of caution if you try to combine teaching of youngsters with their parents. Before you decide, you should look at the work of Piaget on the stages of development. Adults and teens from about 12 can learn abstractly, but those younger probably haven't yet developed the changes in the brain (including physical changes) that make that possible. Starting from around 7 kids can learn things like computing, but only very concretely.

I bring this up so that you don't wind up with classes that serve no one very well and frustrate everyone. Some programming environments stress the concrete and are good for youngsters (Scratch, Logo, and other visual systems) but adults learn very differently.

If your goal is primarily to have the parents help their younger kids to learn while learning just a bit themselves, then, I think you can be successful. Just keep it concrete and probably visual. But if you are asking more of the parents, then they might not be so satisfied and you will be inundated with questions that come from their deeper way of thinking and that won't have answers that the kids can grok.

On the other hand, if you want to start with teens and older you should have a group that is much more uniform in their mental structure and abilities so it would make a wider variety of techniques possible.


Resources for flowchart programming for young, new programmers? I'm working with middle school teachers who are teaching a CS class with middle schoolers. The students have a wide range of programming skills, and for some it would be beneficial to offer them an opportunity to plan out their programming work in flowcharts before they step up to implementing them in a language (we're using Scratch btw).
We used Canva's flowchart maker and I think that worked decently well, but I'm curious if others have tried and had success with other tools.

Honestly, I would be surprised if this method bore the kind of fruit that you hope for.  While flowcharts seem like a nice way to make ideas more concrete, I contend that they will actually become another level of abstraction that makes the task harder for middle-school students, who are only now making the transition from concrete to abstract thinking.
You're moving from boxes that represent ideas (Scratch, already one layer of abstraction) to boxes that represent arbitrary groups of boxes (now two layers, with fuzzy bottom-layer boundaries designated in the bottom later), and then making macro-decisions using those larger boxes (two layers plus fuzzy boundaries plus a lot of flexible thinking).
In short, I don't think you're going to find a big coding speed-up, or even higher quality output, from the students.  In this regard, it's a trap.
However!  I'm not going to suggest that kids can't use flowcharts.  In fact, I'm not even going to suggest that it's not valuable.  Kids who are beginning to develop abstract thought need to practice that skill-set in order to develop a richer ability to grasp abstractions as an adult.  However, I think that to do it well, you would have to be okay with the idea that it probably won't particularly help the kids with the actual coding tasks themselves, and furthermore decide that it is still worthwhile for other reasons.
If you still wanted to proceed, I would take this backwards approach:

Have the kids code in Scratch first, which gets them started with as little abstraction as possible.
Next have them construct flowcharts of what they have done, including a one-sentence description, and a NAME in the box (getting a good NAME can be quite hard)
At this point, they would be better able to manipulate those boxes.  You can ask them to present their flowchart structures (and the accompanying programs, of course!) to the rest of the class.  You can also use the diagrams that they have created to help them if they get stuck (though they may have trouble applying the solutions for all of the reasons listed above).

If you want to help them work in the other direction, you can provide a flowchart that works well, and then have them implement it in Scratch.  That can provide support for the concrete -> abstract transition they're undergoing, and also help them learn to move in both directions (Scratch->flowchart, flowchart->Scratch).
I wouldn't ask them to work with poorly designed flowcharts (such as the ones that they themselves would make) from the start -- it's not clear to me that you'll get any sort of good result from an unsupported approach like this in a classroom setting.


Supplementing Curriculum with Online Resources One of the blessing and curses of teaching CS is the plethora of materials freely available online. MOOCs on edX and Coursera. Tutorials on Khan Academy and Codecademy. Certifications through freeCodeCamp. Those sites barely scratch the surface of what is available.

How, if at all, do you integrate these or similar resources into particular areas of your curriculum? Does this integration work well for increasing student learning?

How, if at all, do you integrate these or similar resources into
  particular areas of your curriculum? Does this integration work well
  for increasing student learning?

I teach Python in a "Further Education" course- not university level but the modules compare well with many first-year BSc modules.  Students tend to have little or no background in programming.

I learned a lot from completing MOOCs, and it is somewhat problematic that there is no single source of good materials...but, some of the materials are excellent.  Unfortunately, not all learners find MOOCs to be a suitable format for learning.

I encourage students to try out a MOOC from EdX, Coursera, Udemy or Udacity, or another site. One assignment this coming year will be to document the "use cases" involved with a MOOC.  Both of the assignments I set are variations from assignments on a Rice course and the fantastic CS50 given by David Malen.

For each lesson given, consider a "Further resources" section that allows a learner to view:

Videos
Tutorials
Notes
Examples

to cater to different learning styles.  Consider setting a formative assessment to test learning, and perhaps hints to the solution are in the resources provided?

At the end of each class, use a minute paper, and it may provide an opportunity to clear up any points of confusion.

I use Moodle as my LMS, and for each part of the curriculum, I provide notes (in a folder) code and links, including videos, other courses, online discussions and tutorials.

Ultimately, it depends on the individual learner- you can lead a horse to water...etc.


What would be your ideal first lecture in a databases course? As they say, you don't get a second chance to make a good first impression. Are you aware of any notes/slides appropriate for a first lecture in databases?

Similarities

For a first lesson, what you want to focus on are anchor points, i.e. how databases are something that's closely related to what students already know and understand.

The prime example here is Excel. We've all seen a data table at some point, e.g. your grades/report card from school are a data table, or your bank transaction history.
My SO is currently in the process of a career change in IT, and I suggested her to substitute "table" with "Excel file", and it really helps to understand the big (though certainly massively oversimplified) picture.

Understanding that, a database can easily be described as a folder of Excel files. This is again massively oversimplified, but enough for an introductory understanding of what a database's purpose is.

Note that you could also represent a database as a single Excel file with multiple sheets. However, for display purposes I prefer having my tables in separate windows, which is easier when working with separate Excel files. It's purely a visual decision.

A practical example

My favorite example, probably because it's what I was taught as a first example, is Blockbuster, i.e. a simple video renting service. It's an example that can be adapted to students' growing understanding of a database structure.

In a first version, you have a single table where each record represents a rental, with customer info (e.g. name), DVD info (e.g. movie title), and rental info (e.g. return date)

If a customer rents multiple videos at the same time, it quickly becomes cumbersome to have to repeat their personal information, which leads to version 2: separating the customer information into its own table, and referencing the specific customer (by ID) in the rentals table.

The same logic then also leads you to separating the video tapes into a table of their own, analogous to the customer example.

This three table structure is fairly straightforward, easy to develop from what was initially a single table, and it teaches most core concepts for database modeling: tables, columns, records, primary keys, foreign keys, and the basics of data normalization.

Database design is a theory, not a technology

It's interesting to note that you could, time permitting, demonstrate the above implementation of a video rental database using a literal folder of Excel files. This helps separate the distinct skills of designing a database (i.e. deciding the structure) and implementing a particular database system (e.g. SQL Server, Oracle, ...)

I strongly suggest separating the two, as the complexity of learning a particular system often distracts from students learning about and appreciating the theoretical database design skill.


Intuitive example of an NP problem I was talking to a student today, and explaining that NP problems are hard to solve, but easy to verify.  I used password encryption/decryption as an example, but he got stuck.  He was unable to fathom how, given the hash, you couldn't just reverse your steps backwards to the password.

I started explaining a bit about encryption, but I came to think that my example was fundamentally not a very good one.  My goal is not to get into the weeds with encryption, my goal is to be able to explain what an NP problem is in a really intuitive way.

What is a clear analogy or example to describe NP?

If your student has tried it once, you can use sudoku as an example (it does not work so well if the student has never heard of it).

Given a completed sudoku grid, write a program that verifies that it is valid: your student can probably write this simple program in a few minutes, or if you give the answer see that it is really easy.
Given an incomplete sudoku grid, write a program that completes it. Much harder (although semi-naive backtracking works well for 9x9 grids)!

It gets even better because, if you already gave the Map coloring (or graph coloring example), you can show easily that a 9x9 sudoku is just a particular instance of graph coloring and this becomes a good example for NP-completeness. (Just remark that a 9x9 sudoku is just a graph where each vertex corresponds to a cell in the sudoku, and an edge between two vertices means that the two corresponding cells are in the same row, column or block. Once a graph is built, try to 9-color it).


Use of programming aptitude test in CS program admission For research reasons, in the last few days, I’ve been looking at several statistics on computer science programs in Portugal (but also in Europe and the US).

One of the most interesting findings is that approx. 20% of the students will drop the program at the end of the first year. But the most problematic finding is that after four years, only approx 22%-32% of the students were able to graduate in a 3-year program.

It is important to stress that in Portugal the admission to higher education is determined only by the grades that the students obtained in High School (50%) and the results of the exams in some particular subjects (Math and Physics) for CS programs, for instance (50%). In the end, only the n students with higher scores will be admitted.

Given the demand for IT personnel and the high unemployment rates of several other areas, several students will end up attempting CS.

I am aware, that some companies rely on the Berger Aptitude for Programming Test to select their candidates. From what I understood, this test is used mostly to evaluate the candidate’s ability to program and could not be used to select candidates for the CS programs.

Given this context, shouldn’t the students be performing some aptitude test before enrolling in these programs? Is anyone aware of the usage of such tests?

Obviously, I understand that one shouldn’t simply say to someone: “Hey choose something else!”. However, we are talking about several hundreds of students that are basically losing one or more years of their lives. Although this happens in Portugal, I guess the same thing occurs in other countries. Shouldn’t we be doing something about it?

I am aware of some other questions concerning programming aptitude. However, I think mine is different.

This is a great idea. We should definitely help people determine in advance what fields they are likely to succeed in. It would be far better for them, the economy and the employers to admit only people who are likely to be good candidates for schooling and employment.

The work training program that I have been employed to teach -- training adults with physical disabilities for entry-level programming jobs -- has just be discontinued partly due to the recent US Workplace Innovation and Opportunity Act (WIOA) requirement that job training programs result in a recognized industry credential leading to employment or advancement in a job. (We could not find a credential that was reachable with around a year of training.) As far as I know, this job training program was unique in the US, and it used to be quite successful, when it was possible to get a programming job with a few months experience in COBOL. This is no longer true, and we were short on incoming candidates and not having much luck placing them either.

We have now decided to offer training leading to the Microsoft Office Specialist (MOS) certification instead, which is faster and much more likely to get people in to jobs, and we can serve far more people a year that way.

I am just a little curious though, as to why someone didn't see this coming long ago -- the calls for prequalification for education and for screening of employment candidates -- back when the US Supreme Court passed that decision in 19711, making it illegal for employers to use screening tests that "could be biased"? (The decision that led to employers simply requiring a college degree instead, which has been implicated as a cause of the mushrooming demand for and cost of college and university education.)

Many experts in the field of computing are calling for Apprenticeship programs. Any takers? We could again try using the method humanity has relied on for thousands of years to produce experts, masters and professionals.

1: http://northcarolinahistory.org/encyclopedia/griggs-v-duke-power/


Is asking students to debug existing code better than having them write new code? Is asking students to debug code better than asking them to write code, if the goal is to give students a strong basis in creating error-free code?

In my point of view, when we ask them to write a program by giving some scenario, they will write some code.  Most probably, this code will contain errors. Then they will correct them after debugging.

When we ask them to debug other's code, they will be more careful, they have to pass through various scenarios and they will become very strong in syntax while correcting mistakes and so on.

So, my question is:

While teaching coding, after some point, can I ask them to debug code rather than continue writing code?

Which will make them stronger at coding?

I give students targeted debugging exercises to make them aware of common traps that they can fall into while coding, and I believe that this is beneficial to them.  Certain errors come up all of the time, and pointing them out can be a real time-saver for students when they code their own labs.

I also give out small bits of badly-formatted code, with poor variable names, indentation, etc.  But these are always to call attention to the importance of good coding practice.

However, I do not emphasize either of these activities heavily; the ability to conceive of algorithms is still of the utmost importance, and I don't want to halt students' growth along this more important axis.  And switching entirely into debugging might (perversely) not help them learn the most important skill of debugging, which is to test with extreme regularity as you work, since you are providing them with fully implemented (bad) code.

So, yes, by all means, give students limited, carefully targeted debugging exercises.  But don't switch completely over to this activity.  Finding bugs is important, but it is only one skill that a budding developer needs.


Is it important to teach pointers in a first course using Java? Many instructors teaching with Java started their education using earlier languages such as C or C++ in which pointers are essential. Pointers, however, are not a Java concept, though those same instructors may think of, for example, object references as pointers.

How important is it to teach pointers in a first Java course assuming the students don't have much of a prior programming background?

If you think it is important, say why, but also say how much of pointers do you think should be taught. Just as a metaphor/analogy? Or also including, say, pointer arithmetic?

If you think it is not important say why also.

Note that both Python and Ruby are similar to Java in lacking the "pointer" concept. References might be implemented as pointers or not, but the definition of reference is actually abstract in these languages.

Note that I take "pointer" to mean the actual machine address of some entity that might, in principle, be manipulated as an integer, whereas "reference" is a more abstract concept that implies that the entity may be accessed via the reference however implemented.

The Java language definition is careful not to discuss the implementation of references, explicitly disassociating them from the C-like notion of pointer.

Learning about references is important, but I don't feel that learning about pointers is that important for beginning Java students. Certainly intermediate students will need to understand them.

When I started learning about pointers, I had a hard time grasping them at all until I learned assembly language. Once I learned assembly (for any processor), pointers made sense. It helped that I learned PDP-11 assembly at about the same time I learned C.  Since C is essentially structured PDP-11 assembly language, I was easily able to see the relationship between the pointer structures and the compiled code.

Java hides the concept of a pointer sufficiently deeply that I would be hard pressed to explain it with java. I can explain java structures in terms of pointers, but have difficulty expressing it the other way around. For teaching pointers and pointer concepts, I would probably use C (yep - plain old C, without the ++) and the x86 assembly language as a starting point.

After that, it's easy to explain that the JVM is built in C, and java object references are implemented as pointers.


Is there independent evidence that physical computing improves engagement The micro:bit foundation present some research findings which look quite encouraging when it comes to using physical computing as an introduction to Computer Science here:

  90% of students said the micro:bit showed them that anyone can code.
  86% of students said the micro:bit made Computer Science more interesting.
  70% more girls said they would choose Computing as a school subject after using the micro:bit.
  85% of teachers agree it has made ICT/Computer Science more enjoyable for their students.
  Half of teachers who’ve used the micro:bit say they now feel more confident as a teacher, particularly those who say they’re not very
  confident in teaching Computing.

They also link to this Computer Science for innovators and Makers curriculum which links the following:

  Female students, in particular, show greater understanding of computer
  science concepts when programs and code produce immediate, tangible
  results. The physical nature of making these interactive systems
  creates a meaningful and engaging learning experience that greatly
  increases engagement among girls in computer science education.

Although the 2nd reference may be independent, it's not easy to tell. Are there any other studies I can refer to? Looking particularly at benefits in engagement or diversity.

Although the first reference does indicate that teachers also found that using (or being trained to use) the micro:bit felt more confident, I intended to ask specifically about student engagement.

There are many academic articles reporting high engagement, especially among students underrepresented in computing, using physical computing. https://scholar.google.com/scholar?q=physical+computing+education . Most of them lack a controlled study design. That doesn't mean they don't provide evidence however. For example, from Peppler 2013:

  The capacity for e-textiles to diversify participation was first
  documented by Leah Buechley and Benjamin Mako Hill,2 who discovered
  that while men created the majority of traditional Arduino projects
  posted on Vimeo, YouTube, Flickr, and other sites (85 percent), women
  created most of the LilyPad Arduino projects (65 percent). What is
  striking about this comparison is that both types of projects share
  the same microprocessor and are programmed in the same language. The
  researchers suggested that the gender discrepancy could be due to some
  combination of the tools and materials used (insulated wire versus
  conductive thread to make connections between components), the
  construction practices employed (soldering versus sewing), and the
  nature of the products (robots versus interactive quilts).

  To understand whether changing these factors could significantly alter
  classroom culture in a similar way, we implemented a series of
  e-textile experiments in middle school settings where we closely
  observed how gender dynamics played out. From videotaped observations
  of subjects working in mixed-gender pairs, we found that both boys and
  girls equally engaged in e-textile activity, as evidenced by body
  language, gaze, talk-on-task, and other indicators, but girls tended
  to play a greater leadership role. The projects were positioned in
  front of the girls 81 percent of the time; the girls also spent 58
  percent of the time directing activity, troubleshooting, and deciding
  next steps and made only 39 percent of the requests for help from
  teachers and peers. We found that this early leadership was predictive
  of having more sophisticated command of the technology in subsequent
  projects, requiring less troubleshooting and assistance from others.

That said, probably wise to heed the central advice of Kicking Butt in Computer Science: abandon gender difference as the underlying theory in what works, and emphasize instead a high value on diverse interests and on applications that positively impact people's lives.


How should I respond to a student who proposes a "weak" analogy? I'm teaching programming with JS at the highschool level, students have some prior experience with programming with different languages but are still mostly beginners, and we're working through some core language concepts. A few times now the situation has come up where I introduce some new concept, and a student suggests it's similar to something encountered before. The analogy initially seems like it doesn't work, if I ask them to elaborate, they usually do find some connection between the ideas, but it seems (to someone with more experience) like a pretty convoluted relationship.

A concrete example: we ran into attaching multiple event listeners to a single DOM element in a browser context. A student suggested that event listeners are like arrays. After discussing it, the connection the student saw, was that you could add or remove items from arrays and you can add and remove event listeners from elements. Nothing the student said was incorrect, but I was concerned saying "yes, event listeners are like arrays" wasn't a terribly useful analogy in reasoning about either construct.

What is a good way of dealing with this situation? I don't want to shut students down who make connections like this, it seems like a very productive way of thinking in general, but I also don't want to propagate misconceptions or encourage a questionable mental model.

The concrete example:

Your student is right. At least, I agree with him, because I think of event listeners in the same way.

When multiple callers register for the same event, and the event triggers, it "calls everyone back". Functionally, it's similar to how an array or list is processed, e.g. :

foreach (var caller in callers)
{
    caller.Call();
}

The thing about abstract fields such as programming and mathematics is that people will find what works for them. Not everyone sees it the same way.

I may be biased because me and the student apparently see it the same way; but I'm actually having a hard time poking holes into his argument, without having to resort to fairly avanced event handling (and even then, the analogy sort of works).

Anecdotally:

A simple example for math applies to me. When considering the average of two numbers, most people think to themselves:

average = (A + B) / 2;

However, I instinctively used another pattern:

average = A + (B-A)/2

Note that A is always the smallest number.

This looks a lot more contrived. I agree. But to me personally, it was easier to do it like that. I'm someone who uses number forms to visualize numbers in my head, which means I do simple calculations visually (sort of, it's hard to explain).

When you ask me to calculate the average of 45 and 51, what I see in my head is:

  ... 43 44 45 46 47 48 49 50 51 52 53 ...

I take the numbers between the boundaries:

  46 47 48 49 50

And I find the middle number.

  48

When you look back at "my" formula, maybe you'll see that the order of operations is the same as this visual example. Take the difference, split it in two, find what's in the middle.
To me, it makes perfect sense, and I am considerably faster when calculating averages (of 2 numbers) this way.

I reverted to using the more standard approach when math classes started requiring us to calculate the average of more than 2 numbers. But for finding the average of two numbers, I still use my own method to this very day.

How to respond:

Even though the student is correct (in his own way), if you simply agree with his stance, others may misunderstand him (because they e.g. think of arrays in a different way than the student who raised the analogy).

You need to approach it correctly, because you can't err on either side:

If you tell the student he is wrong (for the sake of the other students), then he will be incredibly confused. I've been on the receiving end of this, and it took me some time to regain the confidence to use my own averaging method.
If you tell the student he is right (for the sake of the student), then the other students may end up incredibly confused.

So when you respond, make it clear that you understand what the student means, but it's not exactly the same in every way.

For example:

  I see what you mean, and this particular case does indeed behave similar to an "array of listeners". But there are other cases where the analogy doesn't quite work, so be aware of that.

Or:

  I can see where you're coming from. As you now understand it, there are indeed some similarities. However, once we delve into more advanced examples, you'll start to notice that it's not quite the same. Try to not stick to the analogy because you'll end up expecting different behavior.

I think this sticks to the middle of the road:

It confirms the student's basic interpretation of the code's behavior.
It highlights that the analogy is not perfect and flawed when applied to other cases.
Other students who have no idea what the student was talking about (because they understand it in a different way) will understand that the analogy is flawed and not generally usable, so they won't fixate on understanding why this analogy sort of works and will instead be more likely to ignore it and move on.

There are of course countless ways to respond, but you should always try to find a compromise that both confirms the student's vague suspicion, suggests that it only works in particular cases, and it avoids creating confusion for the other students.

Specifically for this example, my response would be:

  Yes, even listeners can be considered as an "array of listeners" where you can add/remove listeners as you please. However, "an array of something" is an incredibly common concept in programming. Whether it's getting data from a database (a table is an array of entries) or parsing a string (which is an array of characters), you'll find arrays and lists everywhere you look.
  When we get to the more advanced part of the curriculum, almost everything will use an array-like approach at one point or another.


Creating Interactive Gnu/Linux shell programming courses I am looking to create interactive workbooks that teach the Gnu/Linux terminal to students. This would be presented in such a way that one half of the screen is an interactive terminal, running the Gnu bash Unix shell, and the other half of the screen is a workbook, with steps that the student must follow in the included shell. The output from the students' shells would be automatically graded, to ensure that they have correctly followed the steps from the workbook.

So far, I have found two such 'services' http://tuxlab.org/#/ and https://github.com/jakebailey/ua , There are also GitHub classrooms which may fall into this category.

Is anyone else aware of products like this? Preferably open source.

Not sure about automatic grading, but you can try this combo:

Jupiter as basic infrastructure
with the bash_kernel to add support for bash exercises
and nbgrader for the grades.

I never used nor tested this particular combination, but you can dig a little bit the documentation to check if it works for you.


Do Theoretical Computer Science Conferences Accepts Survey Papers? I am a Ph.D. student in Theoretical Computer Science (TCS). If I want to publish a survey paper, can I send that to a conference instead of a journal? Is that allowed?
I am asking this because the quality of research in TCS is judged mostly by the top conferences (like SODA, STOC, and FOCS).

That is up to the individual conference. All of them have web sites that will explain what they prefer. I'm skeptical a bit, however.
But, many such CS conferences have different "tracks" and different associated activities. You might find a better welcome at one of these. For example, some have an associated "educator's track" that might welcome something like this. But you need to check individually. The program chair (or conference chair) will probably respond to an email if you don't find what you are looking for online. Most such people have email addresses that are easy to discover even when not listed on the conference site.
Theoretical conferences will, of course, prefer papers that extend the theory.


What do A-level students, that have not done GCSE, struggle with? I will be teaching key-stage-3 pupils, in a school with no key-stage 4 or 5 in the computing subjects. Some of these pupils may wish to do computing at key-stage-5 at another school.

Does anyone have experience of teaching A-level students, that have not done GCSE computer-science? Or even University teachers teaching students with no prior experience (Please give context in your answer).

What can I do to better prepare them? While still giving age appropriate lessons.

Other factors: Because of the size of the computing department, I will have less time with them than I have had in other schools (one hour a week for 1/3 of a year).

Translation: key-stage

key-stage 3: age 11→14
key-stage 4: age 15→16, first external exams, GSCE, level 1 and 2.
key-stage 5: age 16→18, (A-level, level 3)

Insufficient programming experience is the thing that impedes progress at A-Level, in my experience.

The current UK A-Levels from OCR exam board (less so AQA) emphasises "Computational Thinking" (CT), such as abstraction, as a theme of the course. CT, as delivered in the course material, has some overlap with stages in system development stages such as analysis. Also there is another strand "problem solving" and another "computational methods". There are more "traditional" topics such as data structures and algorithms. There are questions in the exam where a student has to analyze, correct, modify or create from scratch a pseudocode "snippet" to address a particular small-scale algorithmic problem such as navigating a tree data structure.

With that context, the most basic exercises in the course are usually beyond those A-Level students with little prior exposure to programming. The rigours of getting code to run or compile without syntax errors or fix basic logical errors is an alien task to these students and they often give up, submitting source code that does not compile or run (if Python). These students often have no "framework" of what an algorithm is; to take input data and transform it in some way. Lack of this "mental framework" means CT is just "pile of words" to neo-programmers; they have no concrete experience against which to relate abstraction, decomposition, recursion, concurrency etc. Often assignments are submitted, which if in a programming language don't run, let alone produce correct outputs under any inputs. Pseudocode assignments are very difficult to mark because of a host of basic syntax errors. For some, submitting "something" is "job done" by the student because the time to develop the necessary skills, understanding, approach, identifying and diagnosing errors is just not "there". Pseudocode is used because the exam uses it rather than a specific language such as Java or C# or C++ or .... to "level the field" among all candidates who may have been taught by someone with knowledge or preferences for a specific language.

There is also a requirement to produce and document a non-trivial program / system - weighted at 20% of the final course mark. Those students with no programming background make slow progress in all stages of the development and the resulting code is usually rather limited in technical complexity - although there is ongoing debate on teacher's forums as to the necessity for "complexity" in the project.

One possible explanation for this (and it's just my opinion) is the inexperienced students haven't had exposure to 1) short term failure of their efforts, i.e. their programs don't work, but 2) the reassurance that eventually, with effort, they can fix their "local" errors and solve the overall problem. So, some prior programming experience develops the right perseverence mindset which I feel is more important than "good" programming style or wide/deep knowledge. Continued engagement will refine the skill.

It is entirely possible for a student with no programming background to develop those technical and problem-solving skills over 18 months - but it is rare - and often the student will drop out feeling the course is completely inaccessible. However, if the above sounds entirely negative our highest achieving student last year had no programming background prior to starting the course.


Could physical (i.e. lego) models help teach CS? In this video, https://www.youtube.com/watch?v=t5NszbIerYc Dr. David Brailsford uses an elegant Lego model to explain pointers and linked lists.

Do you think that using physical models could make it easier for students to learn about fundamental concepts? Has anyone had any success with this?

It would, of course, be foolish to answer no, since you give an example of it. There is a Pedagogical Pattern, in fact, called Physical Analogy that suggest doing just this. Physical analogies of any kind help a student visualize the concept at hand. But it is this idea of aiding visualization that is key here, not the physical object itself.

Metaphors and analogies of any kind are essential to teaching novices, linking their prior knowledge and experience to the new topics. But the pointer thing can also be taught at a white board with a bit of showmanship. "new" means draw a _cell, "next = " means draw an arrow.

You can also provide a computer visualization that abstracts a bit from what the "professor" is showing in the video, which does, in fact use a bit of computer visualization along the way.

But, while I'm a big fan of metaphor and analogy, I want to also provide a caution. The thing you are teaching is "similar to" but not "just like" the metaphor you use. Don't try to push the similarities too hard. At some point any metaphor breaks down and if the student has put too much currency into the similarity he or she may have trouble. Nodes and pointer are not, in fact, physical quantities, but only bit patterns.

For a simple case like cells with next fields you can also do this. A person is a "cell". Their left hand holds a bit of "data" perhaps written on a piece of paper that they hold or some other physical object that they can use. Their right hand is a "pointer" to another "cell" (i.e. person). You can build up a linked list in this way. You can modify the data in a cell, you can modify where "next" points to, etc. If the class is large this may be more effective than the lego idea since it can be viewed by a larger audience. It is also more active than just viewing a "professor" manipulate blocks on a table.

Also, metaphor isn't limited to such low level ideas and can be used at any level. "A database is like...". They are only limited by the creativity of the teacher and the willingness to work at it to get it right. The make a peanut-butter sandwich as a way to introduce algorithms is often used, but the knowing teacher also knows that no one is really likely to treat making lunch as a true algorithm. There it is the differences that are essential to the learning, since over interpreting an "algorithmic" description leads to trouble (and messy floors).