The Stack Overflow podcast is back! Listen to an interview with our new CEO.
165

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


138

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


87

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


57

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


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

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


37

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


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


27

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

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


26

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


23

I am currently a student in a computer science bootcamp learning js, C# and asp.net mvc5. For what its worth, I appreciate the honesty when my instructor uses crossed fingers.(He will pause to cross his right and middle finger and prominently display them in front of him before/while continuing with a "fuzzy truth") I will treat knowledge given to me in ...


22

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


19

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


18

There are at least two parts to teaching naming. The first is to have a good standard that the students know and understand. This can be provided in a checklist. But the more important aspect is to always demonstrate good naming in all examples that you use and in all quizzes and exams that you give them; even for very simple exercises. The Naming Standard ...


17

unlike abstract classes, interfaces generally do not contain any code This is not a lie. In a large lecture hall, if they ask for "when do they contain code", say "that will be covered in another class" to avoid going off on a (possibly confusing) tangent. This is neither lying, but it is glossing over details. There are situations where lying is a good ...


17

Short answer no, but it can be useful. Long answer CS is not just Programming. It has other parts also. Programming is not typing This has been said already, programming is mostly thinking. As an example of my real programs, in industry. Here are my top examples of code that I have written in lines of code: 3 lines of code in 2 weeks. Non cryptic ...


16

I recently had a group of students that didn't take notes at all. They were in University classes and no one, apparently, had taught them how to learn. I asked one student why, and he just pointed to his head - it's here. But of course photographic memory isn't true for all but a vanishingly small proportion of our students. In order to learn something you ...


15

No Because of the way that you learn, you think of them as fundamental, to the way references work. They are not. References do not have to work this way. [I would still agree that pointers are fundamental to understanding memory in Von Neumann / Harvard architecture.] Java uses references. You can think of these as being pointers, that must point to a ...


15

I'm going to begin by quoting Ken Thompson's Turing Award Lecture "Reflections on Trusting Trust" (link). To what extent should one trust a statement that a program is free of Trojan horses? Perhaps it is more important to trust the people who wrote the software. In my mind the first and most foundational lesson to impart is this: software, computers,...


14

Mistakes are fine. We are human, we make mistakes. In fact, one of the worst things you can do in teaching is to never make a mistake and to always say exactly the right thing. This is pretty much guaranteed to reduce the fraction of students who actually learn. A lot of things in CS need to be approached from various, more or less accurate, directions, ...


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