Research into the use of symbol names, in programming, and how it affects learning When programming we need to name things. I have been using turtle graphics in python, and was wondering if the names, chosen, for the commands, were making it more difficult for my pupils.

Some of the turtle commands are:

turtle.left
turtle.right
turtle.forward
turtle.backward

Pupils often get confused, because they think that turtle.left will make the turtle move to the left. Would learning be improved, if the language/libraries chose better names? e.g.

turtle.turn_left
turtle.turn_right
turtle.move_forward
turtle.move_backward

This is not about students choosing good name, but about names used by the  libraries, and examples.

You don't have control over the libraries, though you can provide a filter class that, itself, provides better names. Yes, names matter and shouldn't be confusing.

But when you create examples and libraries pay a lot of attention to the names. When you present them to the students and learn that there are confusions, change them. Even better, ask the students to suggest better names. One of the purposes of the Navigator in a Pair Programming scenario is to suggest alternate names to the Driver.

In my somewhat extreme view, every name should be intention revealing. The only exceptions are very common acronyms and abbreviations. But in general, I don't create either acronyms or abbreviations and try to make the names as clear as possible. I fail at this of course, but it is the goal.

However, in the current example, the students should also have a metaphor about the overall structure of the simulated world. Turtles only move in the direction they are facing. They can turn, either left or right. There should also be some per-instruction documentation that makes it clear. If they can learn to think in terms of the metaphor, rather than the detail, they will have an advantage as long as the metaphor itself is sound.

Also, in the current example, I'll note that too many people name things emphasizing short names over self-explanatory names. I sometimes think that they believe that the hard part of programming is the typing. There was a point in time in which program preparation (punch cards) was extremely frustrating but those times are gone. Good IDEs today do typing completion, so names seldom need to be typed in full. But even in the card punch days, real programmers employed data entry clerks who did the card punching from hand written coding sheets. A good clerk could correct quite a few minor errors along the way.


How can I teach the students a package/module in a computer lab? I will be teaching a course to college students in their 3rd year in college study.  So far, they have taken only one programming course in MATLAB.

We have a package, i.e., is a set of functions, that simulate a certain task in our research field. It is written in MATLAB.

We want to introduce the students to this package and make them know how to use the model without implementing the functions themselves. The students are 3rd year college students who took only one programming course in MATLAB.

I thought about setting up an example problem for the students to go through in the computer lab, run it and answer some questions. For example, calculate the mean of "x". What does the results in "y" mean? Are they realistic?

Is this the best method to teach such a computer lab? How do you teach well known packages, e.g., Akka, Spark, etc. in computer labs?

What you suggest is pretty typical for work in a lab. But I assume that you want them to know the package for a reason. You might tailor a few exercises that are related to that purpose so that it is an easy step for them from the lab to the intended use.

It is also the sort of thing that might work well with pair programming if they need experience with that (they do, actually). Pairing will also free you up from answering simple questions that block students from forward movement while you only need to deal with more serious questions. Pairing is good in general for making everyone more productive.

You can also save some time at the end for getting suggestions from students about how this package applies to their more general task. Just a check that they see the relevance.


What can be the causes of the difference in student performance? The box-plot represents the number of programming tasks performed correctly in 30 minutes.These tasks are designed to learn basic CS concepts: sequences, loops, conditional ...
Each box represents an age group:

p1 = 6 - 7 years old
p2 = 7 - 8 years old
...
p6 = 11 - 12 years old
...
s1 = 12 - 13 years old
s2 = 13 - 14 years old
...
b1 = 16 - 17 years old
b2 = 17 - 18 years old

When I see the results, I am surprised by the difference between p4, p5 and p6. The set of tasks was almost identical by age. The only difference is that by increasing the age they have some less start tasks. I think it may be due to the ability of reading comprehension and motor development ... Can be? Are there more factors that can influence?

There is a point, somewhere around where puberty starts but I don't think identical, in which the brain changes its structure. It is much more capable of abstraction after that point than before. Young kids don't do a lot of generalization, for example, adults do. So, perhaps the study just captures part of that.

I don't have it available, but I think there is a lot of brain science around that structural change. A simple search may turn up some of it. We aren't born fully formed either in mind or body.

An implication of that is that how and what you teach toddlers and youngsters isn't the same as what and how you can teach teenagers. Also, every person hits that change at a slightly different age and it isn't instantaneous any more than any other brain change is. For the youngest, make it visual and tactile, even aural.


Creating a pre-recorded lecture I have created a PowerPoint presentation and I want to create a video of me presenting it. I'm looking for a software to make my life easier. The features I'm looking for are:

Can record a 25-minute video for free.
Works on Mac.
Can record the screen and me (audio+video).
Lets me rewind while recording and continue from there, so that if I make a tiny mistake I can just go a few seconds (or one slide) back and continue recording.

Any suggestions would be greatly appreciated.

OBS Studio fills your description.
It is not the easiest program to use, but you can find plenty of tutorials on YouTube.
While rewinding the recording again might seem appealing, it is very common to find out more errors after you complete the recording. In that case, you need a better video editor. OBS studio might be enough, but shotcut is your best bet.


Open Source Training Cloud Foundry open sourced their curriculum to train students on how to use it. Are there any other open source courses out there or organizations who collects training that is open sourced?

To clarify: I am looking for training for hardware/software that has been open sourced. Not open source software that has training.

First, there is a scientific journal that may include publications of such material that are what you are looking for: The Journal of Open Source Education, "An educator friendly journal for publishing computational learning modules and educational software."

Second, but I am not sure this is completely relevant to your question, there are the open source computational lesson from The Carpentries:

Software Carpentry has lessons on the unix shell, version control (git and mercurial), programming in Python or R, R for Reproducible Scientific Analysis and more
Data Carpentry has lessons more tailored to a research domain, on data analysis, but includes programming as well
not yet part of The Carpentries, but under development is HPC carpentry lessons: shell, Python, Chapel, Snakemake
there is also Library Carpentry, but their lessons are more tailored to librarians

All these lessons are CC-BY.

Disclaimer: I am on The Carpentries Executive Council


Online Code Review Scripts Like Udacity Please, can anyone recommend a simple online code review scripts/website similar to udacity. Instructor upload students code to the scripts, they add inline comments and can send the URL to the student. I need something very simple. No need for auto-grading. If not available, is there any library I can use to build my own?

Thanks

Attached is the screenshots for clarification.

My company has a training program for software engineering interns. A computer science problem is given to them that they have to code. Every individual intern is going to create a PR to one of our company's repository. Without merging the PR, an instructor can do a code review and add comments, just like Udacity's. IMO, GitHub is better for code review than Udacity. It has everything that Udacity has to offer and much more.

Also, they are learning the GitHub workflow which may be helpful in companies that use GitHub (like mine).


What is a real-world (production-code) example of a function having default arguments? I want to teach students about default function arguments.
I have a bad habit of cooking-up contrived examples.
To prove that I am not a student cheating on their homework, I shall provide you with the following code. I really can write an example of a function without default arguments on my own, it is simply too contrived:
class SandwhichMaker:

    FISH = """
              /"*._         _
          .-*'`    `*-.._.-'/
        < * ))     ,       (
          `*-._`._(__.--*"`.\

    """

    @classmethod
    def publicly_make_sandwhich(klass, bread, veggie, meat = "fish", sauce = None):
        if (sauce == None):
            sauce = klass.meat_to_sauce(meat)
        bread  = str(bread)
        veggie = str(veggie)
        meat   = str(meat).lower()
        if meat == "fish":
            meat = SandwhichMaker.FISH
        sandwhich = klass.privatly_make_sandwhich(bread, veggie, meat, sauce)
        return sandwhich

    @classmethod
    def meat_to_sauce(cls, meat):
        if meat.lower() == "fish":
            return "tartar sauce"

    @classmethod
    def privatly_make_sandwhich(cls, bread, veggie, meat, sauce):
        """
        PRECONDITION: all input parameters are strings
        """
        seperator = "\n" + 40 * "-" + "\n"
        sandwhich = seperator.join([
            "\n\n",
            bread,
            veggie,
            meat,
            sauce,
            bread
        ])
        return sandwhich

sw = SandwhichMaker()

sandwhich = sw.publicly_make_sandwhich("whole wheat", "cucumber", "fish")

print(sandwhich)

Console output:
----------------------------------------
whole wheat
----------------------------------------
cucumber
----------------------------------------

              /"*._         _
          .-*'`    `*-.._.-'/
        < * ))     ,       (
          `*-._`._(__.--*"`.\

----------------------------------------
tartar sauce
----------------------------------------
whole wheat

So, my example function with default arguments is as follows:
publicly_make_sandwhich(klass, bread, veggie, meat = "fish", sauce = None):

The default meat is "fish"
I really want students to see how default arguments can be useful.
I thought about downloading a few open source code repositories.
I could then search all text-files for a regular expression (regex) to find functions having default arguments.
\(\s*\w*\s*\w+\s*=[^),][^)]*\)

Exactly one left parenthesis ... [1, 1] of (
Zero or more of any white-space character ([0, +inf] of \s)
optional data-type such as float or int. zero or more letters, numbers or underscores. [1, +inf] of [a-zA-Z0-9_]
zero or more white-space characters
one or more letters, numbers or underscores.
zero or more white-space chars
exactly one equals sign
exactly one character except right-paren or comma
zero or more character other than right-paren
exactly one right-parenthesis

It would be easier just to ask a human being for a good example.

I recently used default arguments to write an API method for a mail sending library: The method needs a subject, a body and a "To" recipient, "Cc" and "Bcc" are optional:
def send(subject, body, to, cc=None, bcc=None):
    """
    Send a message with the given data using the earlier configured SMTP server and the earlier configured from address.
    :param subject: The subject (one-line string)
    :param body: The contents (multiline string)
    :param to: Recipient address (string)
    :param cc: CC address (string or None)
    :param bcc: BCC address (string or None)
    """
    # The following to helper functions are omitted for brevity
    msg = _create_message(subject, body, to, cc, bcc)
    _send_message(msg)

I also quite often use this to specify default constructor arguments for machine learning setups, so that I can change the parameters when experimenting, but have a default variant during development:
import random

class MulticlassPerceptron:

   def __init__(self, epochs=100, learning_rate=0.9, random_seed=15):
      self.epochs = epochs
      self.learning_rate = learning_rate
      random.seed(random_seed)
      ...

   def train(self, training_data):
      for epoch in range(self.epochs):
         for datapoint in training_data:
            ...

train_dataset = ...
m = MulticlassPerceptron()
m.train(train_dataset)

Generally, I make quite heavy use of default arguments whenever I write scripts for myself, because for me they are a perfect compromise between those two objectives:

No one else than me will use the scripts, and my configuration is pretty constant, so there is no need for complex Config objects etc.
It is bad practice to hardcode things that are technically changeable parameters.

So what I usually do is write methods that have only default arguments which store my default configuration: This is an easy way to store a configuration (satisfies objective 1) but could be changed if the need ever arises (satisfies objective 2).
Does this help you? If not, I'm happy to add more examples.


Undergrad level computer architecture course Is there a good online course that covers computer architecture at an undergrad level?

I just finished 8th grade. I know a bit about computer architecture and logic gates, but not a ton. I know the basics of single-variable calculus and linear algebra, and I program a decent amount, mainly in Python 3, though I have experience with versions of C (used for Arduino, for example). I have looked at Assembly code but never programmed in it.

I'd like the course to be decently cheap, and it would be nice if it has a sense of legitimacy such that I have a shot at getting it to count for credit/go on my transcript.

Any recommendations would be appreciated. Thanks!

My go-to answer for this topic is Nand2Tetris.

There are 2 Coursera courses (Part I and Part II) that match the curriculum of the program. The first course does not require any programming background. Its focus is on computer architecture (logic gates, half-adders, full-adders, ALUs, RAM, ROM). The second focuses on a virtual machine and a compiler for a high-level, Java-like language (and thus does require some programming knowledge). The essence is that you understand every level of a computer from the NAND gate up to a "hello, world" program in a Java-like language.

In addition to the Coursera courses, there's a companion textbook and a full suite of software. The list of topics is below:

Boolean Logic
Boolean Arithmetic
Sequential Logic
Machine Language
Computer Architecture
Assembler
VM I: Stack Arithmetic
VM II: Program Control
High-Level Language
Compiler I: Syntax Analysis
Compiler II: Code Generation
Operating System

The course is typically a lower-division, one-semester, university course. The site contains a sample syllabus, which might help justify it being rewarded with some form of academic credit.


What is the point of teaching coding and robotics to kids as young as six years old? Nowadays, kids as young as six years are being taught coding through various tools such as MIT's Scratch. I wonder what is the point of teaching coding at such a tender age. They will go for a job after 10-15 years, so what is the rationale of teaching coding (and in some schools robotics as well) now?

Is there a scientific study that supports the claim of a benefit of teaching coding at a young age?

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

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

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

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

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

See CS Unplugged for a closely related set of ideas.

Let me add a couple of points.

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

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

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


Simple use case for self-modifying programs .NET expression trees can be used to write self-modifying compiled programs -- because it is possible to construct and compile a method at runtime, it is also possible for a method to rewrite its own code at runtime.
.NET leverages this for dynamic typing in C#, taking advantage of the fact that even for dynamically-typed code, the vast majority of usages at a given call site will have the same types. Each dynamic call site has a corresponding expression tree, and a corresponding method. Every time a new set of types is encountered at this call site, additional logic which handles the new types will be added to the expression tree, which is then compiled into a new method; this new method becomes the method corresponding to this call site.
Aside from the fact that I haven't been able to see this mechanism running live, I feel it's too complex and distracting from the simplicity of the primary concept.
What relatively simple use case could I use to demonstrate the value of this property, of allowing the writing of a self-modifying program? Is there a standard example?

I didn't write any myself, but I encountered several self-modifying MS-DOS batch files (this is possible due to the OS closing the batch file before executing each line), especially during the $1980$'s. I'm not sure if batch files fit within your definition of "programs", or if this usage was from too long ago since the needs & reasons for this (i.e., primarily due to only a minimal amount of memory being available) don't generally apply now to modern computers. Nonetheless, having batch files modify themselves is a relatively simple concept, and was similarly done for fairly basic reasons as well, so this might make good examples for teaching purposes.
I recall self-modifying batch files were used in several situations, but the main one was to change options based on user feedback. Wikipedia's Self-modifying code gives an example where a batch file runs a program that changes the file itself to next run what the user requested. However, I also recall seeing & using a batch file with a fairly complicated (at least for a batch file) menu type system, with the commands directly modifying the file itself based on user feedback, return codes from the menu and/or other programs which were run. I no longer have a copy of this batch, or any other related, files. As this was over $30$ years ago, I don't recall any other details. Also, I haven't been able to find any such similar example online. Nonetheless, in Changing a batch file when its running, several answers, such as the answer by dbenham and the answer by jeb, give other examples of direct self-modifying batch files.
Note that, as the Wikipedia article section states, these batch file self-modifications were done primarily due to how limited memory generally was in personal computers back then. Most, if not all, of the other reasons people wrote & used self-modifying batch files back then, as I recall, were also due to these significant memory limitations.


How to collect and grade Xcode work I am preparing to teach an intro to app development class to approximately 10 students who are there voluntarily this summer using Swift and Xcode. The course will consist of daily, 5-hour class meetings over the span of 3 weeks. All development will be on Macs out of necessity; some will be school-issued devices, but some will be the personal devices of the students.

For curriculum, I will be following Apple's Intro to App Development with Swift. For most of these high school students, this class will be their first exposure to programming entirely, so I need to bear that in mind as I consider what tools to teach them alongside the language and software of basic iOS development. Given the compressed nature of the course and the introductory feel thereto, I do not want to overload or distract them from the main focus of the course.

All that being said, I am trying to come up with the smoothest workflow for both them and me in terms of file submission, feedback, and assessment.

What are simple, beginner-friendly ways of collecting and grading work in an iOS app development class?

I'm going to offer an answer that is orthogonal to your question by looking at a deeper question. The "work-flow" you seek may actually be irrelevant to the problem of (a) being effective with your students and (b) being efficient with your own time and effort. Hopefully, the answer here will be valuable to others who don't have quite the same context that you do. I'll focus on the small number of students and the long daily sessions, primarily. The answer will be less valuable for larger groups and/or shorter sessions, but some of it might be adapted.

tl;dr: Keep continuously aware of their progress, day to day, with short conferences. Restrict your evaluation to the most important issues as they evolve.

With only a few students and long sessions, there is really little reason to have to look at everything in detail, captured by GIT, or otherwise. This is one situation in which printouts sounds like a terrible idea also, though that is often the most efficient method of looking at student production.

You can both reduce your work and be more effective if you require some sort of teamwork, such as pairing. If you only have five projects to keep straight it is much easier than ten. You can, in long sessions, set aside say one hour in which each team consults with you for a few minutes on their current work and issues. They show you their current product and you give them advice. But if they are pairing, they will need less advice.

One concern you likely have is honesty. Looking at each student's (team's) work for a few minutes each day (or so) lessens the likelihood that you won't notice bad behavior.

One thing that will help you keep track of the students and keep them on track as well is to keep a running record of their progress. A Hipster PDA (discussed elsewhere on this site) is one way. A spread sheet is another. Decide before the course starts which low-level results/behaviors/activities are to be encouraged and valued and keep a record of these for each team, each day. A check mark is all that is needed for many things, though occasionally a written note (to them and/or to yourself) might be valuable. It is a continuing and cumulative process, not an all-or nothing evaluation at the end.

If students work in teams you can also keep yourself aware of each student's contributions to the team simply by listening to how they interact when you confer with the team. A quick notation on an index card captures your impressions for re-confirmation later.

If you need to give advice on code quality you don't need to look at it all at once, but can look at fragments (one class, one method) in a review and get a sense about whether they have it right or not. You won't catch every flaw, but you aren't guaranteed to catch everything in an overall review either. If several teams are going wrong in the same way you can alter your "lectures" to guide them back. If a single team/student is off the rails you can focus your efforts there, instead. None of this requires that you capture everything in a repository or even that you comprehensively review their work.

If design is one of your goals, you can focus your daily review on that, warning them the day before that you need to see designs, either on paper or otherwise.

Even if you don't want the students to work in pairs/teams, you can still use a different form of teamwork. You can, for example, set up a rotating peer review system in which each student briefly confers with another on each student's work. Each can give advice to the other. I suggest that the advice be written, say on index cards, with both student's names listed as well as the questions/advice/etc. You can quickly review these cards and can give credit to both the one receiving the advice (for responding appropriately) and the one giving it (for being a good colleague). You can use this instead of conferring with the students/groups yourself on some or all days. Students can teach each other and will if you give them the opportunity and encourage good behavior.


How to give students practice with streaming computation? I'm teaching a theory-focused randomized algorithms course at the undergraduate level, and have included a section on streaming algorithms. It would be great to get students to implement these algorithms, but I do not know how to simulate a data stream for them. I am aware that some companies have APIs with varying degrees of openness (e.g. Twitter), and I'm aware of big things like IBM InfoSphere Streams, but this seems too hard, since the course is mostly focused on theory. Ideally, I'd like something that continuously produces a stream of numbers or words, and have students write Python code to access the stream, then compute on the sample they take. Are there any freely available tools of this sort? Even, like, a free toy version of IBM InfoSphere Streams?

Java has a Streams API that works with all of its collections.  You create a stream with a source, transform or filter it with intermediate operations, and do something with it using a Consumer.

All Collections in Java have a .stream() method that creates a stream from the collection.  You can also create streams from files, as well as creating streams of random objects from a Random.

Intermediate operations include filter, which accepts a Predicate as an argument, and map and friends that can transform objects into objects of other types or primitives.

Consumers include facilities to place the contents of a Stream into any Collection, System.out::println, and other pure side-effect operations.

This requires an understanding of lambdas and functional interfaces (our second-trimester course in Java covers these).  This mechanism is powerful and succinct, and it does not alter the collection the stream is attached to.


Why did the percentage of CS bachelor's degrees going to women peak in 1984? As shown by the following graph, the percentage of bachelor's degrees going to women in the US has increased over time in almost every major, with the dramatic exception of CS, which peaked in 1984 at 37%, then fell drastically, never to rise again above 20%.

Why are the numbers for CS so different from every other field?

This is relevant to CS education for those who want to make sure that students have equal opportunity regardless of gender.

Clarification

Since some readers seem to have misunderstood my question, let me be explicit that I am not asking why fewer women than men study CS, nor do I mean to imply that people should not be free to change their own majors. I am asking why the proportion of CS bachelor's degrees in the United States going to women fell dramatically after 1984.

Obviously, there is no way to definitively know the answer to this question.  But my favorite theory has to do with the advent of the home PC, and the original marketing of computer games to boys.  The strongest support for this theory is the timing, which means that I must now give the obligatory caveat that correlation is not causation.

Basically, the theory goes like this: as the home PC started to sell, the good folks in marketing had to choose which groups they would target with their limited ad dollars.  The earliest games that came out involved balls and shooting anyway, so young boys were chosen as the target market.  And thus began a generation of young boys who logged hundreds or thousands of hours with computers, with no corresponding boost for the girls.

As this generation of children reached university age, more boys signed up for computing majors, and professors began to tailor their classes towards this majority of people who already had some background.  Girls who did come in often felt like fish out of water (and abandoned the major), leaving us where we are today.

It does not have to be so.  There are inroads being made into this problem, and I am hopeful that with the total infusion of computers into all of our lives that is going on now, the timing is right for this problem to begin to fix itself, as the experience differential has begun to level out.


Lab ideas for information theory This question is somewhat related to a prior question that I asked about an Information Theory lab.  I received a lot of great feedback there, but I have not gotten past the idea yet that the lab that I assigned last year was simply too hard.  I have been wracking my brain to think of a new lab idea, but so far, I have come up empty-handed.

So you don't have to visit the prior question, here is the relevant portion:

  This is mid-year in a course for HS juniors in theoretical computer science.  The unit is about Information Theory.  We were using the coin-weighing problem as something of a motivator for the entire enterprise, as a deep understanding of that problem would also engender a pretty reasonable understanding of the purpose and use of the four axioms of Information Theory:

  I(p) ≥ 0
  I(1) = 0
  I(p1 * p2) = I(p1) + I(p2)
  I is continuous and monotonic

  In the lectures prior to this lab, we cover the coin problem, the axioms themselves, some of the derived properties of the axioms, bits, trits (including the Soviet Setun computers), nats, and Hartleys, how much information is present in random and constrained events, the concept or entropy, and how to calculate the storage requirements of a theoretically maximal lossless data compression given some set of rules.

All of the coding done by students during this course is in Scheme, so labs that naturally lend themselves to functional programming paradigms instead of imperative ones are appreciated.  My best labs tend to present a series of very short lab assignments, and either present them in escalating order of difficulty, or provide some options to the students about which ones to pursue, to smaller-scale ideas are also a better fit for my class structure.

Image compression, for example sending back photos from faraway in space and through narrow communications, is interesting because it gives visual scene of the work done. You can compress the individual pixels to a range of bit-depths, from 2/4/8... 32 bits, you can compress 2 bits inside 8 bit registers of a PC which often reads and writes memory blocks of 8/16 bits. It's very good to have a thorough understanding of XY color graphs.

The concept of images also leads to the topic of floodfill, and recursive searching of black and white pixels, and recursion generates 100mb or 1gb, which leads to the concepts of stack overflows from disorganized memory. Students therefore learn to keep 2D and 3D arrays for pixels and voxels. If they do 3D arrays to compress data in, they are building a minecraft world.

Voxels are stacks of XY graphs, on a Z axis, so videos are actually voxels, using XY and Time, most work done on 2D graphs alot easier and smaller, and also very similar to 3D graphs.

In a minecraft world you are introducing the kids to lots of 3D concepts, and the limitations of bandwidth every frame to and from the graphics cards, and overall memory limitations. a voxel engine has to be very optimized to get around those.

I recently used 3D arrays to solve floodfill recursive algorithms so that they take up 100 times less space than line-scanning floodfils and I found it mentally very engageing. A voxel space can take up a billion memory spaces very fast, 1000x1000x1000 points of space, which requires a lot of bandwidth optimizing.

When you have objects in a voxel space, and you find the edge voxels of the shape, you can generate a point cloud, which is useful too. Point clouds use huge amounts of data, and they represent visible shapes. Being able to organize algorithms in point clouds requires a lot of organization, it leads to the concepts of Octrees and nearest neighbor algorythms.


The confusing Unix permissions terminology The GNU manpage (what you'll find on a Linux system) – but pretty much any Unix manpage – of chown (the command for changing the owning user and owning group in Unix) appeal to an “owner” and, as you see, the very name of this command hints at  “change owner”, too.

When people first learn this, they get the wrong idea, that for the command chmod (which sets the file/directory permissions), the abbreviation o (as in chmod o+w file) stands for “owner / owning user”.

In reality it stands for “other users”. So chmod o+w file really adds the writing permission (+w) for other users (who are not the owner or a member of the owning group). It doesn't help that what really refers to the “owner”, namely u (= owning user), makes it possible for one confusion to give rise to another: u is then confused for “‘normal’ users”: anybody not the owner or in the owning group.

Sure, it helps to make people directly aware of this, but even if they can remind themselves that there's some trap here, the idea o = “owner”, u = “normal users” is so seductive, that they retain some insecurity until enough (sometimes a lot is necessary) rote memorization makes it finally sink in.

What would be a mnemonic or other way to explain it which makes the correct notion stick right from the start, so rote memorization isn't necessary?

PS: I'm not formally teaching anyone, it's just what I want to tell coworkers/friends. When I took a university course on Linux I first came across this confusion. There's a lot more about the Unix permission system which is very counter-intuitive, but those are issues arising necessarily from technical aspects. Not an (surprisingly very) annoying and trivial issue caused by bad historical choices for abbreviations.

You could point out that a file has an owning user and an owning group. Since “owner” appears twice, specifying o for “owner” would be ambiguous. That's weak because the owning group doesn't really have any special privileges on the file, unlike the owning user: the owning user can change the file's permissions and other metadata, but the owning group only has the privileges granted by the file's permissions.

I think the best approach is to pair up user and group so that people remember them together. There's user and group: u and g. There are basic file permissions for one user and for one group. ACL entries can apply to either a user or a group. The command ls -l has two columns for ownership, one with the user and one with the group. Beware that sometimes the naming is not consistent. On the system there's a user database (/etc/passwd) and a group database (/etc/group). The chown command takes both a user and a group, but there's also a separate chgrp command and so chown is often used for the user only, which tends to reinforce the association between “user” and “owner”, so avoid mentioning that if you're trying to dispel the association between “user” and “owner”.


Should we merge technology departments with the science departments? At our high school, our tech department has made many strides in the past decade. The courses and technology we offer are a matter of pride when showcasing our school. However, our department is small and we are trying our best to grow our staff and courses.

The proposal has been going around that we should merge our department with the science department. There are many reasons for this. But, for the most part, there are two main ideas here. We can write all science courses with stressing technology and scientific tools. Secondly, we can rally both departments and create all our courses with the theme around 'Discovery'.

Yet, everyone in the Technology department, including myself, seems rather hesitant with this. We understand the idea of infusing technology into the science courses, but we wonder what the impact of a scientific approach to the courses we have created. We see a distinct difference between scientific discovery and inquire vs the design, creativity, and problem-solving in our technology courses.

Has anyone merged their tech (or CS) department with their science departments? What have you found beneficial with this? What problems have you discovered? I am looking to weight our pros and cons over this issue

Rather than providing experience, let me add a bit to a way you can think about the issue and, perhaps, resolve it.

You are correct that the scientific method, the mathematical method, and the computing sciences method are all distinct. So, experiments in the Chemistry sense are much less important and frequent in CS. However, there are some synergies, and the sciences can provide useful examples for the creation of programs and systems. Also, Computing can be useful in the sciences, handling Big Data, for example or executing theoretical models.

I'd suggest three things to think about.

Is this a bottom up (faculty driven) initiative or top down (administration wanting changes)? The latter is likely to be much less successful.
Are the faculty already knowledgeable cross-discipline? It will be much less successful otherwise.
How important is it to you to have pair-teaching (co-teaching, team-teaching) of several courses in your institution? Especially pair teaching with instructors of different core disciplines. Without that, I wouldn't expect a lot of benefit other than needing fewer "department chairpeople".

Synergy is possible and valuable. But forcing it won't work very well.


Working with students with specific secondary skill I often see students at levels varying from really bad to incredibly clever. The students in the middle of the scale fit to curriculum perfectly (as it is meant to be for them). The students at either end of the scale are more difficult to teach.

Yet, it is clear that all students have another field/skill ( often not related to computers) which they are remarkably good in that field. For example one of the students has a musical understanding such as I have never seen (as an example of this, he can create piano adaptions for Green Day songs and says it was "easy").

These skills are neither a hindrance nor do they aid the students, but that doesn't have to be the case.

For the students are not too good in Computer science, their "secondary" skill might be useful for aiding them. I have not been able to think of a good way to use their secondary skills to assist them in learning computer science.

In what ways can these skills can be taken into account when dealing with such students (at either end of the scale)?

(The students are in high school and know only the basics in java, such as primitive types, arrays, loops and Scanner)

It is not clear for me what "computer science" means for you. Is it at High School level?

If that is the case, you could try to introduce some of the mechanics behind "digital music". How it is processed from analog to digital. How it is compressed, how it is reproduced, ... What does it mean to be 8bit or 16bit, the bit-rate, the sampling frequency...

If the students are more into drawing/painting, you could do the same with image formats.


Avoiding confusion about precedence When mentioning operator precedence for AND / OR, I explained it wrongly. I re-explained it properly using the idea of binding: the operator "binds tightly" to the two expressions immediately on either side.

My incorrect explanation was based on me thinking of a complex expression as a tree, with AND as the root. For example, this fake expression:

expr1 OR expr2 AND expr3

behaves as if there are parentheses around expr2 AND expr3, but the "tree view of precedence" with AND being "more" would put the parentheses around the OR expression. I didn't explain my wrong idea to the students, but it is an error that I sometimes make in my thinking - it makes sense to me!

Is there a better way of explaining precedence to avoid this ambiguity than to say "it binds tightly"?

I encountered this when teaching SQL, but the question is not really about Boolean operators or Math, it is about Precedence in general as implemented in many languages. (If I had been showing a math example I would have unconsciously followed the rules of Algebra, but Booleans are not as common in my life.) A common synonym for Precedence is "Order Of Operations", but in SQL there is not supposed to be an 'order'. This is especially so with Booleans, because they just yield T/F and so there is no sense of left-to-right or anything.

Actually, your tree explanation is fine, except that it is the low precedence operators closer to the root. In Java, the "." operator is the strongest/highest and the assignment operators are the lowest precedence. The arithmetic operators are all higher precedence (bind tighter) than the booleans, with && having higher precedence than ||

A semi-official list is here: http://operator-precedence.com/java

In fact many compilers will translate an expression (the entire program, in fact) into a tree structure either explicitly or implicitly.

But, "binding tightly" is pretty traditional for an explanation also. The scope of an operator is limited by the end of the expression or the occurrence of a lower precedence operator. Therefore the RHS of the OR in your example is the end of the expression, but the LHS of the AND is bounded by the OR operator.

In the tree explanation work from lower to higher. In the "binding tightly" work from the higher to the lower precedence operator.

Odd historical note: To a logician, AND is logical "multiplication" and OR is logical "addition", hence the typical relationship in programming languages.

However, Pascal took that idea a bit too far and OR had the same precedence as addition with AND having the same precedence as multiplication, requiring parentheses in many more expressions than you would like.

On the other hand, having to write things explicitly in a programming language is usually a good thing as it lessens the likelihood of an oversight error.


Teaching interaction design to potentially disinterested students Background: I will be a teaching assistant in a course on "Interactive Systems" with the following learning goals for the students.

Analyze and criticize user interfaces
Identify and describe important subsystems in the interaciton loop
Implement efficient user interfaces from sensors and actuators
Prototype interactive computer-implemented products
Evaluate and judge user interface designs with respect to usability

I will be teaching computer science students and students from a programme called "IT" which focuses on protoyping, programming, and design. Both groups are second year university students. Having recently graduated with a master's degree in computer science myself, I know from experience and from fellow students that courses on these topics are not appreciated (some loathe them to the point of bullying others for liking them). From speaking to the IT students, I know that they see these courses as simple, but essential to their further education. So I am, roughly speaking, standing with two groups of students: One that would rather be anywhere else on Earth, and one that thinks the course is fine.

Now, as part of a course on teaching I have been asked to prepare a mini teaching session. I have decided on the goal for this session to be for the students to reflect on the role of interaction design and usability evaluations in a larger frame - for instance, what relations they have to database administration or to developers. I am hoping to motivate the students to see what their own future role could be, should they choose to go down that path, and otherwise to understand that it does play an important part along with the things that do interest them.

My question is: Do you have suggestions for examples that I could provide them with, such as case studies of software development processes, or can you think of good arguments to put forth?

Other comments are also very welcome!

(I have always been interested in usability and user experience, so I would especially like answers from people who might feel less interested and therefore understand my future students better)

Edit: I am not just looking for examples of good/bad end results but also of the design/development process, to showcase e.g. how interaction design relates to programming/development.

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

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

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

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


Avoiding difficulties when teaching with metaphors It is said that metaphors can do more harm than good, and I agree that other methods should be developed, like the "notional machine" idea. However, computer science is not like anything else, because it is a constructed reality. It therefore seems like the best way to teach it is to show students how a new concept is similar to or related to things they are already familiar with.

What do you do to work around the the problems of using metaphors to teach, such as students' cultural divergence (and therefore ability to understand the metaphor)?

I love to make jokes and allusions. Here are some examples of ways I handle my increasing age difference from my students:

Explaining the reference

When describing how assembly language programmers compete to shave instructions off an operation (such as calculating absolute value), I tell students about the old game show Name That Tune and sometimes even show them a clip.

Challenging students to recognize the allusion

After teaching students about big-endian and little-endian, I ask if anyone recognizes where the references is from. If a student successfully guesses Gulliver's Travels (from the terms or from the images I include), they get a prize. If not, I explain.

Learning students' culture

As a sample app from my mobile development course (to demonstrate design docs), I designed a variant on Pokemon Go where students get and evolve professors by meeting with them. I paid someone on Fiverr to create Pokemon-like images of me.

Create memes

Students seem to enjoy memes. Here are some that I've created.

This one is about L2 caches:


A real world example for the divide and conquer method Can someone give a real world example for the divide and conquer method? For example, I've heard the boomerang used to explain the idea of a loop back address. What is a real world example we can use to teach students about the divide and conquer method before going to more complex algorithms?

Back around 1985, Susan Merritt created an Inverted Taxonomy of Sorting Algorithms. The idea is that to sort an array you have two phases, the split phase and the join phase. She divided the various algorithms into two types easy split/hard join and hard split/easy join varieties. Merge sort is of the former type. Quick sort is the latter.

But all sorts, envisioned in this way are divide and conquer. Her original paper (part of her doctoral work) is a wonder and worth exploring by any CS teacher.


Platform recommendation for an online competitive programming school I am supervising a team that is currently trying to build an online competitive programming course/school for a collection of high-schools in Turkey that all belong to a certain private educational institution.
As a former graduate of one of these high-schools, having competed in physics Olympiad and currently studying CS I have been offered this job along with other college students studying CS, some of whom have won medals in national and international Olympiad in informatics.
Our team has already made an outline for a curriculum and started teaching to a group of c. 80 students over Zoom.  Although we are confident in how and what to teach, we are unsure which platform to use as an LMS for uploading, sharing and organizing course material like presentations, assignments, etc. As a provisional solution we are currently using Discord but  are aware that in the long run Discord is not optimal as an LMS, as there is no way to share and organize course material in a structured manner. We are considering a better and more professional solutions but having very little experience in this area we are unsure which option to choose. Following have been considered:

Microsoft Teams
Moodle or a similar LMS
A custom build website

I have been told that moodle is difficult to set up and is an overkill. Developing a custom web-site seems not very practical too. Do you think microsoft Teams can be suitably used as course/learning management system, where course material and assignments can be managed in a structured way? Do you have any other suggestions?

My first instinct is that any LMS is overkill.  LMSs manage classrooms, it's true, but they also are designed to help manage schools, and most of the administrative end (and most of the features outside of the literal classroom aspects, and even many of the features within the classrooms) of any LMS would be completely useless to you.  Busing, medical designations, learning disability plans, school lunch designations, guidance counselor assignments, etc, etc, etc, etc, etc, are all beyond what you need for such a small program.
I'm assuming that most of what you're looking for is a way to distribute and receive assignments.  If this is, indeed, the case, I actually recommend using GitHub.
At the start, kids can simply use your repo as a way to download files through the web interface, and can submit early assignments through Discord, just as you've already done.  After they're comfortable with the GitHub interface for downloading, you can start having them fork projects.  Introduce git functionality slowly, and keep supporting them with Discord in the meantime.
You'll get two big big benefits out of this approach:

You don't have to get into anything nearly as heavyweight as an LMS.
The students will slowly become familiar and comfortable with basic git actions.


Do Python and Java lead students to construct different mental models of memory? How are novices' mental models of variable storage affected by programming language choices? Most Intro to CS teachers (I think) do not delve with breadth and depth into details of how variable names are tied to data and datatype. As a result, some students create pieces of their own mental model of how the computer is storing these variable names, data, and data type.

What mental models of memory storage in general (and for sequences in particular) are typical in students who learn Python first vs. students who learn another language first- one that treats arrays more like C does?

Background

Several single-university studies (e.g. Jayal et al. 2015) have found that a post-secondary sequence that starts out with Python and then transitions to Java performs as well as a sequence that starts in Java. Another question asks how to optimize that transition.

Python has particular elements that do not correspond well to Java, however. Negative indices (with which a=[1, 2, 4, 6] means that a[-1] is 6) and slices (with which a[1:3] is [2, 4]) are commonly found in code students stumble upon on the Internet, making it somewhat useful to mention these language features when teaching about lists and strings.

Python's native types don't include a type in which pointer arithmetic can be exploited for speed, though the numpy library offers an array. I suspect that when students learn about Java arrays, they probably build a mental model that fairly closely matches how arrays are stored in memory in C. Python does not actually store lists in a sequence of equally sized memory blocks; [3, 'a', 5.2] is a perfectly valid list.

Does the mixed-type sequence or slicing or negative indexing in Python change a student's initial mental model for lists, arrays, and other sequences?

I am not aware that cognitive modeling of memory structures in early programming education has been directly studied, so anything that I say here is entirely speculative.  However, I suspect that the models themselves would somewhat depend on teacher presentation, and would otherwise be relatively stable.

Take negative indexing as an example.  A reasonable initial cognitive model for a list would be some sort of cycle.  If it is later explained as an array with indexing performed with a modular operation, then we have moved our conception to some sort of line.  When we even later explain about memory references and data size, then we can finish the picture as an array (line) of fixed size memory references, each pointing to a different object in the heap.

There are only so many simple physical shapes that we can use to represent these ideas.  Which actual conceptualization a student takes will depend on their maturity in the subject matter and on how the data structure is presented by the instructor.  I don't see any reason to believe that the initial choice of language would have any substantive, lasting impact on these cognitive models as the student matures in their understanding.


How is computer science (and education) different today than some decades ago? My sister, her husband and I (the older generation) were sitting at the dinner table with their two children (the younger generation), discussing computer science.

One of the members of the older generation said, "From what I understand, most programming (except for cutting edge applications like nanotechnology) has already been done, and can be looked up. A lot of computer science nowadays is choosing and cutting and pasting the formula that most appropriate/efficient for your application. This was different from "my time," when there was a much greater emphasis on discovering new ways/languages, for programming."

One of the younger generation agreed that computer science nowadays was much more of a "copy-editing" job than what she remembered from her teachers' descriptions.

Has computer science/education in fact changed in this way within the past three or four decades? Assuming that it has, what would be the implications for classroom practices today? (For instance, when I was studying computer science in the 1970s, very limited use was made of "library" functions, and we were encouraged to do things from scratch.)

Like any field with an active research community, Computer Science changes over the decades, sometimes quite drastically. If a practitioner doesn't keep up he or she will be left behind, not understanding the new work.

Decades ago problems tended to be a bit smaller in scope. How do I sort an array? Now they are massive. How do I scale a cloud environment and make it immune from failure and attack?

For this change in scope and scale to occur we need to learn to think at higher and higher levels of abstraction. It is hard to write complex programs in languages that permit only simple constructs.

Language research is still an active pursuit. The ACM still has a special interest group POPL interested in the Principles of Programming Languages, for example. The papers and discussions are deep and "modern."

There are many other ACM SIGs, some of which, say SIGMobile, couldn't have existed a couple of decades ago, prior to smartphones.

The other thing is that such a field grows so much that no single practitioner can grasp all of it after a certain point in time. In mathematics, for example, this point was passed around 1900. It has probably been passed in CS as well.

Regarding education, the changes in the field have also generated changes in teaching, both the content and the methodology. I can speak only for what happens in the US since all my experience is here. But an undergraduate CS major will get two things. First a broad education, including History, Philosophy, and the rest, including some writing. Second they will get enough education in the major field to either go on to a graduate degree or obtain an entry level position in industry. But they will normally never be deeply taught in any one aspect of CS (or Math, or Literature, or ...), nor broadly enough to say they know much about the whole field.

The Master's degree, on the other hand should, in a technical field teach students the things that every working professional needs to know. Again, this isn't necessarily very deep nor broad, but it has to be vaguely comprehensive for the working pro. It should also get you a bit closer to the ability to do research if it doesn't already include some research component. But usually the research required there is into what is known about a possibly new or arcane topic, rather than the creation of new knowledge in a field. That is for doctoral programs.

The effect of this is that undergraduate teaching now includes more options that were not studied in the past (big data, machine learning, ...) through elective subjects at the upper level. It also means that some things that were needed by working pros in the past (numeric algorithms, say) are not taught to the same degree as much of what was once hard is now captured in standard libraries. But methodologies also change, and now teamwork is much more used in the classroom than was typical a few decades ago.

The conclusion I draw from all of this is that students need to start higher up the learning tree if they are to get where they need to go. In my view, recapitulating the history of computation, starting with low level concepts and tools and building everything up incrementally is a mistake. There is also no need. Students can start at any level of abstraction and work upwards from there intensively. They make excursions down the abstraction hierarchy on occasion as some of that helps the understanding, but a complete understanding of the foundations of, say, IEEE Floating Point algorithms is only needed by a very few working pros. If you start the education, today, the same way it was done 20 years ago there will be no time to get to today's problems and solutions.

I used to tell my students that my job is not to teach them what I know, because much of that is now obsolete. My job was to teach them what they need to know. Not the same thing. One example is the hidden bit in IEEE Floating Point.


Is stressing too much on formalism acceptable? Most of the students like the analogy way of teaching things. But I am biased towards the formal way along with a little bit of analogy.

For example, (to make simple) in order to teach about a set to the students who don't have any clue about it, I start by saying

  A set is an unordered, well defined collection of elements, in which
  repetition doesn't matter.

Then going with examples of what is a set and what is not. But over time I found that people tend towards analogies, more than formal. I have no issue with analogies and I also do it. But they tend to forget the basic definition and facing problems while doing mathematical analysis.

Colleagues suggest that students can find formal definitions through textbooks and hence reduce burden of teaching too formally by referring corresponding textbooks and focus on motivation and surface teaching only. But I am not at all satisfied by it because in CS, things only work by formal definitions, not (only) by analogy.

What should I do? Continuing or discontinuing on stress formalising?
 (Consider time limitations)

Moving from formal to informal is almost always a mistake.  Let me see if I can show you why.

When you consider how you think about sets within your own mind, I am reasonably certain that you rarely use the formal definition.  Instead, you visualize or otherwise imagine something more akin to some abstract sort of bag, box, or group.  The specifics of your visualizations are not so important here.  However, the internalization that you use must be, in some sense, physical.  Members can be in or out.  Things can be added in, or removed.  Your mental imagery may be only partially fleshed out, or it may be much more definite, with form, color, and texture.

This mental model gives you a strong set of intuitions regarding sets that allow you to work with them quickly, efficiently, and correctly, allowing you to move to formalisms only when you really need them, such as when you are attempting a proof, or when you are trying to enhance your understanding of some novel property that you hadn't understood before.

Why do you suppose that we always draw out our Turing Machines instead of writing out their formal definitions? (I searched online for a long time, and I honestly can't find a single example of a TM entirely written out.)  Similarly, why do we normally draw a geometric diagram instead of simply writing out the formula for a diagonal bisection of a square?

The answer is obviously that the concepts are far eaiser to understand when turned physical.  This property will hold true for basically every abstract concept we've mastered.  Our minds are wired towards the physical.  We can figure out a reasonable path in a crowd of moving people almost without effort, but take months (or even years!) of training to be able to reliably find the sum of multiple-digit numbers.

Taking this idea to an extreme, you could construct a fully formal, mathematical description of Chess.  Squares are sets, numbered from 1-64, and $Pawn_{i}$ where $1 \le i \le 8$ can always move to $Pawn_{i}loc + 8$ iff $current + 8 = \{ \} \land current < 57$. Similar descriptions can be made for every other legal class of moves, but by using such an approach, you would take a game that any 8 year old can learn, and you would make it inscrutable. The poor 8 year old would never be able to learn the mechanics of the game. (And mechanics is not a coincidental word here!)

Visualizations and strong analogies allow us to make concepts instantly clear.  As Buffy points out in his answer, mathematical work moves from concept to formalisms, almost never the other way. To do otherwise is to ignore the way that our minds learn.


Statistics on functional programming in CS1 This question got me thinking about cs1 and functional programming.

Do there exist anywhere statistics on what portion of schools teach cs1 using a functional paradigm?  I know that some schools do, but I cannot find any compiled resource about it anywhere.

The paper "What Do “CS1” and “CS2” Mean? Investigating Differences In the Early Courses" by Matthew Hertz alludes to there being some sort of compiled resource, but I can't find it.

While it's not complete and almost certainly not the reference mentioned in the paper, Philip Guo compiled a list of programming languages used in introductory courses at top 40 departments (as ranked by US&WN). The key result is this table:

which shows that the only functional language, Scheme, is used in roughly 12% of departments.

There are two problems I see with using this as a statement about CS education at-large: first, this is a sample of the top 40 research institutes, which may not be representative in terms of teaching habits.

Second, Guo (by his own admission) is counting both CS0 and CS1 courses in here. For example, he counts CS303E at UT Austin as an intro Python course, although it's intended as a half-semester language intro for non-majors. This may skew the appearance of certain languages in his data.

Finally, a note: in the comments section of that article is a statement that says

  What we need is someone to resurrect the more comprehensive annual survey that I believe Jean E. Sammet used to do up to a few decades ago...

I wasn't able to find any record of this survey, but if "a few" means just one or two, then that might be the source you're looking for.


Is the CRT still relevant when introducing display hardware In the context of an undergraduate course on microprocessors and architecture, I'm looking at how to introduce a VGA display peripheral. This is with the specific goal that they implement the peripheral in verilog on an FPGA (they're given a microprocessor and the rest of the system).

It's VGA because of the current hardware used for the supporting labs - and I kind of like the example peripheral because it has a useful set of physical layer constraints. An LCD interface might seem like a more relevant, but then we're looking at a SPI peripheral or similar, and that defeats the object of the module.

The VGA physical layer is clearly an evolution of analogue TV and CRT technology, so it's quite tempting to start the description of how pixels need to map onto the screen by talking about the CRT and how an electron beam scans across the phosphor, line by line.

My question: how relevant is this analogy going to be to current school leavers, and will it work as a starting point for describing horizontal and vertical sync?

I've thought of trying to update the module by describing how an LCD panel would de-serialise the VGA signal, or switch to another output interface altogether, but it seems that the example I have at the moment might be worth keeping alive for a few years longer.

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

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

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


Teaching C#, Java, etc. to students who are bad at OOP Last semester, I was assigned two classes of C# and assuming them to be well-versed in Programming Fundamentals (PF) and Object Oriented Programming (OOP), I started the course at normal pace. After a few weeks, I took an introductory lab test (it was pretty easy one actually, summation of n Fibonacci terms) and some of the astonishing "discoveries" after my round of the class (about 30 mins after assigning the task) were:

Around 1/3rd didn't have Visual Studio installed
One guy was coding it in SQL Server (genius?)
Those who didn't have VS installed were given option of online IDEs (like this one) and it "dawned" upon me that they were coding in Java (didn't even care to change Language in options)

Then, during lecture, I discovered some more facts, like:

In a class of 50, less than 10 knew the concept of basic OOP like Inheritance or static members.
Non has implemented Polymorphism before.
Function Pointers was a thing unknown to them (even they had studied OS and I think PThreads are pretty much part of it)

It not only left me heart-broken, but also prompted me to teach them OOP's concepts from scratch, which meant that I had to compromise over some advanced topics of .Net

Question

Now my question is that, what should be the correct approach to teach an advanced language like C#, Java to a class given:

Majority of them are bad at OOP (lets assume they are ok at PF)
There are some students which are/were good at OOP and eager to learn new technology (and should not be punished for others mistakes/negligence)
There is no Lab to complement your class (even the lab test I took was by my own efforts)

Update

As per @Jay and @Buffy's points, here is further explanation:

It is a recurring process as although I have taught C# only once but observed such a weak links (in Programming Fundamentals and especially OOP) when teaching other courses as well.
I don't have enough power to arrange Bootcamps (I used to have them in earlier institute but here limited class rooms means we can't arrange Bootcamps unfortunately)
I don't have enough power to affect the overall process either.

Looking forward to your interesting inputs. Thanks.

I know exactly what you are talking about. Back when I was still ( I am glad I am no longer doing that) working as a faculty in a university, I ran into situations like this. In fact, with my usual style, I got confrontational with the faculty who was supposed to teach OOP in the previous semester and stuff happened.

Here is what I did.

First up, the logistics. I had a detailed discussion with the HOD and also with the students, and convinced all of them to come for additional classes (I called them Bootcamps)
The Bootcamp was a 2 day affair ( 6 hours each ) and was held on a holiday. No attendance or anything like that. Students who are serious can come (and 80 % of the class showed up)
Taught the basics of OOPS. I essentially summarised the entire semester worth of contents into 12 hours.

Did this work? For me, it did. I was able to carry on with my usual syllabus with confidence that they are at least, not as blind as before. sure, I had to spend 2 of my personal days, but it was worth it.

Here are the things I crunched on those 2 days.

Classes and Objects (and the interconnection between, and compared them favourably with structs)
Encapsulation (especially private and public and why this is important)
Inheritance (the big boss of OOP, and by far the most important thing about any OOP language)
Polymorphism (although this was pretty straightforward and did not drive people crazy like inheritance or the initial discussion of classes and objects)

So, talking from first experience, the situation you described is the norm rather than the exception. If you want to get them up to speed, I suggest a bootcamp or a similar variation.


Simple explanation of JPEG working principles I will teach a lesson on image file formats in a computer science high school class.

Regarding JPEG, I will say that it achieves lossy compression and that it is well suited for photographs but it should not be used for geometric drawings where it can generate artifacts, showing some examples.

However, is it possible to explain why JPEG works this way, without venturing into domain change (space to frequency conversion), Discrete Cosine Transformation, and so on?

The basics

Let me start with a quick overview of how JPEG (as usually applied) compresses color images.

Colorspace and downscaling. Raw images are usually encoded in the RGB color space. The human eye is more sensitive to the luminosity of images than to their chromatic aspects — as an extreme  example, we can understand black and white photos quite well. Therefore JPEG images store more information about luminosity and less about colors. This is implemented in two steps. First, the RGB color space is transformed into a different color space (in a linear fashion), YCbCr (similar to the TV color space YPbPr) in which Y is luminosity and Cb/Cr encode how much the pixels are blue rather than purple (Cb) and red rather than green (Cr). The Cb and Cr planes are then downscaled or subsampled, that is, their resolution is reduced, usually by a factor of 2 in the horizontal direction (the eye is more sensitive to the vertical direction). From this point on, the three planes are compressed individually.
Division into blocks. Each of the color planes is now divided into 8×8 non-overlapping blocks (in contrast, in MP3 the sections are partially overlapping), which will be compressed more-or-less individually. This division is the reason for the so-called blocking effects, since the superimposed grid cuts through features of the image.
Spectral compression by quantization. The basic insight behind JPEG is that nature is noisy, and this noise is filtered by the human visual system. It follows that we can throw away the noise without substantially affecting the way the image looks. It remains to decompose the image into its "substantial" and "noisy" components, and this is accomplished by a 2D Fourier transform. Recall we are trying to compress 8×8 blocks. The most important feature of a block is the average value of its 64 pixels, known as the DC component (or, zeroth Fourier coefficient); the DC components of all blocks are just a result of scaling down the original image by 8 in both dimensions. The importance of the other components, known as AC components, depends on their frequency — the higher frequencies correspond to noise, whereas the lower frequencies are more informative. However there is no clear cut distinction between features and noise. For this reason, we need to retain all components, albeit with different accuracy. Accordingly, we quantize the different components to various degrees, depending on the frequency: components corresponding to higher frequencies are quanrtized more. The exact quantization matrix depends on the disparity between the horizontal and vertical dimensions, and has been determined experimentally. (It also depends on the quality parameter of the compressor.)
Entropy encoding. It remains to encode the quantized components into bits, which is done using Huffman coding, a standard encoding scheme. Since the DC components of all blocks are a downscaled version of the entire image, we expect them to vary continuously. Therefore instead of encoding their actual values, we encode them differentially, that is, we encode the difference from the preceding DC value. The AC components don't have this behavior, and so are encoded absolutely.

Artifacts

Why does compressing geometric drawings result in artifacts? Geometric drawings are very different from natural images. They don't vary continuously. Spectral compression results in "smearing" effects, since we are only retaining the lower frequencies. The best illustration of this is the Gibbs phenomenon, which is the continuous analog of the same issue. When trying to represent a step function using Fourier series, we need to use all frequencies. If we suppress the high frequencies, we get something really different. Lines in a geometric drawing are the discrete analog of step functions.

Another problem is the blocking effects. Imagine a diagonal line. JPEG partitions the space around these lines into 8×8 blocks, which are compressed individually. No attempt is made for the resulting lines to match exactly, and indeed they probably don't. This is very apparent because lines are very clean and exact, something that cannot be said about real-life images.

Teaching ideas

Using software like Matlab, you can show the effect of quantization on a real-world image, and then compare it to the effect of quantization on clip art. You can vary the quantization steps to show the effect of downplaying the higher frequencies (and also what happens when trying to suppress the lower frequencies).

You can demonstrate the effect of blocking by varying the angle of a line which is compressed block-by-block, or fixing a line and varying the block size. You can use a low quality setting to emphasize the effect, and include the block boundaries to highlight its origins.


What to teach in an Advanced Computer Networking course? I was commissioned to prepare an advanced course on Computer Networks with updated topics. My students have already passed the Computer Networking course using A. S. Tanenbaum's book. They gave enough on the theory and I would like to give you something more practical.
They recommended that I address security and network administration issues but I'm still not sure.
Do you have any ideas? I listen to suggestions

I created an Advanced Computer Networking course offered at Master's level which follows an earlier undergraduate course in networking (which I also created and teach).
I'll offer some insights, suggestions and thoughts, but they will just be off-the-cuff rather than a formal curriculum plan (I've done enough of those).
The first thing to start is to not assume that the students have fully absorbed and are usefully fluent on everything in Tanenbaum! Start with revision, focusing on those parts of the material that would be essential to grasp to move on to the advanced material. Do not revise by just going through it again, but do it through asking questions and raising problems so they can determine if they understand the material well enough. In particular I brought out routing at the network layer as being critical, as well as multiplexing at the transport layer, as well as the whole 7 layer model again.
I then focused on larger issues that students may not have encountered when administering their own machine. Things that happen at ISP level and internet backbone level, such as BGP, AS numbering and the protocols and databases involved.
A lot can also be done with security, such as the law and ethics. What is a network administrator permitted  to do and when does managing a network exceed the authority allowed (such as entrapment). I looked at honeypots for example, as well as logging.
In a more advanced course I also put more emphasis on self-learning. Things such as monitoring media for incident reports; making presentations on security incidents over the last 12 months, for example.
In terms of network management SNMP and tools that use it can be covered in more detail, including network discovery, network mapping and so on. As practical work I get them to program an SNMP tool to learn about the object encoding mechanisms and also about packet capture.
I have more ideas, but this might get you started.


Encourage students to be independent As is often the case, there is usually more than one way to approach a problem or task.

Currently, my students use what they were taught in the lessons (which is expected). When they stumble upon a problem (e.g. a project that has parts that they are unsure how to approach) they very often get stuck. This is because they haven't been taught some specific thing that is related.

I want the students to be more independent in their learning, and to look for that other approach on their own. How can I structure a lesson that would foster independence and give the students the ability to look for a new approach when needed?

The students' level is somewhat advanced high school level.

I think there's a few different skills students need for independence, and they require quite different teaching approaches. Independence is the end result but you can't teach it directly.

Confidence. They need to think it's possible to try out a new toolset and make something. Guiding them prescriptively through a variety of different new tools is a good way to do this, as with @BrDaHa's answer. i.e. Don't teach independence as such but show through example that different and new approaches are possible and not too difficult. Once they've achieved several different projects, even tiny ones, with different technologies they'll be more confident to explore different options rather than use the same thing every time.
Abstract understanding. The hard bit of programming is thinking about problems and solutions in the right way. Once you know conceptually what you want to do it's much less scary to go find a tool to implement that well, and that conceptual understanding will help guide you through using a new tool. Teaching CS generally addresses this, plus a specific focus on systems design.
Ability to learn something they don't already know. Reading documentation, using stack overflow, reading blog posts and books. Students need to learn each of these, they're different skills, and they're often not taught well or at all in CS courses. When you can do these things then approaching a new tech is fun rather than daunting.
Appreciate there's different tools for different jobs. You need to demonstrate, or better have them experience, that some technologies are great for some things and not others. So they know there's worthwhile in exploring different tech. On the one hand, when you have a hammer everything looks like a nail. Conversely though, it's often a lot faster to use a tool you know than learn a whole new one for a small job, even if that tool is 'better'. Negotiating that trade off is an important part of general software development. Part of the fun of being a developer.


Students can solve programming exercises but not explain their solutions. What to do? I've seen too many cases when a student has completed a programming exercise (without cheating) but can't say, for example, what type of values a variable contains during program runtime (in case of Python programs).

It looks like the ability to solve exercises should not be the only (or even main?) criteria for assessment.

Do you know any research papers (or books or posts) that tackle this issue and/or recommend other assessment techniques / exercise types?

I have seen my share of this 'program gets output' but the programmer has no clue how she/he got there. It's funny how that happens so many times.

This is what I have done to at least handle the issue.

Before assessments, I break down the evaluation to include the following.

Simply getting the output gets them the bare passing grade.
Those who can use meaningful names for their variables, function calls get extra.
Those that can back up their loops, method calls and variable declarations with expansive ( 2 to 3 lines at least) comments get extra points.
In addition to that, those that can write psuedocode above the program code (perhaps in a big block of comments) get some more.

Obviously, this makes me their least favourite faculty in terms of evaluation and gets me a lot of complaints but I stick with it.

Update : Please note that, during evaluation, I don't expect all of them to be done. Say, a student is already using meaningful names everywhere, I would not mark her/him down for not writing comments.


How do teachers motivate students to persevere and learn? One primary issue I have as an Instructor is increasing student motivation. For me, there are only two motivations in life:

Because I enjoy it
Because I need to earn a living

Reason #2 is probably too distant for most students to relate to, and if they don't already have #1, how can I give it to them? I have been fortunate that my interests have led to being able to support myself (by programming and by teaching it), but from what I can tell, most young people are not really interested in anything at all, which is breathtaking. So, to avoid a future failure of #2, and intense boredom from lack of #1 throughout schooling, how can I encourage interest and motivation?

To explain why this is so important, I quote from the Computing Ed Research Blog (emphasis in original):

  If the only educated people in our society were the ones who wanted to learn (at the start, from the beginning of a class), our society would collapse. We would have too few educated workers to create innovations and maintain the technology we have. Our society depends on teachers who motivate students to persevere and learn.

I have long puzzled over what I see around me: that many people think of their job as just providing a paycheck. I could not survive that way, work has to be interesting also. But now I see that this is not just my problem, it is a problem for society, because unmotivated people will not be creating any new ways to improve our lives and keep the economy going. Apparently the tendency will be for more and more work to be automated, surprisingly not at the grunt level but at the white-collar level. So, we can either get forced out of creative, interesting work by automation, or we can outrun it, creating new opportunities.

How can I motivate students to "persevere and learn"? How do you do inspire interest where it does not already exist? This is my personal blind spot, and I appreciate any suggestions and insights.

Your instinct are dead-on.  Students, at least in grades k-12, are not terrifically motivated by what they will "need" in the working world.  There are plenty of good reasons for this.  First of all, what they will do for their work seems very abstract and far-off.

Also, viewed from a vocational lens, there is a quite reasonable shot that they won't actually need the things we think they will.  They might not be going into (or might not think they are going into) the careers we are thinking of, and in any case, jobs are so heterogeneous that to make almost almost any statement of what work requires nearly meaningless.  Add into the mix the speed at which the world seems to be changing, and our predictive abilities just get worse and worse.

But not everything is lost.  People, including kids, are intrinsically motivated to learn when conditions are right.  But we have to get a lot of different elements all moving in the same direction, and for some students, this is easier to manage than for others.  Some students love school and think of it as a place where they can thrive, but some others are a little broken and burnt out, or feel unsafe either about approaching difficult topics, or about their surroundings, and these problems can make intrinsic motivation very hard to tap into.

The end-goal is to help kids feel safe to try their best, that the ends are actually achievable, and that the material connects to their current world.

-- Organizing the world for motivation --

Teacher Beliefs

Let's start with a few ideas that have to come from the front of the room.  Certain teacher attitudes permeate the classroom.  These attitudes are not sufficient by themselves to motivate kids, but if they're not there, nothing else is going to go right.

The teacher believes in the material being taught.  They think that it is both useful and interesting.  (And hopefully a little amazing, too.)
The teacher believes that the students are absolutely capable of learning the material.
The teacher loves their students, and genuinely wants to see those students thrive.
The teacher praises good student practices above and beyond student accomplishments.  There is a lot of research to back this up; students who receive praise predominantly for being right, for being smart, or for being the best at things often become wary of difficult material and of the unknown.  Why throw yourself into something if you can't succeed like you have in the past?

By contrast, if you are typically praised for good process or for working hard, then when the material gets hard, that praise still feels quite accessible.  You can still organize your own learning and work hard.

Student Beliefs

There are a few things that the students need to know, and these should be directly taught and modeled at every opportunity.

They are safe in school.  There are people who care about them, there are people who are their friends, and there are people that they can go to if they are down or get into some sort of trouble.  (Particularly in the k-12 arena, this requires some active monitoring on the part of the teacher, and may necessitate some intervention as well. People don't thrive when they are frightened or lonely.)
Intelligence is not fixed.  Intelligence is more like a muscle, because you can flex it and make it more powerful over time with work.  Improvement is always the goal, not just the end-product.

Classroom Practices

Once the beliefs above are in place, we can actually do the work of motivating the students:

What makes something intrinsically interesting is connections.  The more connections that can be drawn from the material to the world that the students already know about, the more intrinsically interesting the material is.

Those connections can be to the students' social worlds (that's where you end up with entertainment tie-ins; if the kid knows that "all the other kids" think that Beyoncé is cool, then class material that relates to Beyoncé is now instantly connected to that child's social world.)

Of course, it's better if the connections are deeper and more thoughtful, but if you're working with kids who are difficult to motivate, take no shame in working any angle available to you.

The more the connections, the better.  The richer the connections, the better. The more surprising the connections, the better. Connect ideas to what they've seen in the past. Connect ideas to weird things you've just shown them. Connect ideas to the world around them. Take pains here to make the invisible absolutely explicit.
Help students to monitor their own progress and set their own short-term goals that lead to the big picture that the students can actually accomplish.  (This is hard to do. Even adults are often bad at assessing their own understanding, so teachers can create activities to help kids reliably monitor their own learning.)
Keep your criticisms of students both constructive and loving.  Always make explicit how your criticisms are really aimed at helping the student, NOT cutting them down, and make clear that there will be accompanying support to help the student learn to do better.

It is achievable

It is.  It's not easy, but it's possible to get kids really excited about learning all sorts of things.  If you watch some videos of amazing teachers (YouTube is an incredible resource here), you can watch this motivating work taking place at every grade level and in every sort of classroom imaginable.

Learning to apply these ideas to your classroom is hard.  Watch an amazing third-grade music teacher, and then watch an amazing 11th-grade math teacher, and their practices will seem very different at first glance, but the core underlying ideas are actually the same.


Any website or textbook with problems/solutions for Computer Science Theory? The course includes: Regular Languages, Context-Free Languages, Turing Machines, Decidability, Reductions, etc. Do you know of any collection of problems/solutions suitable for a senior course?

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


Do you see the "Bimodal Distribution" too? When people learn programming in a school setting, tests show a "two hump" tendency. Some students race ahead and grasp it relatively well and others struggle. Apparently this is more pronounced in programming than in other areas, like math or language. It seems to occur at all age levels and circumstances, and throughout a curriculum.

Do you observe this? If so, do you have any explanations, and any ways to address it? It seems to be particular to programming, so it is our problem to deal with.

Ah, the famous bimodal distribution in computer science!

When I took my first CS class in college, I frequently helped out a fellow student in my section who struggled mightily, spending unreasonably long amounts of time on seemingly simple labs. We made very little headway together. In spite of a semester-long effort bordering on the heroic, the student just couldn't seem to get programming.

I asked my professor about it late in the semester, and he said that there were a certain number of these students every semester, and that he didn't really know how to help them.  He said that, if they didn't withdraw and kept working, he would let them go with grades of C instead of the Fs they actually earned on their exams.

I saw it again years later, as I started teaching my first computer science courses.  In every class, there were some number of kids who just didn't get it.

And I was not alone!  Others were seeing it, too, and there was even an unpublished research paper that started to make the rounds on the internet called The Camel has Two Humps, which asserted both the bimodal nature of the field and that they had created a test that could predict who would be able to "get" it.  That paper was hardly the beginning of the story.  In fact, professors have been investigating this bimodality for years.

Lately, however, the story has been changing.  The author of the original unpublished study issued a partial retraction, and researchers began looking at far larger datasets of introductory CS grades.  It turns out that that bimodal distrubution is not really bimodal after all.

So what is going on?

When we teach programming, we want our kids to be able to program.  So we test them on programming, and we want to heavily weight our grades on, well, whether or not they can obtain the proper output.

To illustrate this, let's take a hypothetical problem prompt, and some sample answers.  The question, which will be in an introductory Java class, will read, "Create a function called makeN that, given a number n, fills and returns an array with $n$ sequential values".

Answer 1:

public int makeN(){
    array[n] = 0;
    array++; // until its done
    makeN = array;
    return makeN;
}

Answer 2:

public int[] makeN(int n){
    int[] array;
    for(n < array.length; n++)
        array[n] = n;
}

Answer 3:

public int[] makeN(int n){
    int[] array = new array(n);
    for(int x = 0; x < n.length; x++){
        array[x] = x;
    }
    return array;
}

Answer 4:

public int[] makeN(int n){
    int[] array = new int[n];
    for(int x = 0; x < array.length; x++){
        array[x] = x;
    }
}

There's a clear progression among these answers, and they represent vastly different levels of understanding.  Unfortunately, our topic requires students to be able to pull together many different concepts in order to do almost anything.  If we were to grade by whether the answer fulfills the prompt, they would all receive the same grade.

I actually have come to believe that, in a good rubric for a coding example, "actually produces the proper final output" should either not be present at all, or should be worth a miniscule amount of credit.  A good rubric will capture attempts at portions of the algorithm, and successfully achieving steps of the algorithm.

This example above may have been extreme, and I doubt if most teachers would award exactly the same grade to answer 4 as they would to answer 1, I this cognitive bias certainly exists (I possess it myself), and it seems perfectly plausible to me that examples 1 and 2 might receive almost identical grades.

The trick to get out of bimodal thinking, then, is to break down the skills into smaller subskills, and break those down into further and further tiny understandings.  This has two benefits: first, you see the clearer progression among your students, and two, head-scratchers like answer #1 become actionable, and you can see how to help the student to improve.

Student #1 may never quite get to a complete picture during your class - he or she clearly has a lot to learn! - but it is unreasonable to the student (and to you) to demand basically 100% comprehension in order to avoid failure.  And taking a partial understanding as a partial success shouldn't just apply to the student. It's the teacher's success, too.