Flag This Hub

Basics of Computer Programming

By


Basics of Programming for Beginners

Computer Programming affects our daily lives. Many people use computers on a daily basis, all of the programs and applications we use on the computer to do different things are made possible by computer code. Computer code is basically what makes up a software program. We use software programs to do everything on a computer from writing a paper (Microsoft Word) to surfing the internet (Google Chrome). In order to write a computer program you have to know a computer language. Also you'll need a computer code editor and compiler for that specific language. When you write a program you write the code in what is called an editor. Basically an editor is kind of like a blank page that you write code in.

Then once you are done writing the code for your program you test it out. Basically when you run your program something called a compiler assembles you're code and then spits back out the finished product. A compiler is kind of like a factory that assembles your code and turns it in to something. The hardest part about first learning how to program is remembering all the syntax for a language. Each computer language is different and unique in their own way. The words and phrases used in each programming language are different. However sometimes programming languages are familiar similar. For example Visual Basic.net and Visual Basic in Excel are extremely similar. Computer programs are basically massive algorithms. An algorithm is an order or process of steps. Algorithms are just ordered instructions. For example how would you make a peanut butter sandwich? First you would go get two slices of bread, second you would get the peanut butter and a knife, and third you would get a plate to put the sandwich on.

Then you would take the knife and dip it in the peanut butter. After you did that you would spread it on the slices of bread and then finally put the slices of bread together. I just listed all the steps to make a peanut butter sandwich in order. An Algorithm is the same thing, just a bunch of steps in order. As I mentioned earlier there is something called computer language syntax. All this means is what phrases are used in the language. For example in Visual Basic a line of code might look like this (Dim sportsnumber As Integer). In Visual Basic Dim means Dimension, which means you are declaring a variable. Variables are probably the most important thing Variables are letters and phrases that represent a value, it's the same concept in Algebra.

In fact programs contain a lot of algebra as well trigonometry, and calculus depending on what you program is going to be used for. Earlier I talked about dimensioning and declaring variables. All this means is that you’re letting the computer know what you variable are named and what type of variable it is. There are several types’ variables in most programming languages and they are integers, strings, and double variables. Integers are numbers that don’t have any decimal places. A string is a variable that has letters in it (For example "hello world" would be a string. Basically it’s a just like it says a string of words or letters together. A double variable is a number that has decimal place (an example is1.0023). The reason why variables are so important because when you program it’s easier to represent numbers with specific names. For example If I have a team of 13 people and easy way of showing that is (numberOfpeople = 13). Also when you create a variable make sure that it is one word, you can join words together using underscores, but they can't be separate.

When you program you will often put variables into something that is called a function. A function in programming is a function just like in algebra; you have variables that represent numbers in the function. You input the numbers that correspond with each variable and then a product is produced. An example would be (a = 10, b = 5, x = a * b, 5 * 10 = 50, x = 50). Functions are used all the time in programming, specifically when calculations need to be performed. Another important aspect of computer programming is logic. Logic is used to follow the steps in a program. For example in a program in order to complete a step you might need to see if another step was completed. In programming there are "If statements", if statements are what allows us to implement logic in a program.

An "If Statement" is something that determines if a condition has been met or not. For example If the value of variable A is greater than the value of variable B than a certain action would happen, if variable A was not greater than variable B than another action. That’s all programming logic pretty much is, just comparing things to each other. Now I know I've just bombarded you with a lot of information, but hopefully you understand a little bit more about programming. The best way to learn how to program is to look at examples of code and then try it out. Programming is kind of like a love hate relationship. When the code you write for a program works it’s great, but when it doesn't work it can be very frustrating. Just keep trying and stick with it. Once you've finally got your program to run and work properly the feeling is great. Also it doesn't hurt to get a few books to help you along the way. There are free online tutorials as well. You can find lots of books on programming on sites like amazon.com. Hopefully this article was of some use to you and good luck with learning how to program. Just remember to keep plugging away at it and the programming will start to come to you. It may be frustrating at first, but if you continue to learn and push yourself you will have success.

Comments

No comments yet.

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    Like this Hub?
    Please wait working