What Is Programming? A Guide to Computer Programming
Computer Programming had gained major popularity in the last 3 decades. The number of people opting to learn code are increasing with every passing year. An estimate of 26.2 million software developers account for a career in programming in major software companies. It is this increasing trend that today many students strive to opt for Computer Science as a stream so that it puts them in their dream tech company like Google or Facebook or Microsoft or Apple and so many more.
What is Programming?
There are lots of definitions for programming but let us just take some simple ones. As per a definition,
Programming is a way of instructing the computer so that it performs various tasks.
OR
Programming can also be called a collaboration between humans and computers.
OR
Programming is how you get computers to solve a problem.
In layman terms, programming is...
Instructing the computer: Basically, this means that you would provide the computer with a set of commands (instruction) that are written in a language understandable by the computer. The commands may be like:
Add 2 numbers, round off a number, and so on.
Just like we humans understand some languages such as English, Hindi, Spanish, French, among others, computers are no different. Computers understand instructions written in a 'programming language'.
Continuing with the above, the tasks could be simple (like add 2 numbers) or complex, which may involve a series of multiple commands where it performs various tasks at once.
For example:
- Calculate simple interest, given the principal, rate of interest, and time period. OR
- Calculate the average return on a stock in the last 10 years.
These 2 tasks cannot be expressed using simple instructions like add 2 numbers, and hence, involve complex calculations.
Programming is everywhere!
If you look around, you are literally surrounded by programming. From the things that you order to the movies you stream, it is coding that enables these everyday actions in your life. Tech companies, now, are not just software companies that employ software developers to make complex software programs. Rather, they bring food and groceries to your door, help you get a taxi, act as a personal trainer, and basically almost everything that a normal person does in a day.
But by now, you might have an obvious question why would you need computing programs for as easy a task as adding or rounding off numbers? Even calculation of simple interest might seem easy that even an 8th grader would easily do such things. So, what is programming used for?
Benefits of Programming
1. Computers are quick
If you know the proper utilization of computer programming, you can achieve wonders with it because computers are amazingly quick. For a normal computer today, it hardly takes a nanosecond, yes NANOSECOND, for the addition of any 2 numbers. This means that a computer possesses the ability to perform a billion additions in just 1 second. No way a typical human could ever do it? Thus, programming speed in computers offers great effectiveness.
2. Computers are cost-efficient
Consider yourself to be a stock market analyst, and now you have to monitor the data pertaining to 1000 stocks so that you are able to trade them quickly. Can you imagine the hassle that would be created if you are to do it by hand! Obviously, it sounds impractical. Another alternative may be that you hire people so that more stocks are monitored at a time. But this would mean a significant rise in your cost. Further, there still exists the problem of human error. And hence, you may end up losing money. However, with computers, you could have processed huge amounts of information quickly and reliably. Mere 1000 stocks are nothing for computers of the 21st century.
3. Computers can work 24x7
Humans are bound to fatigue, but computers have the capacity to work 24x7 with no exhaustion. So even if the task at your hand is big, it won't be big enough for the computer and you can allocate it to the computer without any worry.
Why you should learn Computer Programming?
As mentioned above, computers understand a specific language called the programming language. A programming language is a way for programmers to express a particular task such that a computer understands it and executes it. Some popular programming languages include Python, Java, C, C++, PHP, and so on. Now, after you know so many things related to programming, the big question that still remains is 'Why should you learn Computer Programming?'
1. The backbone of a tech company
The trending technologies in companies like Google, Microsoft, Facebook, Amazon, Apple, and the like, are giant computer programs written due to the collaboration of 1000s of skilled programmers. Having this skill for programmers along with the right business acumen can help you in creating the next big tech company.
2. Good salaries
Computer programmers all over the world are paid very well. People at top programming positions in Silicon Valley are making millions of dollars each year. Starting salaries offered by quite a few companies are as high as up to USD 1,00,000 per year.
3. Programming is fun
Using the programming paradigm, you can create games on your own, create your personal blog page, or create a networking site such as Facebook, and so much more. Won’t all that be fun? Imagine yourself creating your own games and putting them up on the play store and getting thousands of downloads for them!
A step-by-step guide to writing your first program
Let us start with an actual program of Python code now.
Python is not one of those hardest programming languages and is one of the most widely used languages. This is because it is extremely easy and beginner-friendly.
You may download Python here: https://www.python.org/downloads/. After you have downloaded it, run the installer to install Python on your device.
Then, open your favorite text editor (we would recommend Sublime Text) and there copy-paste the following 3 lines:
Save the file on your desktop named as my_first_program.py
Now, do the following (depending on your operating system):
Windows: open command prompt and type python my_first_program.pyUbuntu/Mac OSX: open terminal and type python my_first_program.py
Now, press enter. Almost instantly after pressing the enter key, you would see the following:
Wondering what that is? That is 548, which is computed by just your programming basics in the blink of an eye! A typical human is likely to take minutes, if not seconds, to calculate the same. Now you know the power of a computer?
Well, congratulations on your first program!
Now, let us understand its working.
It is being declared that there is a “placeholder” called 'a' to which 54 is the value assigned.
Here, it is being declared that there is another placeholder called 'b' to which a ** 8 is the value assigned. As the value of a is 54, we are effectively computing 54 ** 8. But what is **? The ** operator stands for the “power” operator, hence a ** b means ab.
After this computation is done, you would want to display the result onscreen. So, for that, you use this print statement.
So, with this we come towards the end of the very basics of computer programming. Hope you enjoyed it. Computer Programming can help you take up a lot of creative tasks. It is a huge field, has a long list of tools, and there is a lot to explore from writing computer programming code that are simple to have great knowledge of software programming.
Keep learning and keep exploring!
Here are some other interesting picks:
- Which programming language is best for you?
- Everything you need to know about R programming
- Looking to develop your tech skills? Here are 10 entry-level programming languages for you to choose from!
- From IITs, ISRO, IISc to MIT and Harvard, here is a list of free online computer programming courses!
- Machine Learning - The Math of it all!