Most Popular
1162 questions
189
votes
30 answers
Why do we count starting from zero?
In computer science, we usually count starting from 0. Is there any effective way to explain why, to new programmers who ask why?
I've read a bunch of different sources that list several reasons for 0-indexing. However, they either seem…

D.W.
- 1,895
- 2
- 9
- 11
142
votes
13 answers
Should I teach that 1 kB = 1024 bytes or 1000 bytes?
Which conversion should I teach to my undergrad students? That 1 kB is 1024 bytes (binary) as everyone learned back in the nineties or the recent industry-led "friendly" conversion that says that 1 kB is in fact 1000 bytes (decimal)?
My immediate…

alves
- 1,513
- 2
- 8
- 7
123
votes
16 answers
Is it better to lie to students or to be pedantic when teaching Intro CS?
When teaching Intro CS in Java, I sometimes tell students things that are not entirely true, such as that, unlike abstract classes, interfaces cannot contain any code. (For those of you unfamiliar with Java, that was true until functional interfaces…

Ellen Spertus
- 7,630
- 4
- 31
- 54
113
votes
22 answers
Is there some meaningful percentage of students who can't learn to program?
A few days ago, I had a high school sophomore (who is now in her third CS class, having passed the prior two) look at this Java code for a solid 3-5 minutes, and was unable to figure out what it did:
int answer = -1;
while (answer < 1 || answer > 5)…

Ben I.
- 32,726
- 11
- 68
- 151
88
votes
26 answers
How to explain the concept of a variable to a 9-year old?
My 9 year old daughter is heavily interested in science, robots, computers, … She asked me if I could teach her how to program a computer. So, we started with Scratch, a programming language specifically designed for kids.
She likes it a lot, and…

Golo Roden
- 903
- 1
- 7
- 10
83
votes
11 answers
Is it bad to force my students not to return early?
A fellow teacher of mine is teaching "basic algorithms" course in high school, and we have quite conflicting opinions when it comes to returning from functions.
She restricts return only to the end of the function, and permits no other way to escape…

Yotam Salmon
- 1,205
- 2
- 10
- 12
74
votes
18 answers
Advances in CS appropriate for CS1 and CS2 made by female computer scientists
Over the course of the CS major at my school, especially in years two and three (roughly equivalent to years 1 and 2 at a university), as I introduce my students to significant advances in Computer Science, I include some information about the…

Ben I.
- 32,726
- 11
- 68
- 151
67
votes
21 answers
What are good examples that actually motivate the study of recursion?
One of the traps of imperative-first is how difficult it becomes to help students make sense of recursion when they finally encounter it. And if those kids are fairly competent iterative programmers, they may also resist the new technique, as they…

Ben I.
- 32,726
- 11
- 68
- 151
66
votes
9 answers
How do you teach something when you don't know it yourself?
Teachers are sometimes called upon to teach something with which they have no experience. Don't laugh. Doctoral level education is often exactly like this. The student's advisor may have no background in the student's topic, but must still provide…

Buffy
- 35,808
- 10
- 62
- 115
64
votes
12 answers
How to answer "functional programming is useless"?
I'm a TA for several Bachelor level functional programming courses at my university. In every edition we have problems with some students that have the idea that functional programming is useless, because the industry doesn't use it. The more…
user24
60
votes
24 answers
Should CS students be doing their tests on paper?
In some CS courses (especially undergraduate and high school courses) the tests and the final exam are written on paper without the use of a computer.
But if the students are in a CS course, shouldn't they be allowed to use the computer? If some…

Safirah
- 1,056
- 1
- 9
- 16
60
votes
25 answers
How to convey how much computing power has grown since the 1960s?
I was born in 1968 and used dial-up to mainframes back before PCs were available. We got an Apple ][+ when they came out and thought 48K was a lot of memory.
I live in constant wonder at the world we are now in, which seems like science fiction to…

Ellen Spertus
- 7,630
- 4
- 31
- 54
60
votes
24 answers
How do I teach git to a teenager
I like Git, or at least the idea of it. However I can not get my head around how to use it. Therefore I would not like to teach it.
(This question is about learning to use Git. Not about comparing it to other revision control systems.)
I have used a…

ctrl-alt-delor
- 10,635
- 4
- 24
- 54
58
votes
18 answers
Why do computer-science majors learn calculus?
I am curious why computer-science majors have to learn calculus to receive their bachelor’s degrees. My father worked as a software engineer for twenty years and never used it. It seems to have little more value in programming than other forms of…

LuminousNutria
- 659
- 1
- 5
- 9
57
votes
27 answers
How to teach a person to enjoy programming?
I've been teaching programming to my 13-year old son for over a year now. I'm not satisfied with his progress. I think that one of the reasons is his attitude: He wants to learn programming (he said several times that he wants to do something…

Glory to Russia
- 729
- 1
- 6
- 7