1.1 Getting Started
In this Introduction to Computer Science course, we’ll learn how to use code to write programs that our computer will understand. Let’s first clariy a few terms that will come up along the way:
- algorithm - a set of instructions to complete a task
- programming language - a language the computer can understand
- computer program - a set of instructions, written in a language the computer can understand
You may have heard the term algorithm before, especially if you’re interested in search engines like Google or YouTube and how they decide to rank their search results for their users. These are highly complex algorithms that consider your interests, your past activity and what’s trending to provide you with a set of search results that are relevant to what you’re looking for. In this example, the algorithm is the process that these websites or apps use to determine what results to show you. The task these algorithms complete is finding you the search results that you were looking for. In its simplest form, an algorithm can be the steps to tie your shoes or the steps to make a peanut butter and jelly sandwich. These tasks are hopefully familiar to most people taking this course, and will make the term algorithm seem much less scary.
A programming language will provide the structure and rules for how we write our code. I should also clarify that the term ‘code’ typically comes from ‘source code’, which is the original code written by a programmer that is then compiled (converted) to machine code that the computer can execute. People write source code in many different programming languages, sometimes because a specific language lends itself well to a specific task and other times simply because of personal preference. For example, I can code a web application that runs in your web browser using the JavaScript language. If I then need a back-end component of that app, that runs on a server in the cloud and connects to a database, I might write this component in a different programming language, like C#, because I prefer it for back-end web applications. However, I could also choose to write this back-end program in JavaScript becuase I want my entire app (front-end and back-end) to all use the same language. When working alone on personal projects, this vast amount of flexibility becomes both a blessing and a curse because while it’s great to have so many free tools available for your use, it can sometimes make it hard to decide what tools to use, which leads to distraction and procrastination. To remove this distraction, we’ll keep this course focused on a single programming tool called Snap which provides a drag-and-drop interface for building your first computer programs. No text-based programming language required!
In lesson 1.2 Introduction to Snap, we’ll learn how to create our first computer program.