Since you want to learn programming,Then we should at least know their own learning is what it okay?
Speaking of programming,In fact, the earliest still have to catch up with our big brother Alan Turing God go。At that time Turing invented Turing machine - this thing is very fast hardware,Finish all had easily shortened to two years of World War II where we do not start speaking up,We say that the main,The Turing Machine,Basically it is the first computer!
Of course,Textbooks do not say that von Neumann computer is the father of it? Ok,I will not tell you they stir the base to the course ......,Well that is hooked up a few times。so,If you go to search for keyword "Turing von Neumann" Then you will see still a topic of debate "Who is the father of the computer"。
Turing machine that was the time in RBI,Limited operation times,simply put,Also known as finite machine,Specific method of calculation we do not speak omitted,But it's essential that we still have to mention,Function is。
Some of the functions non-stop operation,Storage etc.,This process ultimately help us calculate the desired results - OK,These are limitations on mathematics,and,Or binary。
Why use a binary?
Want the machine to do the calculation,Then it must use the simplest structure to achieve,Simplifying the issue:How can the workers on the assembly line to make computer? They do not need to know every member computer of how to use,Just put his hand tighten the screws on it。
The same computer,It does not care how you make a complex topic,It only needs to be concerned about the state of their own on the tape,Ie with and without。so,Alan found very clever,If the problem is transformed into a binary,The machine will be able to get!(After all that time, only the tape ah!)
Such,There is a state machine - Turing machine fathers。
In a flash, Allen went to God to do computer ......
Von Neumann genius wealthy people heard Eni Ake plan,I think "I rely on good no brains! But I like it!" And then went dry shares,Results succeeded,Later there will be a large-scale computer,But no way,RBI entry or paper tape - although it has been used to store the state of the transistor。
Over time,Ultimate computer retains the old structure - Binary。We still run this CPU this old algorithm,The only difference is that the transistor becomes a nanoscale semiconductor。
This time computer speed greatly accelerated,You can run "on my knees in an arrow" such a big game,Do developers but also silly to poke with a stick tape it? Of course not,A long time ago,My brother could not understand the situation there,He invented a machine language。
compilation? Ok,almost。
we all know,Assembler is a machine language,It is straightforward to use simple words represent the machine code - yes,Different companies are different assembly language。
As a program ape,You do not know how the nerve to compile a seventy-eight out to see people? Wheel of history rolls forward ah,C language to come out。It is the success of the program into a language humans can understand a word!
You just need a bit of code written in a specific format,Into the compiler inside brush brush,The program is ready to run!
This time you know,"Compile",It is a necessary process into a modern programming language program,Your iPhone can not know what Swift。
But the C language still has its limitations,This thing is still too low level,It is not enough ah。If you know C language,So I ask:“How to write "mountain pass" ( "World of Warcraft") with C language?"Actually, this is a bit boring,This is my teacher tell me what is object-oriented process-oriented when asked what is to。
Functional programming language C is certainly good,But clearly streamline every process that such a development was doomed in a big team which it was unable to perfect coordination。With so Microsoft C ++ ,That is, we often say that the CPP;With Apple's Objective-C;Ok,We have a Java。Later, because there is a plus sign behind the C,Does not fit,Extra plus pile up,With the right again C #。
Here are less rigorous description,I hope you do not go into too,Just talk。I want to say is focus“Object- Oriented” Programming That is OOP,That is, we often say "object-oriented" programming born。
Object-oriented benefits are mutual between the various classes no longer restricted! Each class every method to do their own thing,You just need to call when in use (call) they are!
Here we have talked about Java,Before we talked about this thing compiler,Different Java compiler and C language。Because object-oriented languages are high-level language,It got rid of the shackles of the C language for the process,So people want,That is not the way to make it compile a full platform to run it?
This is also mentioned in front of us:Different platforms,Assembly language is probably not the same - different architecture,It is not the same binary instructions。This determined,Your VB can only run under Windows,C language wants to be cross-platform,It must be recompiled with the source code - in fact, the problem to be dealt with is not as simple as it sounds.。
So the "Java Runtime" was born - this is also the concept of Java,It's called "compile once",Runs on all platforms”,From then on,You no longer have to worry about what memory is! The Java environment does everything for you,You just need to concentrate on your program code can be!
I have to say,This is the reason most people Tucao later Java memory management。
Talk so much Java,Swift is our course? of course,I want to say is,Automatic memory management,Has become a high-level language standard (so no high-level language pointer)。Thanks to these advanced features,Your code will no longer be translated into binary,But something called "bytecode" things,This kind of thing can be certain execution environment - for example, iOS。
But I want to say,Swift and OC compiled bytecode is the same,This is also one of the reasons a lot of people Tucao Swift is not much better than the OC。
Having said that,I think you should basically understand what a programming language - in fact, this thing is to be converted into human thinking logic of a computer program tool,Like people need the same language as dialogue,You want to tell the machine what to do,We need a programming language to let the computer know what you mean - Computer stupid,So you can not say so artistic. "give me a glass of water"This command is not able to perform,(We assume that there is such a robot come out),Then you should do in terms of:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
启动 调用 语音识别 调用 肢体运动 语音采集 分析语音 如果语音命令为“给我一杯水” 那么(进入厨房) 找到饮水机 检查() 如果检查为假 报告“没水了!” 否则 接水() 端着水返回 检查 如果饮水机有水 那么返回 真 如果饮水机没水 那么返回假 接水 拿杯子 压水 检测水位 到达三分之二则停止 返回真 |
(Code only for entertainment)
Original article written by LogStudio:R0uter's Blog » What is a programming language?
Reproduced Please keep the source and description link:https://www.logcg.com/archives/1006.html