--- title: Learning Programming tags: Documents-F22 --- # Learning in CS0111 There's a lot of research on how people learn, both in general and in CS (in fact, Professor Kathi's research specialty is computing education). Learning CS is a bit different than in other disciplines, so here are some guidelines. ## Learning in Lecture and Lab Lectures in the course will involve a fair bit of hands-on activities and discussion. Learning happens when someone is actively thinking about material and making connections between new material and already-known material. The lectures are designed to facilitate this, but you have to meet us halfway to make this work. In particular, you are expected to participate in small group discussions as they arise during lecture. Sharing ideas on problems helps both you and your classmates (in hearing and responding to ideas of others, you strengthen your own conceptions of material). Similarly, when we share out ideas from small groups to the class, talk and respond to each other, rather than expect the professor or staff to mediate. We'll hop in if we think a point is being overlooked, but we want to encourage discussion within the class (again, because this is how you'll learn the material better). In part, this means that reading notes and watching lecture capture will only get you so far. We provide these as tools for reviewing content or catching up if you have to miss a day here and there, but they will not be good substitutes for being in class and participating in the activities and discussions. ## Learning to Program Learning to program involves developing several skills. We present this list not to overwhelm you, but to help you manage your learning. Each of you will find some of these skills easier to master than others. Paying attention to which skills you’ve mastered and which need more practice will help you focus your time and efforts in the class. - Writing computations in the structured and precise notation of a programming language - Understanding how the computer evaluates/runs programs in a given programming language - Breaking down problems into individual steps that you can express in the programming language, then combine to produce a program that solves the give problem - Reading existing programs (your own or others) to understand how and why they (don’t) work - Locating and correcting errors in programs - Communicating the design and intent of your programs to those who may read them later - Testing that your program does what it is supposed to do One takeaway from this list is that **we're doing more than "writing programs that run"** in CSCI0111. We're teaching you how to develop robust programs and computational problem-solving skills, so that you can effectively apply what you've learned outside the class. ## Learning Tips ### Write code, don’t just read it Learning to program involves internalizing the patterns within code: what statements are needed, where do they go, what statements are used for which tasks, etc. When you have internalized a code pattern, your brain can retrieve and reproduce it when you are given a similar problem to solve. You internalize code patterns by actually writing them down, not by reading them (writing and reading exercise different processes within the brain). This is also important because the order in which we write lines of code and the order in which we read them tend to be different. You need to practice each skill (reading and writing) independently. ***Tip**: When we cover new programming concepts, the notes will often list some additional practice problems. Try a couple of these to help your code writing come naturally, without your having to look back on your notes.* ### View CS as learning processes, not facts In some courses, you basically need to learn a bunch of facts and formulas and when to apply them. Programming is different: much of it is about learning a process of creating something or solving a problem, not about memorizing stuff (there’s a bit of memorizing stuff, but memorizing isn’t enough). Don’t expect to learn the material by reading it over and over. Instead, work on learning the steps we take and the questions we ask to make progress on problems. This goes back to the previous point: you won’t learn CS just by reading. ***Tip**: As you study, try to articulate the steps that we took to solve each problem. Don’t just try to memorize solutions.* ### Take time to plan code and understand problems Many students who are new to programming assume that the fastest way to finish an assignment is to just sit down and start writing code. While that will work on some easier problems, it often fails horribly on later assignments. Coding productively requires you to understand what the program needs to do, to identify the steps involved in performing the computation, and to write code. In our experience, jumping to the last point when you don't have a firm grasp on the first two makes assignments take longer. Take time to use the techniques we will show in class (planning and writing examples) to get your high-level understanding in place before you write the actual code. ***Tip:** Write plans and examples for problems. Ask us to check that they are consistent with the problem statement before you start coding. Both of these intermediate steps have you demonstrate concretely that you understand the problem at hand. Writing them also helps us help you more effectively in office hours.* ### Manually simulate how code runs on paper We understand concepts by building models of how they work. Think of a model as a high level map that helps you see how the various pieces of a problem fit together and evolve over time. If you develop a model of how programs work, for example, then you can use the model to understand and predict how new lines of code should fit into the program. Models are also important because they can break a larger problem into the sub-parts that you need to understand to make sense of the whole problem. Working through models can help you (and us) figure out the actual part of the problem on which you are stuck. ***Tip**: We will show you various models of how programs work and how data ties together. Practice using these models for specific programs, until you are confident that you understand how your programs run. Bring your models to office hours if you aren’t sure about how they work. Working with the models targets the low-level building blocks of learning to program.* ### Don’t believe in a "geek gene": you can learn this with practice People often believe that programming and computer science is something that some people are "born" to do while others are not. At this level, this idea is false. It is true that different people absorb the techniques faster than others, but that doesn’t mean that only those with the "geek gene" can do well in CS. Approach CS as something that you can learn with practice; don’t tell yourself "I can’t do this because I’m not a CS person". There’s much interesting research on something called mindset: very roughly, it says that if you assume intelligence is fixed rather than flexible, you engage differently with material. ***Tip**: Don’t fall into the trap of thinking that you can’t learn this. Some of your classmates have programmed before. Not surprisingly, that means they are better at it than you are right now. That doesn’t mean that you can’t learn to do this too. Work with the practice problems and the course staff.*