Codding 01. INTRODUCTION TO CODING
How do traffic lights work?
Have you ever wondered how traffic signals function?
The lights cycle through green, yellow, and red at regular intervals to control road intersections' traffic flow. They prevent accidents and help to avoid congestion on the roads.
However, how do the traffic lights
change automatically?
Few lines of code running in the
background drive the traffic lights. At regular intervals, the code changes the traffic signals to show different colors.
Sometimes it is even smarter, where the code detects congestion based on sensors and maximizes efficiency by only functioning when traffic is present.
Where else do we see applications of coding?
Most of us knowingly or unknowingly engage with programming, be it inside our homes or outside. Coding, in the modern world, can be seen on the streets, at the schools, at the local grocery stores, etc.
Some of the practical examples of coding in the real world are:
* Interaction with bar-code scanners at shopping store
* Automatic control of traffic using
traffic lights
* Booking movie, bus, train, flight
tickets online
* Printers
* Computer software we use like
web browser, Word etc.
* Video games and animations for
entertainment
What exactly is coding?
Coding, also referred to as programming, is creating instructions that can be executed on a computer to perform a specific task or achieve a particular result.
Coding is just like solving a math
problem. There may be many ways to
solve a problem. Similarly, there could be more than one way to write
code for the same task. Just like solving any other problem, some coding approaches are more efficient than others.
Think you are playing a video on your
smartphone. Your phone is like a computer that needs to be instructed on what to be done. The app playing the video provides this instruction. This video-playing app is an example of coding. But how does the app
communicate the instructions to the
phone? It does via a programming
language. In the next section, we will get to know more about programming languages.
What is a programming language?
Think about how we communicate with people around us?
Language is our primary means of communication for all human interactions.
Similarly, we can interact with computers via a language that computers understand. This language is called a programming language. Using programming languages, we can provide a set of instructions to a computer to perform a set of activities. These sets of instructions are also called programs. Like any other language that has grammar, programming languages have syntax
Some of the most frequently used
ones are:
* Python
* Java
* JavaScript
* C#
* R
* C++
* C
* F#
* COBOL
Syntax is a set of rules that we need to follow when we write a computer
program. There are hundreds of programming languages used around the world. And new ones are getting developed all the time. Every programming language has its own syntax. But all programming languages have one common thing: they are eventually converted into a language that the computer will understand.
Quiz Time ?
Q. 1 For a given problem, there is always only one way to write a program
Option 1 True
Option 2 False
Ans. Option 2 False
Q. 2 Pin authentication for ATM card transaction is an example of
programming
Option 1 True
Option 2 False
Ans. Option 1 True
Q. 3 Code is a set of instructions that can be executed on a computer to perform a specific task
Option 1 True
Option 2 False
Ans. Option 1 True
Q. 4 Which among the below are examples of programming in real life?
Option 1 Robots
Option 2 Computer Games
Option 3 Self-drive cars
Option 4 All the above
Ans. Option 4 All the above
Q. 5 Which among the below is not an example of programming language?
Option 1 Python
Option 2 English
Option 3 JavaScript
Ans. Option 2 English
What did you learn in this chapter?
So, we are at the end of the introductory chapter for coding. By now, you should understand
* How coding is being utilized in everyday life to perform complex tasks in an easy manner
* What are the real-life applications of coding?
* What is exactly meant by the term coding in context of computer science?
* Now you know names of some of the most popular programming languages
Comments
Post a Comment