Introduction to Programming

Page 1

 

Ah, the joys of computer science. The late nights in the lab, the screaming, the crashes, the frustration, the endless days filled with angst as you try to remember why you got into this in the first place. All the grim stories you've heard are probably true, but so is this: Programming can be fun. Honest. Although computer science takes a lot of work and isn't always a picnic, you can do some pretty extraordinary things with patience, the right frame of mind, and the necessary skills.

In order to acquire these skills, you must first learn some fundamental principles of computer science. Even though I will refer to JavaScript in the following examples, these principles can be applied to almost any language.

When programming, it's always a good idea to think of the program you want to create in terms of its solution. In order to do this, you must have a pretty solid understanding of the programming language that you'll be working in and what you can do with it. Then you should sort out what exactly you're trying to accomplish. What do you want your program to do? What problem is it solving? Next, divide the program into its various components. Then decide how those components will fit together to execute the program. Once you have all this sorted out, you can write each part of the program and put them together. Some of you eager beavers might want to start coding right away, but this can result in a messy program and lot of frustration for you down the road. If you don't plan ahead, you won't have a clear idea of what exactly you need to do to complete the program, and this can lead to a lot of mistakes. Establishing this type of process from the get-go is important because it makes it easier when you need to tackle more complex problems.

In addition to your overall approach, there are also a number of common concepts and commands that are used in every programming language, and mastering them is your first step. Let's start with variables.

BreBru.com Information Technology HTML