Computer programming for Beginners
If you absolutely love solving puzzles, problems and like challenging your analytical skills, you will surely enjoy dabbling in computer programming. Though we have managed to create efficient high speed computing machines, computer science is yet to achieve its goal of creating an artificial intelligence, a machine which can think on its own. So the machines must fall back upon our 'natural' intelligence, which can supply them with efficient algorithms to carry out tasks. In a sense, programming is thinking for the computer and providing it with instructions to accomplish various tasks. In this Buzzle article, my aim is to provide a road map to computer programming for beginners.
Computer Programming For Beginners ?
There is a range of computer languages with different logical structures, created to write programs for different platforms and purposes. You need to master expressing your logical solution to the computing problem, in different programming languages. While there are more than a hundred languages created to solve different genres of problems, you need not learn every one of them. The core languages - 'C and C++' have to be mastered to be able to understand all other languages which share similarities with them. Other important programming languages which you may need to know are Java, C#, Perl, Python and JavaScript.
Get a computer with a Linux version installed on it. Linux comes with the compilers of all the major languages preinstalled on it. Get a book which can explain you how to code and write programs on Linux. You will also have to get hold of books which can introduce you to programming languages like C and C++ for starters. Understand the syntax and code solutions to simple problems, compile and run them. Learn to rectify errors or debug programs and ground yourself well in computer programming basics.
Get a computer with a Linux version installed on it. Linux comes with the compilers of all the major languages preinstalled on it. Get a book which can explain you how to code and write programs on Linux. You will also have to get hold of books which can introduce you to programming languages like C and C++ for starters. Understand the syntax and code solutions to simple problems, compile and run them. Learn to rectify errors or debug programs and ground yourself well in computer programming basics.
How programs work?
It is very important that you understand at least the very basics of how computers work, because learning any language it is required to know this first. Computers use the processor (CPU) to execute instructions, memory (RAM) to store the running program and hard drive (HDD) to store data and programs that are not running at that time. In order for a program to add two numbers like we did in the previous example, the program must know at compile time and before the program is run, how much memory it should ask for and what it would store there. Computers use variables to do this. Variables are data stored in RAM which can be changed any time while the program is running. In our example, we didn't use variables, but we used constants - plain numbers which can not be changed at runtime. This, you will find, is extremely useless as most of the time we don't know exactly what our program will do.
A calculator would be useless without user input and if it could only add numbers that were already given to him at compile time. Therefore, variables are the primary thing you will get to know at programming. When you run the program we wrote in C, the program knows it has two numbers in it and asks the operating system for space in memory for 2 integer numbers. Integer numbers are whole numbers such as 1, 24 and 1497. Not only does the program have to know how much space it has to ask, but even what type of a variable it will store. Will it be an integer or a character string?
Whenever one uses a program that asks for user input (a calculator for example) it has already made place in RAM for the number one will type in. When you do type it in, it stores it in that place and marks its type - if you type in 33 it will mark it as an integer, if you typed in 3.14 it will mark it as a real number.
Real numbers are numbers with fractions. For example 1.33 is a real number, so is 0.25 and so on. Knowing what type of a variable the program stores, it knows what it can do with it. So if we have real numbers or integers we can multiply them, divide them etc. But we can not do those things with a character string. We can't divide words and letters.
The other major thing to know about programming is that computers can't think. Computers are pretty much useless machines without a human to operate it. The computer does exactly what you tell it to do and nothing more. This, as you have probably notice, doesn't seem true all the time, but it is almost never the computer's fault and almost always programmer's. Computers do not understand numbers, words or any other human-readable type. They can only understand two states; true and false.
You have probably heard that computers work with 1's and 0's but that is not the case. They work with electricity and nothing more. We made up those 1's and 0's to make it simplier for us to understand them. (1's and 0's represent voltage changes).Computers cannot think or do anything useful without someone programming it. They can only compare numbers and nothing else. It is important to know this, so you start thinking as a computer programmer.
A calculator would be useless without user input and if it could only add numbers that were already given to him at compile time. Therefore, variables are the primary thing you will get to know at programming. When you run the program we wrote in C, the program knows it has two numbers in it and asks the operating system for space in memory for 2 integer numbers. Integer numbers are whole numbers such as 1, 24 and 1497. Not only does the program have to know how much space it has to ask, but even what type of a variable it will store. Will it be an integer or a character string?
Whenever one uses a program that asks for user input (a calculator for example) it has already made place in RAM for the number one will type in. When you do type it in, it stores it in that place and marks its type - if you type in 33 it will mark it as an integer, if you typed in 3.14 it will mark it as a real number.
Real numbers are numbers with fractions. For example 1.33 is a real number, so is 0.25 and so on. Knowing what type of a variable the program stores, it knows what it can do with it. So if we have real numbers or integers we can multiply them, divide them etc. But we can not do those things with a character string. We can't divide words and letters.
The other major thing to know about programming is that computers can't think. Computers are pretty much useless machines without a human to operate it. The computer does exactly what you tell it to do and nothing more. This, as you have probably notice, doesn't seem true all the time, but it is almost never the computer's fault and almost always programmer's. Computers do not understand numbers, words or any other human-readable type. They can only understand two states; true and false.
You have probably heard that computers work with 1's and 0's but that is not the case. They work with electricity and nothing more. We made up those 1's and 0's to make it simplier for us to understand them. (1's and 0's represent voltage changes).Computers cannot think or do anything useful without someone programming it. They can only compare numbers and nothing else. It is important to know this, so you start thinking as a computer programmer.