Murtaza Hashwani – What is a programming language?

Murtaza Hashwani – Learn about programming languages ​​and why they are needed. Look at the different types of programming languages ​​and find the programming languages ​​list of the most commonly used languages.

what is programming language

A programming language is a set of instructions that can be used to interact with and control a computer. These languages ​​are used to design websites, build apps, develop operating systems, control spacecraft, and analyze data. Programming languages ​​are necessary because computers cannot understand English. Programming languages ​​help bridge this gap, allowing programmers to translate their commands into something a computer can understand and execute.

Why can’t computers understand plain English?

When people communicate with computers, it is important to be very specific about what they are asking the computer to do. A programming language is a tool that allows them to do this. Often, English can be ambiguous and it can be difficult for a computer to determine intent. Programmers use programming languages ​​to specify exactly what they want the computer to do.

How do computers think?

Computers are made up of many small switches that can be either on or off. When a switch is on, it is represented by a 1. When it is off, it is represented by 0. These 1s and 0s are called bits. Bits are the fundamental language of almost all computers and every program must be translated into bits before it can be executed by the computer.

When 8 bits are grouped together, it is called a byte. A byte can represent a single character, for example, 01100001 represents ‘A’. A byte can also represent a control character. For example, 000000011 indicates the end of a piece of text.

When representing a number using bits, it can be converted from its normal base 10 representation to binary. This is called binary representation.

binary representation

While computers use the base 2 system, the system most people are familiar with is base 10. Base 10 means that each place value is a power of 10. For example, 125 100(1) + 10(2) + 1( 5). To convert this number to base 2, it must be broken down to powers of 2.

Our goal is to write 125 in terms 1, 2, 4, 8, 16, 32 and 64. The next power of 2 is 128 and since it is greater than our original number, this place value will be zero and it may be out of our calculations. 125 = 64(1) + 32(1) + 16(1) + 8(1) + 4(1) + 2(0) + 1(1). Writing each of these bits in sequence shows that 125 in base 10 can be written as base 2 or as 1111101 in binary. Similarly, any number can be converted between any base. Sometimes programmers will use base 8 (known as octal), base 16 (known as hexadecimal), or even base64.

types of programming languages

There are three types of programming languages: machine language, assembly language, and high level language.

Machine language is easy for computers to understand but difficult for programmers to understand. This is because machine language is just machine language—bits. Sometimes, programmers will develop programs directly with machine code, but because it is difficult to understand and hard to type, it is more common to program using assembly or a high-level language. Assembly language is a bit easier to understand. Machine language bits are replaced with numbers and English commands. Before the assembly code is run by the computer, it is assembled by an assembler. It converts the code back into machine language 1s and 0s that the computer can understand.

High-level languages ​​use many more English commands and are significantly more readable than assembly or machine language. Many high-level languages ​​have built-in commands that help programmers write loops, create variables of various data types, and manipulate strings. It’s worth noting that all of these are possible in assembly or machine language, but higher-level languages ​​make them much easier for programmers to read, write, and debug. Some of the newer high-level languages ​​are scripting languages. This means that they are not compiled, or translated into machine language, until just before the code is executed at runtime. Python, JavaScript, PHP, Ruby and Bash are all scripting languages.

picture description

Leave a Comment