Intro to Programming and Programming

What is Programming?

Posted in Intro to Programming, Programming
What is Programming?

We all have heard about Computer Programming gaining a lot of popularity in the past 3 decades. So many students these days want to opt for a Computer Science stream in order to get a job at their dream tech company - Google, Facebook, Microsoft, Apple, and whatnot.

What is Programming?

In this blog post, we will decipher the term “programming” and understand its usage and many other related terms.

Understanding Programming in layman terms

Programming is a way to “instruct the computer to perform various tasks”.

Confusing? Let us understand the definition deeply.

“Instruct the computer”: this basically means that you provide the computer a set of instructions that are written in a language that the computer can understand. The instructions could be of various types. For example:

  • Adding 2 numbers,
  • Rounding off a number, etc.

Just like we humans can understand a few languages (English, Spanish, Mandarin, French, etc.), so is the case with computers. Computers understand instructions that are written in a specific syntactical form called a programming language.

“Perform various tasks”: the tasks could be simple ones like we discussed above (adding 2 numbers, rounding off a number) or complex ones which may involve a sequence of multiple instructions. For example:

  • Calculating simple interest, given principal, rate and time.
  • Calculating the average return on a stock over the last 5 years.

The above 2 tasks require complex calculations. They cannot usually be expressed in simple instructions like adding 2 numbers, etc.

Hence, in summary, Programming is a way to tell computers to do a specific task.

Why should you bother about coding?

You must be wondering - why does one need a computer for adding or rounding off numbers? Or even for simple interest calculation? After all, even an 8th standard kid can easily do such things even over large numbers. What is programming used for? What benefits do computers offer?

Well, computers offer so many benefits:

  • Computers are fast: computers are amazingly fast. If you know how to properly utilize the power of Computer programming, you can do wonders with it. For a typical computer of today’s time, an addition of 2 numbers which could be as big as a billion each takes hardly a nanosecond. Read again - nanosecond! That means that in 1 second, a computer can perform about a billion additions. Can any human ever do that? Forget a billion additions a second, typical human can’t even do 10 additions per second. So, computers offer great speed.
  • Computers are cheap: if you were a stock market analyst and you had to monitor the data of say 1000 stocks so that you can quickly trade them. Imagine the hassle that would create if you were to do it manually! It is just impractical. While you are performing your calculation on the stock’s performance, the price may change. The other alternative is to hire people so that you can monitor more stocks in parallel. That means your cost goes up significantly. Not to mention the trouble you will face if some of your employees commit a calculation error in the process. You may end up losing money! Contrast that with the case where you use a computer. Computers can process a huge amount of information quickly and reliably. 1000 stocks are nothing for computers in the 21st century.
  • Computers can work 24x7: Computers can work 24x7 without getting exhausted. So, if you have a task that is big enough, you can without worries allocate it to a computer by programming it and sleep peacefully.

What is Programming Language?

As mentioned above, Computers understand instructions that are written in a specific syntactical form called a programming language. A programming language provides a way for a programmer to express a task so that it could be understood and executed by a computer. Refer our another blog-post "What is programming language?" to know more about programming languages. Some of the popular Programming languages are Python, C, C++, Java, etc.

Why should you learn Computer Programming?

Now, after knowing so many things about programming, the big question to be answered is - why should you learn Computer Programming? Let us understand why:

  • Programming is fun: Using Programming, you can create your own games, your personal blog/profile page, a social networking site like Facebook, a search engine like Google or an e-commerce platform like Amazon! Won’t that be fun? Imagine creating your own game and putting it on Play Store and getting thousands and thousands of downloads!
  • The backbone of a Technology Company: The backbones of today’s technology companies like Google, Facebook, Microsoft, Apple, Amazon, and many others, are giant computer programs written by a collaboration of thousands of skilled programmers. If you have the right business acumen, knowing programming can help you create the next big tech company.
  • Pretty good salary: Computer Programmers are paid extremely well almost all across the world. Top programmers in Silicon Valley make millions of dollars every year. Quite a few companies offer to start salaries as high as $100,000 per year.

Let us now get into an actual program

Writing your first program

Python is a widely-used programming language. It is extremely beginner-friendly. You can download Python here: https://www.python.org/downloads/. After downloading, run the installer in order to install Python on your machine.

Let us delve into our first Python code now. Open your favorite text editor (we’d recommend Sublime Text) and copy-paste the following 3 lines:

a = 54
b = a ** 8
print b

Save the file on your desktop as my_first_program.py

Now, do one of the following depending on your operating system:

  • Windows: open command prompt and type python my_first_program.py
  • Ubuntu/Mac OSX: open terminal and type python my_first_program.py

When you press enter, what do you see on the screen? Almost instantly after you press the enter key, you will see the following:

72301961339136

What’s that? That’s 548, computed by your computer in the blink of an eye! A typical human will take minutes if not seconds to get the result. You see the power of a Computer?

Congratulations, you’ve written your first program. Let us understand how it works.

a = 54

We are declaring here that we have a “placeholder” called as a to which we assign the value 54.

b = a ** 8

Here, we are declaring another placeholder called as b to which we assign the value a ** 8. Here, the value of a is 54. So, effectively we are computing 54 ** 8. What is **? The ** operator is the “power” operator. a ** b means ab.

print b

Finally, after the computation is done, we want to display the result on the screen. For this, we have used the print statement which essentially throws the result on your screen.

So, that was about the very basics of Computer programming. Hope you enjoyed reading it. Computer Programming is a huge field and there is a lot to explore further. Keep learning and keep exploring. Please feel free to post your doubts in the comments section. Please don’t worry if you feel that your doubt is maybe silly. Every question/doubt is important. There's no such thing as a stupid question.

People are also reading:

Aman Goel

Aman Goel

Entrepreneur, Coder, Speed-cuber, Blogger, fan of Air crash investigation! Aman Goel is a Computer Science Graduate from IIT Bombay. Fascinated by the world of technology he went on to build his own start-up - AllinCall Research and Solutions to build the next generation of Artificial Intelligence, Machine Learning and Natural Language Processing based solutions to power businesses. View all posts by the Author

Leave a comment

Your email will not be published
Cancel
Moe Gyi
Moe Gyi 10 Points

I'm beginner.

Achuya Abraham Moses
Achuya Abraham Moses

I want to learn programming, but how long will it take me to learn and how much do they earn month or yearly.

Dipen Soni
Dipen Soni

Nowadays learning programming is essential for everyone. The article is awsome but in perspective, this particular article is some resource that is important and doesn't explain in-depth. I also found an article on unickprogrammer.com/what-is-programming/ which explains in-depth and covers all the basic topics related to programming.

Shabnam
Shabnam

I want to be a programmer, how long it takes to study and start a job?

ADO WAZIRI
ADO WAZIRI

i want to learn how to computer programming

Ian gitau
Ian gitau

How do i learn basic computer programming

Derek
Derek

First pick up language you would like to learn. Good 1st languages are C, Java and Python and they all have big job sectors. For private Java tutoring i would suggest javasmarts.com

Hans
Hans

i think it's print (b), because i tried just b and it didn't work.

Daniel
Daniel

Whenever I see programming I get confused, cause it's too broad. But I would love to study it.

tegueboug cabrel
tegueboug cabrel

mine did not work this is what was said after i pressed the enter botton
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\YANNICK>type python my_first_program.py
The system cannot find the file specified.
Error occurred while processing: python.
The system cannot find the file specified.
Error occurred while processing: my_first_program.py.

C:\Users\YANNICK>

aman gupta
aman gupta

after the learning language phython what should i do

S1d33q
S1d33q 10 Points

it depends on what is your goal .If your goal is to do a job in a specific company as a python developer(a specific field like web dev , app dev , game dev etc) .Then search that company and read their requirements for a job .then according to their requirements complete open source projects and share them with other peoples (python community) on github or other forums .And also read other python programmer's code