Hello! - Welcome to the Path to Programming; the audio supplementary materials for introduction to computer science! - I am a former student that took this introductory course and today I want to talk to you about the skills you need to make the best of this class. - Learning computer science can be challenging for many reasons. It’s almost like transporting yourself back to elementary school to learn math or writing for the first time because the concepts are new and you’re going to be expressing them in a way that is probably not familiar to you. So you really want to familiarize yourself with the programming language. - In this class you will be using Python, but this goes for any programming language. An easy way to start familiarizing yourself with Python would be to memorize the available commands. - Every programming language has a vocabulary of built-in commands that you'll need to learn to use, because you will be using them very often. The built in functions that you might end up needing are: max (finds the of the several items that has been passed into the parameter), min (finds the smallest number that has been passed into the parameter), int (takes any number, or a piece of text that spells out a number, and gives back an integer), float (takes an integer or string that spells out a decimal number and gives back a floating-point number), len, str, round and print, input (Entering a print statement and the user can enter an answer) and more! Make sure you understand what each of these built-in functions do and make sure you know when to use them. - For example you could use max along with len to find the length of the longer of two pieces of text. - We will get more into the specific uses of the functions but what’s important for now is that you know what these built in functions are called and what each function does briefly. Understanding the built in functions ties into understanding data types and what operations to use with them. - A data type is something every value in python has. It basically describes what kind of Knowing the type of data can help you choose the right operator. - There are four basic operators in Python these are +(plus), -(minus), %(remainder), *(times) and /(divide). - They don’t just act like the mathematical operators we know, because they interact with different types of data differently. - For example the plus operator can be used to concatenate (combine) strings. - One thing that I didn't pay enough attention to in the first few weeks of learning how to code was the memory model. The memory model demonstrates how a program would run and how assignments happen when you declare a variable. The memory model explains how the computer works when your program runs. - The first few weeks it seems really trivial to use the memory model but this is actually the perfect time to get acquainted with it. It’s important to use the memory model because programming has a lot of variable assignments that occur. - Another skill that you'll need to build up is working memory to hold several variables in your mind at once and understand how a sequence of several instructions will operate on them. Understanding your variables and what values they hold can help you understand how your code runs as well. - But variables aren't the only thing we use in Python. We can also just write expressions to calculate values, and we don’t need to assign them to a variable. The reason we use variables is to make sure that they are stored in the memory, so that we can access them later on without having to write the whole statement over again. - And obviously understanding what you’re doing with each line of code is one of the most essential parts of programming. There are so many things you will learn throughout introduction to programming and understanding what each function does, whether you define it or it’s a built in function is essential for you to be able to write code that not only works but is also efficient. - Everything we talked about so far is more so on the side of understanding the basics of programming. - We touched on understanding the programming language, important features of the language include built in functions and user defined functions. - If you really get to know the functions then you will know which operations to use with them. - Another thing we touched on was making sure that you understand each variable you declare, know how to follow the statements you are making and an easy way to do this is by using the memory model. - But coding is not just about the programming language you use, it’s also about you, the user, and how hard you work beyond the computer screen. - An essential part of learning how to code is having good teamwork skills, including the ability to ask questions about what you don't know, and the ability to answer questions gracefully and learn from the process. - The biggest advice I can give you as someone who previously took introduction to programming is to never be afraid to ask questions. It’s easy to think that the answer to your question is obvious, or that it is not the most complex question of all time. But those things do not matter, if you are curious about it and you have the opportunity to ask it, never pass up on it. That’s why your instructors are there for you, they want to answer all your questions no matter how big or how small. - Learning something from scratch is always hard, so never doubt the validity of your questions. The more questions you ask the easier it will become for you to answer the questions that you or others have. - Beyond asking questions a very important part of intro is team work. Working in a group is often a great opportunity to see the way other people view the process of coding. You can always learn something from your partner or teach something to your coding partner without even realizing it. - Maybe the way you think about the memory model is different then your coding partners and you can really help them understand things more clearly with how you think about it. Or maybe your partner is really efficient about when they use their variables after executing a bunch of statements. - An important point to remember is not everyone is at the same level even if it is an introductory class, so never feel discouraged if your coding partner has more experience, or has a different approach then you. At the same time, if you end up feeling like your partner doesn't understand things, instead of trying to go ahead and solve things on your own, take the time to explain things to your partner. - The best way to learn something is to teach it, and in the process, you'll find that you will be able to build more solid foundations for your own understanding, even if you are explaining a concept that you feel is pretty "basic." Finally what will help you the most during this class is to have strong planning habits (for example, writing documentation and comments before writing code). - Commenting is often a part of programming that the user can easily neglect because when you understand a problem and how to solve it you often don’t feel the need to explain how you've gotten there. But not everyone has the same thought process or problem solving process, which is why it is very important to describe exactly what you are doing, so that the purpose of your code is understandable in every way possible. - As a plus, explaining your process and plan using comments and documentation before you write your code will help you reach a correct solution more quickly and will help make sure you understand the problem that you're trying to solve. - Besides having generally good planning skills make sure that you have the most clear and effective approach, by applying the key case based problem solving steps. The problem solving steps are simple and they include: 1. Before attempting to solve a problem you really have to understand what the problem is asking for. 2. Before trying to code something from scratch, think of a way to solve the problem and how you would approach it yourself if you didn't have a computer. That's the hard part, figuring out how to solve a complex problem, the easier part is telling the computer what to do in order to solve that problem. 3. If you’re struggling to solve the problem on your own, gather relevant examples that can help you. If there’s a similar problem that you solved in class go over what the idea behind it was and look at the code to see how those ideas were implemented in the code. - Don’t only look for the similarities of the current and previous problems but also look for differences and try to understand where these differences are coming from. This is why understanding the built in functions, and understanding variables is important because you as the programmer will determine what tools you need to solve the problem. The more you understand the functions the easier it will be for you to ‘diagnose’ what you need. This way it will become easier for you to propose a solution to the problem. 3. Program your solution (Write down the instructions in computer code. You'll need to exercise your knowledge of a programming language to understand how to translate your steps into steps the computer can carry out.) 4. Test your program to make sure it works (Use your examples from step 1 and see if the program behaves correctly.) 5. Fix your program (If your program doesn't work, or only work sometimes, first figure out exactly why, and then decide which step you need to revisit. - Sometimes you just need to tweak, other times you need to go back to step 1. But don't worry, your incorrect work isn't wasted: it has already helped you build a deeper understanding of the problem that you're working on.) - If you can follow these problem-solving steps in order, you should be able to solve a wide range of different problems, and as you learn more and more about specific functions and language constructs, you'll be able to expand your vocabulary and keep solving more and more difficult problems. But if you develop bad habits and try to jump straight to a solution, you may find yourself getting stuck a lot or spending a huge amount of time to solve problems as they get more complex. - Pay attention to all of the basics we've discussed here and the process of learning how to program should go smoothly!