What is Programming ? | Learn to Code! - Chapter 1
Today our focus is to familiarize you with the notions and the concepts of programming. First of all I feel like its an imperative to remove the misconception that programming is meant for any sort of geniuses or you need to be specifically good at maths to embark on this creative journey.
Programming:
Programming is simply a way to define specific instructions or commands that are required to solve a given problem or achieve some purpose . It is true that even before computers were introduced into the world, the concept was long obeyed by humans even without knowing it.The idea is to define a sequence of detailed steps required to achieve some result or make a product ;Where every process requires us to:-• understand the problem itself
• identify what needs to be the result
• define appropriate inputs
• devise suitable processes on the input to get the final result .
To understand it in the most generalized terms , think of it as inputs being your raw materials and processes being a way to convert your raw materials into some useful items , and outputs being the end result of those items ,that are put to a good use. Such a sequence of detailed steps working their way to complete a job is known as an algorithm.
For defining algorithms , different approaches can be used , such as :-
• Structured English : You can use plain commands in your natural language to design a solution.
• Pseudocode : Well, pseudo means false. It actually resembles the real code, written in programming languages, but the one which cannot be executed.
• Programming languages: For communicating with computers we need some languages which help us convey our message to the machine or write actual executable programs while following a particular syntax(like Grammatical rules in English language) . (Though, if it does not make any sense ,we will be discussing that later, so you don’t have to worry too much about it.) Examples include:- Java , C, C++, FORTRAN, Python and many more.
Machines are no different either , they are insensible . Unlike humans, they can't learn, adapt , create or produce . In-fact , its our job to give machines a particular algorithm to have it do some work for us. For example there is a simple algorithm presented in flowchart, psueodocode or structured English for converting a length in inches to centimeters. Now , jumping to the basic ideology of writing any algorithm, we again need to know what the problem actually asks from us.
We need to get an input that is the length in inches:-
Structured English:
• Read length in inches from user
• Convert into cm
• Store the result
• Output the result
Further illustrations define the same algorithm in different forms:
Flow chart :
Psuedocode:
input inches
CM=inches*2.54
output CM
STILL CONFUSED?
or WANT TO KNOW MORE?
Have a look at our video tutorial for this Chapter:
But we know for sure that any process or system obeys the very sequential and algorithmic approach taken by computers.
Addition :
In the next chapter, we will be discussing what is known as variables, Constants and about primitive eliments.
Click the Subscribe button to get notified about the next chapter!
0 comments: