Intro To Programming Notes
Intro To Programming Notes
leCture – 1
Introduction to programming
Programming is a way to instruct the computer to perform various task.
Computers only understands Binary i.e., 0’s and 1’s.
Instructing computers in Binary i.e. 0’s and 1’s are very difficult for humans so,
to solve this issue we have programming languages.
Types of Programming
Languages
Object-
Procedural Functional
Oriented
Procedural
Specifies a series of well-structured steps and procedures to compose a
program.
Contains a systematic order of statements functions and commands to
complete a task.
Functional
Writing a program only in pure functions i.e., never modify variables but
only create new ones as an output.
Used in a situation where we have to perform lots of different
operations on the same set of data like ML.
Object Oriented
Revolves around objects.
Code + Data = objects
Developed to make it easier to develop, debug, reuse and maintain
software.
Memory Management
There are 2 types of memory Stack and Heap
When we declare a variable then the reference variable stored in stack
memory points to the object of that variable stored in heap memory.
For ex:- 𝑎 = 10
Here “a” is called reference variable, and “10” is the object of That reference
variable
Reference variable are stored in stack memory.
Heap memory stores the objects of reference variable.
Points to remember:-
More than one reference variable can points to the same object.
If any changes made to the object of any reference variable that will be
reflected to all others variable pointing to same object.
If there is an object without reference variable then object will be
destroyed by “Garbage Collection”