Popular understanding: what is programming language?

Time:2020-2-10

Before learning programming language, we should first make clear the concept of “programming language”.

When we were very young, our parents taught us to speak and how to understand the meaning of other people’s speech. After a long time of edification and self-study, we have unconsciously learned to speak, and at the same time we can understand the meaning of other children’s speaking. We began to ask our parents for pocket money to buy snacks and toys, and were bullied to talk to their parents

We speak Chinese, which is the “Chinese language”. As long as we tell our parents our needs, they will be satisfied. We use the “Chinese language” to control our parents and let them do what we like.

“Chinese language” has a fixed format. Each Chinese character represents a different meaning. We must express it correctly so that parents can understand our meaning. For example, if we ask our parents to give us 10 yuan of pocket money, we will say, “Mom, give me 10 yuan, I want to buy a car.”. If we say “10 yuan for my car pocket money Mom”, or “Mom gives me 1 billion yuan, I want to buy F-22”, mom will feel strange, can’t understand us, or understand the mistake, blame us.

We control others and let others do things for us through the “language” with fixed format and fixed vocabulary. There are many languages, including Chinese, English, French, Korean, etc. although their vocabulary and format are different, they can achieve the same goal. We can choose any language to control others.

Similarly, we can control the computer through “language” and let the computer do things for us. Such a language is called programming language.

Programming languages also have fixed formats and vocabulary. We must learn to use them before we can control computers.

There are many programming languages, including C language, C + +, Java, C ා, python, PHP, JavaScript, go language, Objective-C, swift, assembly language, etc. each language has its own advantages, such as:

Programing language Main uses
C/C++ C + + is developed on the basis of C language. C + + contains all the contents of C language. C language is a part of C + +, which is often used together, so it is called C / C + +. C / C + + is mainly used in PC software development, Linux development, game development, SCM and embedded system.
Java Java is a general-purpose language, which can be used in website background development, Android development, PC software development. In recent years, Java has been involved in the field of big data (thanks to the popularity of Hadoop framework).
C# C ා is a language developed by Microsoft to fight against Java. Its implementation mechanism is similar to Java. However, C ා is currently mainly used for software development of Windows platform and a small number of website background development.
Python Python is also a general-purpose language, which is mainly used in system operation and maintenance, website background development, data analysis, artificial intelligence, cloud computing and other fields. In recent years, it has a strong momentum and a very fast growth.
PHP PHP is a special language, which is mainly used to develop website background program.
JavaScript JavaScript can only be used for website front-end development at first, and it is the only language for front-end development, and has no substitutability. In recent years, due to the popularity of node.js, JavaScript also occupies a place in the background development of the website, and it is growing rapidly.
Go language Go language is a programming language released by Google in 2009. It has grown rapidly and has been widely used at home and abroad. Go language is mainly used for programming on the server side, which poses great challenges to C / C + + and Java.
Objective-CSwift Objective-C and swift can only be used for the development of Apple products, including Mac, macbook, iPhone, iPad, Iwatch, etc.
assembly language Assembly language is a language in the early stage of computer development. Its execution efficiency is very high, but the development efficiency is very low. Therefore, assembly language will not be used in common application development. Assembly language will only be considered in key modules with high efficiency and real-time requirements, such as operating system kernel, driver, instrumentation, industrial control, etc.

 

Different programming languages can be compared to different languages. In order to express the same meaning, different sentences may be used. For example, to express “hello to the world”:

  • Chinese: hello to the world;
  • English: Hello World
  • French: Bonjour tout le monde

In programming languages, the same operation may use different statements. For example, display “I love it” on the screen:

  • C language: puts (“I love it”);
  • PHP: echo “I love it”;
  • Java: system. Out. Println (“I love it”);

Programming language is similar to human language. It is composed of intuitive words. We can easily understand its meaning. For example, in C language, we useputsThis word causes the computer to display text on the screen; puts is an abbreviation for output string.

Use puts to display “C language” on the screen:

Puts (“C language”);

We put the content to be displayed in("and")Between, and at the end;。 You have to write like this. It’s a fixed format.

Summary: programming language is a series of instructions used to control the computer. It has a fixed format and vocabulary (different formats and vocabulary of different programming languages). It must be observed, otherwise it will make mistakes and fail to achieve our purpose.

C language is a kind of programming language. To learn C language is mainly to learn its format and vocabulary. Here is a complete example of C language, which will let the computer display “C language” on the screen.

This example mainly demonstrates some inherent forms and vocabulary of C language. Readers who can't understand it don't need to go deep into it, and don't need to ask why. We will explain it gradually later.
#include 
int main()
{
Puts ("C language");
return 0;
}

These words and statements with specific meanings, organized in a specific format, constitute the source code, also known as source code.

Then, C language definitely defines the meaning of each word and statement in the source code, and also specifies how they should be organized together, which is syntax. It is similar to the “grammar” we speak when we learn English, which stipulates how to organize specific words and sentences into understandable languages.

The process of writing source code is called programming. People who work in programming are called programmers. Programmers are also humorous and like to laugh at themselves. They often say that they work hard and have a low status, just like farmers, so they call themselves “code farmers”, that is, code farmers. Others call themselves procedural apes.

     By:
https://blog.csdn.net/weixin_44015669/article/details/89818608

Recommended Today

[Redis5 source code learning] analysis of the randomkey part of redis command

baiyan Command syntax Command meaning: randomly return a key from the currently selected databaseCommand format: RANDOMKEY Command actual combat: 127.0.0.1:6379> keys * 1) “kkk” 2) “key1” 127.0.0.1:6379> randomkey “key1” 127.0.0.1:6379> randomkey “kkk” Return value: random key; nil if database is empty Source code analysis Main process The processing function corresponding to the keys command is […]