All Questions

169
votes
27answers
32k views

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 ...
117
votes
13answers
43k views

Should I teach that 1 KB = 1024 bytes or 1000 bytes?

Which conversion should I teach to my undergrad students? That 1KB is 1024 bytes (binary) as everyone learned back in the nineties or the recent industry-led "friendly" conversion that says that 1KB ...
103
votes
21answers
25k views

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: ...
101
votes
14answers
35k views

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 ...
84
votes
26answers
24k views

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 ...
72
votes
18answers
18k views

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 ...
69
votes
8answers
16k views

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. ...
64
votes
21answers
13k views

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, ...
59
votes
10answers
24k views

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, ...
55
votes
24answers
18k views

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 ...
55
votes
23answers
10k views

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 ...
51
votes
27answers
17k views

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 ...
51
votes
15answers
15k views

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 ...
50
votes
19answers
11k views

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 ...
50
votes
8answers
16k views

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 ...
49
votes
9answers
7k views

What are healthy, productive ways to encourage students to progress to more advanced constructs as opposed to staying with the familiar?

In my experience, there are always students who are resistant to moving to more advanced constructs. They want to stay with what they already know. For example, when they are taught arrays, they ...
49
votes
13answers
7k views

Interesting Programming Exercises to Teach Inheritance?

I originally asked this over on Stack Overflow, but they suggested I look here instead: I'm currently teaching my students about the concept of inheritance (we're using Python 3) but am unable to ...
45
votes
9answers
14k views

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 ...
44
votes
11answers
25k views

How bad is a Computer Science course that doesn't teach Design Patterns?

I'm at final year of my graduation in Computer Science in Brazil. The university that I study is one of the best in the country and my passion is for Software Engineering. It disappoints me, in ...
44
votes
15answers
15k views

What advantages do students who learn how to touch type have?

Would a student's overall CS education benefit by having such a skill, and if so why not make it a required prerequisite? An editor notes that there are three (at least) different ideas here that ...
41
votes
11answers
10k views

Why don't more universities teach revision control?

In the answers to this question, it's suggested that one of the most common things that CS graduates still need to learn to be employable developers is revision control, and by inference that many CS ...
40
votes
18answers
11k views

Is it important to teach pointers in a first course using Java?

Many instructors teaching with Java started their education using earlier languages such as C or C++ in which pointers are essential. Pointers, however, are not a Java concept, though those same ...
38
votes
16answers
7k views

Is there any value in teaching goto statement or flowcharts?

I was recently reading a new, and mostly excellent, magazine Hello, World. There is an article on teaching goto. The author states that there is value in teaching <...
37
votes
20answers
8k views

How to teach the value of the command line in high school?

Part of what I love about the particular adaptation I use for AP CS Principles — CS50 AP — is that my curriculum teaches students basic Linux shell commands in the Cloud9 IDE. Students learn things ...
37
votes
11answers
12k views

Learning fundamental differences between functional programming and Object Oriented Programming

I've been trying to learn the differences between Functional Programming and OOP, but I can't seem to find a comparison of the two. A Google search did not yield any chart or table showing such a ...
35
votes
15answers
13k views

How to help students avoid being distracted by bells and whistles

I teach Windows Forms programming, and now ASP.Net (essentially the same thing, except you view it in a browser) and I am dismayed that students seem to spend an enormous amount of time straining at ...
35
votes
28answers
3k views

Analogy for teaching recursion

When teaching recursion, what is the best analogy people use to teach the idea of recursion. There are some nice artistic representations And the idea of repeatedly cutting a phone book or ...
35
votes
14answers
11k views

What is good age to start learning programming?

I am thinking of offering classes for people, maybe take 5 to 10 at the time. There would be 4 hours every Saturday, twice a month, for three months. So in total 6 such sessions. The language thought ...
34
votes
13answers
5k views

Teaching the humble for loop

So, in C-style languages, the for loop has a funny little syntax: for (int i = 0; i < 100; i++){ // do something } If ...
33
votes
13answers
3k views

Real life examples of 0-indexing

It can be perplexing for students to begin counting at 0 when they enter a CS class. I made it a point over and over to talk about "Day 0" and "Week 0" in the opening days and weeks just to build ...
33
votes
6answers
6k views

How do I convince students to use Boolean algebra?

I have taught Boolean algebra in an upper-level discrete math course for CS majors. I showed them how, using just the axioms (distributive property, etc.), you can derive other properties (such as De ...
32
votes
7answers
3k views

How to teach Stack Overflow more efficiently?

As evidenced by the numerous poorly asked questions by students on Stack Overflow, it is clear that many students have difficulty understanding how to ask questions there. Even as teachers, we often ...
31
votes
16answers
3k views

Teaching binary encoding - using different symbols

I'm teaching some introduction lessons to a classroom of 6-8 year olds about basic 21st century skills. A fundamental part of this is how computers represent numbers, words and images, which all ...
31
votes
9answers
7k views

How to prepare students for bias in industry

I teach at Mills, a women's college near Silicon Valley with a high number of students of color. We do a great job of preparing students technically -- they do very well on the job market and then in ...
30
votes
11answers
8k views

How can we teach good naming practice for students learning Java?

In writing software we name things. In Java we name classes, interfaces, methods, variables, etc. How can we teach both the importance and the skill of choosing good names? What teaching practices ...
29
votes
13answers
2k views

How to teach why indentation is important

I'm trying to teach why indentation is important, but the student doesn't indent. I asked why he doesn't indent, then he answered "That's because it’s a hassle." It's OK to say "you should indent", ...
29
votes
11answers
6k views

How to handle students who excel at coding but aren't interested in theory

There are some students who are very good at coding. They can crack any logic problem at their level. But they aren't very good at CS theory. They can code better than their classmates, but they're ...
28
votes
14answers
7k views

How do you encourage students to take criticism of their code constructively?

How do you encourage students to benefit from code reviews you give them, rather than being discouraged or responding defensively?
28
votes
18answers
11k views

How to explain what code is to my parents?

I am an engineering student in computer science and recently my parents asked me to explain a bit what I do, which is their way of asking "What is coding?". They have no idea of what coding is, what ...
28
votes
9answers
3k views

Should test cases be made available to students for assessed assignments?

A number of the assignments I've completed during the course of my undergraduate degree have been assessed partially using automated tests. These have never been available to students prior to the ...
28
votes
7answers
5k views

Assisting students with large programming assignments takes too long in class

In university, I was a student in an operating systems programming course in C. Assignment help was offered in tutorials. Students would usually present the tutor(s) with run-time errors and an ...
28
votes
11answers
8k views

How to stop being The Oracle

When I did customer service for an application I was developing, I found that most of the time, if I did NOT answer the phone, the user would figure out their problem and learn more than if I did ...
26
votes
21answers
12k views

Teaching students that printf() is not the same as return

For a few years, I have been teaching a programming class to first-year electrical engineering students -- thus, this is their first contact with computer programming. The language used is C (although ...
26
votes
14answers
13k views

How do I convince my students that visual programming is real programming?

I have been considering taking a visual programming language, such as Snap!, to my high school students as a way to make some of the concepts we delve into a little more fun. The kids themselves ...
26
votes
13answers
4k views

How do I teach “math equality” vs. “CS assignment” vs. “CS equality logic operator”?

Consider the following three uses of equality: In mathematics, the statement $x = x^2$ In Python, the statement x = x**2 In Python, the expression, ...
25
votes
14answers
16k views

When a student submits a work that is a copy from a colleague, should you also punish the student that made the work?

The question kind of says it all. Imagine that for an assignment you receive two or more similar submissions (e.g. programs). What will you do? Annul all the works? What if you know for certain who ...
25
votes
8answers
7k views

How do you deal with Lone Rangers in group projects?

We all have them - students who want to write all the code themselves, who don't want to be part of a group project. They have poor social skills, or they don't know anyone else in the class, or they ...
25
votes
9answers
5k views

Once implicit/inferred typing is introduced, how can I impress upon students the importance of not abusing it?

I typically have the same students two semesters in a row, for programming I (VB.NET) and programming II (C#). In our early, impressionable time together, I stress to these students (high-schoolers) ...
25
votes
13answers
2k views

How to respond when students ask “is recursion good practice”?

Context: CS1-style, intro programming class, using an interpreted language (Python). I will get a hand raised asking "Why are we learning recursion? Is it good programming practice?" My response is ...
24
votes
17answers
10k views

What does a person with an undergraduate degree in CS still need to learn to be employable as a developer? [closed]

Some recent CS graduates feel unprepared to enter the job market. Some may actually be unprepared. What is missing from a typical undergraduate program, or not sufficiently emphasized, that a person ...

15 30 50 per page