176

You should teach both, and you probably want to use the binary unit. When you are talking about the difference, it may be helpful to tell them about how to tell the difference when reading them: The SI kilo- is k: $1\ \text{kB (kilobyte)} = 10^{3}\ \text{bytes} = 1000\ \text{bytes}$ While the binary kibi- is Ki: $1\ \text{KiB (kibibyte)} = 2^{10}\ \text{...


169

Lying is good. But advertise it when you lie. Make sure students make a note of it that you are lying. Pedantic is bad. If you try to explain everything you will wind up explaining nothing. Let me take a simpler example. In java we have a special incantation public static void main(String [] args) We put it in every program. It distinguishes a program. ...


139

Actually returning early should be the norm. Return as soon as you can. There are at least two reasons for this, of which the first, efficiency, is the least important. But if you return early then needless statements won't be executed. Nor will you need to devise some special code to get to the end just so that you can return. However, the biggest and ...


95

Actually, there are a lot of things that benefit a student in CS, such as a degree in Mathematics or Sociology. Likewise interpersonal skills that help a person work in groups. Others are too numerous to mention. However, a true prerequisite is a block, preventing advancement if you don't have the skill, so no, it should not be required. Some data points....


89

I would start sentences with "Generally speaking..." and I would appreciate if my professors did the same. It hints that there is more to know but doesn't waste time explaining anything further. If your students are curious enough they can raise their hand to inquire. If it takes too much time to explain during class and someone wants to know, you can offer ...


58

This is a vital question, perhaps the vital question, for a CS educator to deal with, because technologies will keep pushing us. There is no end to this particular merry-go-round. I have been stuck, non-stop, in exactly this situation, for the last four years in a high school for gifted students, and I can attest that it is physically, mentally, and ...


57

You should teach them it's messed up beyond repair, and it's their generation's job to teach the next generation to use the silly-sounding standard prefixes, so that when they finally retire (and the current old-timers are more permanently removed from the argument), there can finally be a consensus. As the matters currently stand, all the prefixes are ...


53

Show then how the loop can be unfolded into a while loop: int i = 0 // Step 1 while (i< 100) { // Step 2 // Do something i++ // Step 3 } Explain that the order is derived from that unfolding. You could start out by only teaching while loops, forcing them to make these while loops with iterators, then showing that for loops are a condensed of those ...


51

Actually, you need to teach them both so that they are warned that the usage is not consistent. Then you can choose one as a standard in your course going forward. Which you choose depends a bit on what you are teaching. If it is how to evaluate hard drives, etc. then $K = 1000$ works now. For most programming, however, $K = 2^{10} = 1024$ is probably best....


48

Teach your students about the return early philosophy. Teach your students about the single return philosophy. Tell them this debate is not settled. Explain to them that different software development teams have different opinions and different standards, and that it's important for them to have both these tools in their toolbox for their jobs. Explain the ...


44

Learning about references is important, but I don't feel that learning about pointers is that important for beginning Java students. Certainly intermediate students will need to understand them. When I started learning about pointers, I had a hard time grasping them at all until I learned assembly language. Once I learned assembly (for any processor), ...


41

Please don't... ...give the students who are ahead more of the same kind of work to do. Please. That's just boring. If they get it, they get it. ...make groups by mixing the students who are ahead with the students who are behind - often, the students who are ahead won't teach the behind students, but will just do the whole thing themselves. I say this from ...


38

This is really a separate approach from my first answer, which has received some push-back. It's worth noting that many of these loners are simply students who are substantially ahead of the curve. One way to really want to engage such students in pair programming is to pair them with each other. This will create something of a Dream Team. Give them the ...


38

To answer the titular question: In my experience, the advantage of touch typing is not the direct gain of time through typing faster. That’s negligible since most programming and writing tasks involve much more thinking, researching, etc. In my experience, the advantage is due to touch typing working directly through your muscle memory¹ and not requiring ...


34

As a current CS student, my lecturer use to solve this by simply using For now. To come back to your interface example: For now, interfaces cannot contain any code, unlike abstract classes. This gives a clear message, there is more to the topic, but it isn't relevant at the moment. When students ask you can always elaborate a little bit, but for the most ...


29

The best way to deal with this kind of student is to head it off at the pass. If you can get the student at the beginning, you can often prevent the problem from festering in the first place. I have a student coming in next year who I have already been warned will have this problem, and I plan to show this to my class on the first day: I will then say ...


29

For a beginning course: no. I have helped clarify behavior for fellow students who got lost by an instructor who explained things in terms of pointers. I have programmed in C, and most of my current programming is done in Rust; I understand pointers and what problems they are best suited to solve. But in Java, you don't have any access to pointers, so ...


29

Is it a wrong approach, giving your students the choice? Or is it wrong to force them never to return early? This is a false dichotomy. Sometimes multiple returns are clearer, and sometimes (rarely) a single return is clearer. You should encourage ("force" is a rather strong word) your students to use the technique which makes the most sense for any given ...


27

Fair warning, I do not demand any particular naming convention (such as NetBeans) from my students. This leaves me with variable naming only for the purpose of clarity. I speak constantly to my students about the two different audiences for code: the computer itself (which is the one kids naturally think about), and other is human beings, which students ...


27

If the goal is to prepare students for "the real world," aka "real jobs" then: Touch typing is required to be an effective programmer. Full stop. The answers here seem to highlight the difference between theory (academia) and professional work. Under no circumstance would I hire or tolerate a programmer that couldn't code without looking at the keys.* It ...


24

I teach for loops using the following pseudocode, which we then translate into actual code: for (initialization; condition; update) { statement; } This logic helps justify why the order goes 1, 2, 4, 3 to start. I explain it as follows: a variable can only be initialized once so it happens first and never again. After that the variable is tested ...


23

Neither is better. What is true for one student may not be for another. Studies can show trends. Students are not trends; they are individuals. As an example I encountered today that seems to go against that wisdom, I caught a news piece about a local girl in the Scripps National Spelling Bee. As she spelled the word she was moving her fingers in a weird ...


22

If I catch it quickly and can easily explain the error, I use it as an example of failing up. "Ooops, look at me, here's my mistake, here's how I can learn from it." If students catch it, and I'm not immediately sure who is right, I make a note to do some research and come back to it in the next class. If I don't realize it until class is over, I make sure ...


21

Scratch is a visual block-based drag-and-drop programming language designed specifically for learners, especially children. It's created by the Lifelong Kindergarten Group at the MIT Media Lab. The language and IDE are pretty much completely connected. Here's how I see it checking off your bullet points: Object oriented: It has sprites, but it's debatable ...


21

I would consider teaching in Python if you wanted to give your students a taste of programming in a text-based language—pretty much the only type of language used professionally. A visual programming language like Scratch is probably better for younger groups, and teaches the underlying programming concepts well, but you will reach a point where you must ...


21

I have 3 tiers of labs. First are the required labs. They're worth 100 points each and every one must do these. If they don't do one, it goes in the gradebook as a zero. These are also the labs that I think are the best of each topic for practicing what they need to work on. My calendar is based on how much time I expect 90 plus percent of the students need ...


21

I know I'm coming late to this party but this is a really good question and I think it deserves a really good treatment. The original for loop, the one with the semicolons in it, is amazingly flexible, powerful, and confusing as all get out. It is seldom taught well, it is a very easy place for bugs to hide, and it is not going away. To master it you must ...


21

The difference between providing your students with a proper discussion of this topic, and simply teaching them one or the other, is the difference between being a real educator and being a reciter of factoids. If there is no single correct definition of KB for you, then why would you instill something different in your students? The answer to your question ...


20

I don't believe that your question is entirely valid; some languages require jumping. The first principle, therefore, is to follow the norms of your language. However, I suspect that you are asking about languages that discourage (but do not ban) jumping, such as Java, or C++. In these cases, I agree with Peter that the solution is to give them the ...


Only top voted, non community-wiki answers of a minimum length are eligible