Saturday, January 01, 2000

What is programming


 

.

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

.

“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.

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.

.

Extracted from: 

https://hackr.io/blog/what-is-programming



No comments: