ncmathsadist
  • Member for 4 years, 8 months
  • Last seen this week
Teaching binary to 6-8 year olds
36 votes

Use money. Tell your students to image a country has bills that are in denominations of powers of 2: 1, 2, 4, 8, 16.... Now tell them this: For a given number, count out that money with as few ...

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

Knowledge of programming is extremely useful. One of my programming students at the North Carolina School of Science and Mathematics wound up at the University of North Carolina. She took CS courses ...

View answer
Students can solve programming exercises but not explain their solutions. What to do?
8 votes

It's time for a little "code review." Have a student present his code in front of class and talk about how he made it work. Hey, this happens in the professional world. There is no time like the ...

View answer
Why do educators not set an upper bound for the amount of times we're allowed to compile code?
7 votes

My philosophy is "use professional tools" and creating an experience that is like being in real programming shop. The compiler can help you get rid of silly errors very fast without wasting time on ...

View answer
Should teachers enforce standardization of spacing and braces?
7 votes

I tell my students this. Pick a style and be consistent. You will see religious wars over for(...) { code } and for(...){ code } Both are FINE. Pick one and be consistent. I find the ...

View answer
Introducing file systems to students who really don't understand
6 votes

Make sure you are having your students "spelunk" in the file system and have them draw some of the tree structure. Often, this visualization helps them see the way the FS works, more clearly. We ...

View answer
How would you explain what is a race condition to a five years old
6 votes

Imagine two guys at a door. Each says, "No, you go first." Result: deadlock.

View answer
First programming Language : C or Python?
5 votes

I started teaching Python at NCSSM in 2004. Here are some reasons I chose it. It is direct and simple, and there is not a whole ton of boilerplate to deal with at the beginning. Hello, World looks ...

View answer
Why is computer science hard?
5 votes

Computer science demands a set of qualities, some of which are somewhat antithetical. One is the attention to detail. Another is the creative ability to build strong abstractions that are both ...

View answer
Best practices for letters of recommendation in CS
5 votes

I write a paragraph saying who I am, and where and how long I have taught. This is standard for all letters. I write a brief second paragraph stating how long and in what capacities I have known the ...

View answer
How to explain lambda expressions
Accepted answer
5 votes

A lambda is an anonymous function. Java handles lambdas via a feat of type inference. What you have done is to assign a lambda to a variable of interface type. You may only do this if the interface ...

View answer
What is a real-world (production-code) example of a function having default arguments?
4 votes

Probably the most basic example is Python's print function, which has keyword arguments sep and end.

View answer
Is it important to teach pointers in a first course using Java?
4 votes

Here is what it is important to know early. Primitive type variables store their value directly (I say: "Primitive types point directly at their values.") Object type variables store the location ...

View answer
The impact of switching to Java 10
4 votes

The changes are not huge. However, all of us will like JShell a whole lot. Java 8 was where the big changes occurred. I only forsee small changes in how I do things.

View answer
Note-taking policy: laptops, or by hand?
4 votes

I encourage my students to keep notes on paper, but I have them use their computers when we are experimenting with code. We do a lot of code examples in class. Standard practice is for them to open ...

View answer
What program follows "hello, world"?
4 votes

The next step is to introduce the type system. Students need to know what kinds of data are "understood" by a language. The "Hello World" program gets the ball rolling because you can ask, "How is ...

View answer
Real life examples of 0-indexing
3 votes

Think about human ages. Babies that are newly born are at age 0. That's zero-based indexing.

View answer
How to give students practice with streaming computation?
3 votes

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 ...

View answer
Explaining why arrays are important for statisticians
3 votes

Arrays are like dressers: they allow you to organize a collection of objects and store them in a single place. A dataset in stat should be seen as an array of results (numbers, vectors, etc.). The ...

View answer
Use of jshell in AP CS A
3 votes

I have found jshell to be very useful. It can be used to inspect classes quickly and easily. You can import any standard library class. You can also import user-generated classes using the /open ...

View answer
Explaining why styling should not be done directly in HTML
3 votes

We teach that there are three layers to a web page: structure, appearance, and behavior. Structure is determined by the DOM, which is created with well-formed HTML5 markup. When we learn about HTML,...

View answer
Differentiating Inclusive from Exclusive Or
3 votes

Think pizza shop. You order a one-topping pie. Would you like pepperoni or sausage? In common parlance, that's an exclusive or.

View answer
How important is learning Binary for first-year college students?
3 votes

Understanding binary, hex, and octal numbers contributes to insight on the workings of computers, although octal numbers are fading in importance in comparison to hex numbers. Here are a few reasons ...

View answer
Should CS students be doing their tests on paper?
3 votes

Our program teaches top-down design. This is an iterative process in which a text editor is indispensable. You stub in functions and methods, spec them out, and then write test code for them. After ...

View answer
How to teach the value of the command line in high school?
3 votes

I have had students work in summer internships; feedback I get from companies tells me that familiarity with the command-line interface is extremely valuable. The command-line interface is very much ...

View answer
How to illustrate scope problem when creating variables inside `if` statements in Java
3 votes

Java, like C/C++ has block scope. When you create a variable in a block, the stack pointer moves to make room for it. When the block ends, the stack pointer moves back. This makes the variable ...

View answer
Why do educators not set an upper bound for the amount of times we're allowed to compile code?
2 votes

Here is something I tell my students. Compiling is like voting in Chicago: do it early and often. I tell them it is a bad idea to write a whole bunch of code without compiling because they then wind ...

View answer
Order to Teach Topics in an Intro Programming Class
2 votes

Here is my recipe. Begin with the language's type system. If the language has a REPL, use it. Introduce variables. Indicate if variables have type (statically-compiled languages) or if they are ...

View answer
how to motivate student that programming will give bright future to them?
2 votes

Do you maintain contact with your former students? I have a sizeable number of former students earning nice livings at places such as Apple, Microsoft, Google, Facebook, and YouTube. Others are in ...

View answer
Using online courses instead of / in addition to traditional lecturing
2 votes

I often refer students to tutorials and videos as a supplement to my classes. They find this helpful because a video can be paused while they experiment with the concepts on their computers. ...

View answer