DEV Community


Posted on

Intro to programming language and memory management

Programming language:

Programming language is the language that is in the form of human readable format because computer and smart electronic gadgets can only understand machine language or binary language i.e. which has only 1 and 0.

If any one want to communicate with the machine, one has to generate machine code, which is difficult to write the application in that language as such it is difficult to understand and consists of several lines of code for normal printing message like "hello world".

So the people who have found the trouble with that language developed most human readable and understandable programming language like c, c++, java, python, go, rust, ruby, and so many other programming languages.

The different types of programming language are:

  • procedural language
  • functional language
  • object oriented programming language

Procedural Programming Language

  • Specifies a series of well structured steps and procedures to compose a program.
  • Contains a systematic order of statements functions and commands to complete task.

Functional programming language

  • Writing a program only in pure function i.e. never modifies variables but only create new ones as an output.
  • Used in situations where we have to perform a lot of different operation on the set of data like Machine Learning.
  • First class functions, these functions are the functions where you can assign it to other functions and variable.

Object Oriented Programming Language

  • Revolves around object.
  • Object = Code + Data
  • Developed to make it easier to develop, debug, reuse and maintain software.

There are two basic types of all the above programming language based on compilation which is done by compiler to convert whole human readable code into machine readable code i.e. binary code language which consists of only 1 and 0 at a single go by compiler or by interpreter it is a process of converting human readable code into machine code line by line by checking the syntax and gets converted into machine code.

  • Static type and
  • Dynamic type.

Static Type Programming Languages

  • In this type of language, the language performs type checking during compile time.
  • Declare data type before you use it is used in code.
  • This language has more control on data types and value to be used for the variables, functions, classes.

Dynamic Type Programming Language

  • In this type of language, the language performs type checking at runtime.
  • Errors might not be shown until the program runs.
  • No need to declare data type of variables.
  • Saves time in writing code but might give errors at runtime.

Memory Management in Computers

  • The computers consists of basically two types of memory they are stack and heap.
  • Stack memory consists of reference variables.
  • Heap memory consists of all the value and data that is being used by the variables and files in computer.

More than one variable can point to the same object because of this only you can have several copies of data by changing the file name in 📁folder.

a = [1,3,5,9]
b = a
a[0] = 99
Enter fullscreen mode Exit fullscreen mode

The code will update the value of b with values as [99,3,5,9].
In this the variable a and b are stored in stack memory and the variable [99,3,5,9]are stored in heap memory of computer.

Top comments (0)