Introduction to Computer Programming | What is it? Programming Language Types

LearningLad
8 Dec 201717:39

Summary

TLDRThis video script provides a comprehensive introduction to computer programming and the different types of programming languages. It begins by explaining what a computer is and how it requires instructions, called programs, to perform tasks. The script then delves into the various levels of programming languages, starting with machine-level languages that use binary code, progressing to assembly-level languages with mnemonic codes, and finally exploring high-level languages that are more human-readable. The concepts of compilers and interpreters, which convert high-level languages into machine-readable code, are also discussed. Overall, the script aims to provide a solid foundation for understanding the fundamental principles of programming languages and how they enable communication with computers.

Takeaways

  • 😀 A computer is a general-purpose machine that performs computational tasks by following programmed instructions (programs) written by programmers.
  • 🤖 Computers can only understand binary language (0s and 1s) at the hardware level, which is known as machine language.
  • 📝 Machine-level programming is difficult and requires extensive knowledge of computer architecture and hardware.
  • 📖 Assembly-level programming uses mnemonic codes instead of binary, making it more human-readable but still architecture-dependent.
  • 💻 High-level programming languages (e.g., Java, Python) are designed to be more user-friendly and closer to human language.
  • 🔄 High-level programs need to be converted to machine language using compilers (compilation method) or interpreters (interpretation method).
  • ⚡ Compiled languages (e.g., C, C++) convert the entire program to machine code before execution, while interpreted languages (e.g., Python) convert and execute line by line.
  • 🌐 Middle-level languages (e.g., C, C++) allow programmers to access computer memory and data directly, combining features of high-level and low-level languages.
  • 🏃‍♀️ Machine language executes the fastest, followed by assembly language, and then high-level languages.
  • 🧠 High-level languages are easier to learn and allow more people to write programs, leading to the creation of numerous applications.

Q & A

  • What is a computer?

    -A computer is a general-purpose machine capable of performing many computational tasks, including billions or trillions of calculations within a fraction of a second.

  • Why do computers need programs?

    -Computers require programs to perform tasks because they cannot do anything on their own. Programs contain step-by-step instructions for the computer to execute a specific task.

  • What is the role of a programmer?

    -A programmer writes the instructions or programs that a computer follows to perform specific tasks.

  • What are system programs?

    -System programs manage the computer hardware resources.

  • What are application programs?

    -Application programs provide specific functionality to users, such as word processing, web browsing, and media playback.

  • What is a programming language?

    -A programming language is a set of instructions written in a specific syntax that a computer can understand and execute to perform tasks.

  • What is binary language?

    -Binary language is the basic language of computers, consisting only of 0s and 1s. Computers interpret these binary signals to perform operations.

  • What are the types of programming languages?

    -Programming languages are categorized into machine level languages, assembly level languages, high level languages, and middle level languages.

  • What is the difference between compiled and interpreted languages?

    -Compiled languages are converted entirely from the source code into machine language by a compiler before execution. Interpreted languages are translated and executed line by line at runtime by an interpreter.

  • What are examples of high-level, compiled, and interpreted programming languages?

    -High-level languages include Java, C#, and Python. Examples of compiled languages are C and C++. Python is an example of an interpreted language.

Outlines

00:00

👨‍💻 Introduction to Computers, Programming, and Programming Languages

This paragraph introduces the concept of computers, their computational capabilities, and the need for programs and programmers to provide instructions for performing specific tasks. It explains that computers contain system programs for managing hardware resources and application programs for providing user functionality. It also highlights the importance of programming languages as a means of communicating with computers.

05:07

🗣️ Communication with Computers: Binary and Machine Language

This paragraph discusses the binary language (0s and 1s) that computers understand at the hardware level. It explains why computers are built to recognize patterns of 0s and 1s (machine language) and how specific operations are defined for each pattern. It introduces the concept of machine-level language, where instructions are represented as combinations of 0s and 1s.

10:13

⬆️ From Lower to Higher-Level Programming Languages

This paragraph explores the evolution of programming languages, starting from machine-level language and assembly-level language (which uses mnemonic codes instead of 0s and 1s). It then introduces higher-level languages, which are more human-readable and easier to learn. The paragraph also discusses the need for compilers and interpreters to convert high-level language code into machine language for execution by computers. It briefly mentions middle-level languages like C and C++, which allow direct memory access and data manipulation.

15:17

✅ Compilation vs. Interpretation: Executing High-Level Language Code

This paragraph delves into the two methods of executing high-level language code: compilation and interpretation. It explains the compilation process, where a compiler converts the entire high-level language program into machine language before execution. It then describes the interpretation process, where an interpreter reads and converts each line of the high-level language program into machine language, executing it immediately. The paragraph also distinguishes between compiled languages (e.g., C, C++) and interpreted languages (e.g., Python).

Mindmap

Keywords

💡Computer Programming

Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result. In the video, it's described as writing step-by-step instructions for the computer to perform a task. These instructions, known as a program, enable the computer to execute various tasks, from simple calculations to complex operations like running applications.

💡Programming Languages

Programming languages are formal languages comprising a set of instructions that produce various kinds of output. They are used in computer programming to implement algorithms. The video emphasizes the importance of programming languages as the medium through which humans communicate instructions to computers. It further explores different types of programming languages, highlighting their roles and applications.

💡Binary Language

Binary language, consisting of only 0s and 1s, represents the most fundamental level of communication with a computer. The video explains how computers are built to understand this binary language, enabling them to perform operations based on the binary patterns they receive. This concept underscores the foundational role of binary language in computing and programming.

💡Machine Level Language

Machine level language, also known as machine code, is the lowest level of programming language, directly understood by the computer's hardware. The video highlights the challenges of using machine level language, such as the need for detailed knowledge of the computer's architecture and the difficulty in writing and debugging programs due to its binary nature.

💡Assembly Level Language

Assembly level language is a step above machine code, providing a more readable form of programming using mnemonic codes. The video discusses assembly language as a bridge between machine code and high-level languages, offering a more human-readable format but still requiring a conversion process (assembling) to machine code for execution.

💡High Level Languages

High level languages are programming languages that are more abstracted from the hardware, designed to be easy for humans to read and write. The video describes these languages as closer to human language, making programming more accessible to a wider range of people. Examples include Python, Java, and C++.

💡Compiler

A compiler is a program that translates code written in a high-level programming language into machine code. The video explains the compilation process, where the compiler converts the entire program at once, allowing the computer to execute it. This is contrasted with interpretation, highlighting the different approaches to running high-level code on computers.

💡Interpreter

An interpreter directly executes instructions written in a programming or scripting language without previously converting them to machine code. The video outlines the interpretation method, where the interpreter processes and executes each line of code sequentially. This approach allows for immediate execution but can be slower than compiled languages.

💡Middle Level Languages

Middle level languages, such as C and C++, offer a balance between low-level hardware control and high-level abstraction. The video mentions these languages as providing the features of high-level languages while still allowing programmers to manipulate memory and data directly, similar to lower-level languages.

💡System Programs vs Application Programs

The video differentiates between system programs, which manage computer hardware resources, and application programs, which provide specific functionality to users, like web browsers and media players. This distinction highlights the diverse range of software developed through programming to fulfill various computational tasks and user needs.

Highlights

A computer is a general purpose machine that can perform many computational tasks and billions or trillions of calculations within a fraction of second.

For a computer to do something, one has to give it instructions, which are called a program.

The person who writes the instructions or program is called a programmer.

System programs manage computer hardware resources, while application programs provide specific functionality to the user, such as Notepad, web browsers, music players, and video players.

The language in which instructions are written is called a programming language.

Computers can only understand binary language, which has two values: 0 and 1.

The binary language is easy to create at the hardware level, which is why computers are built to understand it.

The first type of programming language is the machine level language, which consists of instructions in the form of 0s and 1s.

The problem with machine level language is that one needs to know everything about the computer to program in it, making it difficult to learn.

Assembly level language uses mnemonic or symbolic codes instead of 0s and 1s, making it more human-readable and easier to code than machine level language.

Code written in assembly level language needs to be converted to machine level language using a program called an assembler.

High-level languages are designed to be easy for beginners to learn and are close to human-readable language.

Programs written in high-level languages need to be converted to machine level language using either a compiler or an interpreter.

The compilation method converts the entire high-level language program to machine language before execution.

The interpretation method converts and executes each line of the high-level language program immediately, one line at a time.

Transcripts

play00:00

Hi this is Anil from learning lad and in this video we are going to talk about the

play00:05

computer, computer programming and the types of programming languages.

play00:09

A computer is a general purpose machines which can perform many computational task now the

play00:16

modern day computers that we have they can perform billions or trillions of calculations

play00:22

within a fraction of second. now the thing these computer's they can't really do anything

play00:28

on their own. so for a computer to do something one has to give the instructions to it and

play00:35

these instructions will contain step by step information to perform a specific task and

play00:42

these instructions are called as program. now the person who is going to write these

play00:49

instructions or the program is called as the programmer and here the programmer will write

play00:58

instructions or the program and the computer will execute that or computer will work on

play01:04

that instructions

play01:06

now the computers that we have they contain a lot of programs in them. There are some

play01:12

programs which will manage the computer hardware resources and they are called as the system

play01:18

programs and there are some programs which will provide specific functionality to a user

play01:24

for example the Notepad web browser music player video player and all these types of

play01:31

programs are called as the application programs.

play01:34

now we know that we need to give instructions to the computer so that the computer can work

play01:39

on it now the thing is how we can give the instruction to the computer or in which language

play01:45

we can give the instructions to the computer. Now since this computer is a machine how we

play01:51

can communicate with this machine.

play01:54

now the language in which these instructions are written or the language in which this

play02:01

program is written is called as the programming language. now there are several types of programming

play02:08

languages and we are going to see the details about them.

play02:11

now you guys may probably heard that the computers can only understand the binary language. Now

play02:17

this binary language has only two values. 0 and 1 so in this binary language whatever

play02:25

you want to say has to be in the form of this 0 and 1. now here these computer's are built

play02:32

in such a way that they can understand or they can recognise the pattern of the zeros

play02:38

and ones and then they can work on it accordingly.

play02:42

Now why we have built the computers to understand this binary language?

play02:48

that is because this binary language which has only two values is easy to create in the

play02:54

hardware level for example if we have a wire and if the current is flowing through this

play02:59

wire then we can say it is 1 if the current is not flowing then we can say it is zero.

play03:06

so in general we can say that one stands for something which exists and zero stands for

play03:11

something which doesn't exist so since this binary language is easy to create in the hardware

play03:19

level so the computer is built in the hardware level to recognise this pattern of 0 and 1

play03:26

and while building the computer for a specific pattern of 0 and 1 a specific setup operations

play03:33

are defined.

play03:35

so when the computer will see a specific pattern of 0 and 1 it knows what it has to do. so

play03:41

now the computers can understand this binary language and this binary language with the

play03:47

computers understand are also called as the machine language.

play03:52

now let's see the types of programming languages available. now in this modern day we have

play03:59

a lot of programming languages available. so let's take a look at the types of programming

play04:05

languages. so the first type of programming language

play04:09

or the language in which we can communicate with the computer is the language which the

play04:15

computer understands. now all of you know that this computer's can understand this binary

play04:20

language or the machine language which is the combination of zeros and ones.

play04:24

so the first type of programming languages is the machine level language And in this

play04:30

machine level language we have the instructions in the form of 0 and 1.

play04:34

so whatever you want to say has to be in the form of zero and one and since the computers

play04:41

are built in such a way that they can recognise this zeros and ones and perform some specific

play04:46

operation on that the combination of zeros and ones you know we can communicate with

play04:52

his computer in this language.

play04:54

now the problem with this machine level language is in order to program in this machine level

play04:59

language one has to know everything about the computer. so here the programmer is directly

play05:06

dealing with the hardware level so he is directly working on the memory and the data.

play05:13

so the programeer needs to know everything about the computer, computer processor the

play05:17

computer architecture everything about that he has to know and that's why this machine

play05:23

level language is a bit difficult to learn and also think about this let's say you want

play05:30

to write a program in the machine level language or you want to give instructions to the computer

play05:35

in the machine level language and your program consists of thousand lines. all your instruction

play05:42

will contain this 0 and 1 and this combination of the zeros and ones. first of all it is

play05:48

difficult to write the program and also if you make some mistakes in your program then

play05:54

it is difficult to spot and because of all these, a normal guy can't really learn the

play05:59

programming easily.

play06:02

so to solve these kind of problems another type of programming languages were invented

play06:08

and they are called as the Assembly level language.

play06:13

in this assembly level language instead of that zeros and ones combination mnemonic the

play06:18

symbolic codes were introduced for example if the programmer has to write an instruction

play06:24

let's say he wants to add the numbers 5 and 6.

play06:29

then in the machine level language it has to be in the form of this zeros and ones.

play06:34

so let's say this is gonna be the instruction to add the numbers 5 and 6.

play06:40

so in the machine level language it will look like this but in the Assembly level language

play06:44

mnemonic codes for used and the programmer could write ADD 5 6.

play06:51

So a lot of mnemonic or the symbolic codes where used and the programmer could write

play06:56

the program in this way. so it was a lot more human readable format

play07:02

the programmer can understand the code just by looking at it and it was a lot easier to

play07:09

code than the machine level language.

play07:12

so now the thing is the source code of the program written in this assembly level language

play07:18

by using this mnemonic or the symbol Codes cannot be directly executed in this computer

play07:25

that is because this computer can only understand the machine language.

play07:29

so what we have to do is we have to convert the code which is written in the Assembly

play07:35

level language to machine level language so that the computer can understand it and execute

play07:41

it. so the program written in the Assembly level

play07:44

language needs to be converted to the machine level language and to convert that a program

play07:50

was used and that program is called as the assembler.

play07:56

so this assembler will convert the code written in the Assembly level language to machine

play08:01

level language. now this assembly level language was lot more

play08:05

easy to learn and someone can learn the programming a lot more easily than the machine level language

play08:12

but this assembly level language also had the same difficulties.

play08:16

although it was a lot easy to write the programs than the machine level language in assembly

play08:21

level language if the program size increases then again it is difficult to spot the errors

play08:27

and also the code written in the Assembly level language was also Computer Architecture

play08:33

dependent.

play08:34

so the code return for one type of computer cannot be executed in another type of computer

play08:40

which has different architecture so again to solve these kind of problems a new types

play08:46

of languages by invented so that a lot more people can come and write the programs and

play08:53

that type of programming languages are called as the Higher level languages.

play08:59

the high level languages are designed in such a way that they are very easy for a beginner

play09:05

to learn and they were very close to the human readable language for example in this higher

play09:12

level language one could write the instruction to add 5 and 6 like this.

play09:20

so this 5 + 6 is a lot more similar to the human language so just by looking at the code

play09:27

one can understand what we're trying to do and since this higher level languages where

play09:32

a lot more easy to learn many people started learning computer programming and started

play09:38

creating lot more programs.

play09:41

now again the thing is the program written in the higher level language cannot be directly

play09:46

executed in the computer that is because the computer can only understand the machine language

play09:53

which can contain 0 and 1 but the higher level language is very close to the human languages.

play09:59

so we have to convert the program which is written in the high level language to machine

play10:06

language which the computers can understand and execute. so for this high level languages

play10:12

there are two ways in which we can convert the source code from high level language to

play10:18

machine level language and execute it and the two methods which were used to convert

play10:24

the high level language program to machine level language one was the compilation method

play10:29

where a program called compiler was used.

play10:33

this is the compilation method another method is called as the interpretation and for this

play10:41

interpretation method another type of program called as interpreter was used and we will

play10:47

see the details of this compilation and interpretation method a bit later but here just remember

play10:53

that although these are two different methods what they do is they convert the program which

play10:59

is written in the high level language to machine level language which the computers can understand

play11:05

and execute.

play11:06

now here this machine level language and the Assembly level language they are called as

play11:11

the lower level languages. because while writing the programs in this

play11:16

machine and assembly level language the programmers could easily access the computer memory and

play11:22

directly work with the data. but with the most of this high level languages the programmers

play11:27

can't directly access the memory and the work with data.

play11:32

but there are some languages in the high level language type which allow the programmer to

play11:38

work with the Computer memory and the data and they are called as the middle level languages

play11:49

and this middle level languages they provide all the features of the higher level languages

play11:54

and also they allow the programmer to work with the Computer memory and data directly

play11:59

and since this languages provide the feature of the lower level language and also the high

play12:04

level language they are called as the middle level languages and we have the languages

play12:09

like C and C plus plus are these are all the middle level languages because allow the programmer

play12:15

to work with the Computer memory and data and also they provide all the features of

play12:19

this high level language and in the high level languages we have Java C Sharp python etc.

play12:29

this machine level language which is very close to the machine or you know this language

play12:35

the computer directly understands, it executes much faster than all these languages.

play12:41

so the execution speed of this machine language is very high and after this machine level

play12:46

language we have the Assembly languages and their execution speed is better than the high

play12:51

level languages but a bit slower than the machine level language and then we have the

play12:58

high level languages.

play13:00

so now as I said before in this high level languages we can convert the code from higher

play13:05

level language to machine code in two different ways one is the compilation method another

play13:10

one is interpretation method.

play13:12

let's see this compilation and interpretation method in detail.

play13:16

so first see the compilation. so in the compilation method a program called

play13:22

compiler is used and this compiler Will take the high level language program and it will

play13:29

convert that to the machine language and this process is called as the compilation method

play13:37

and here what happens is this compiler will read the high level language program let's

play13:44

say this is high level language program it will read this program and it will convert

play13:49

that to the machine language. it will convert this entire program into machine language

play13:56

and then this machine language code will be executed.

play14:01

so the thing is compiler will convert entire program which is written in the high level

play14:07

language to machine level language and then that machine level language code will be executed.

play14:15

now let's take a look at this interpretation method so here also we will be converting

play14:20

the program written in the high level language to the machine level language and then executing

play14:26

that. and for that purpose we will be using a program called as the interpreter and this

play14:32

process is called as the interpretation.

play14:35

so the process of converting the high level language program to machine language by using

play14:41

the program interpreter is called as the interpretation method now here what happens is lets say this

play14:49

is the source code or the programs written in the high level language and this interpreter

play14:56

what it does is first it will read the first line of this source code or the program which

play15:03

is in the high level language and then it will convert that to the machine code and

play15:09

then it will execute it immediately and after that it will go to the next line of the high

play15:16

level language program it will read that it will convert that code and then it will execute

play15:22

it immediately and then it will go to the third line and then again it will convert

play15:29

that code and then it will execute it.

play15:32

so in the compilation process the entire program which was written in the high level language

play15:38

was read first then it was converted to machine level language and then that entire program

play15:44

was executed at once but with the interpretation method the interpreter will read the program

play15:52

which is in the high level language line by line it and it will convert and execute each

play15:58

line immediately at a time. and this is how the compiler and interpreter work.

play16:05

now there are many languages in the high level language type and in that languages some follow

play16:11

the compilation method and some follow the interpretation method.

play16:16

the languages which follow the compilation method are called as the compiled languages

play16:24

and for example we have C C + + etc these are all the compiled languages where the compilation

play16:31

method is used to convert the program iwhich is written in these languages to the machine

play16:37

language and the higher level languages which follow the interpretation method are called

play16:43

as the interpreted languages for example we have Python and this Python is an interpreted

play16:52

language.

play16:53

All right. this is it guys this is about the computers computer programming types of programming

play16:59

languages compilation and the interpretation method and I really hope that you have learn

play17:04

something from this video and if you like this video then give a thumbs up and if you

play17:09

don't like it then give a thumbs down and also share your opinion about this video what

play17:15

do you think about it and if you think that this video will help some of your friends

play17:20

then do share this video with them and also you can subscribe to our channel if you want

play17:25

to watch more tutorials like this and if you subscribe to our channel then when I upload

play17:31

a new video you will be get notified immediately. so thank you for watching this video and I'll

play17:37

see you in Next tutorial.