The ideal me and the real me
The ideal is full , The reality is very backbone . Everyone's time is limited , It's not just the students who have classes every day , Especially office workers , In the face of working overtime every day , Leave yourself a lot of time to concentrate on your study , Unless you're very persistent , Have a strong desire and can make good use of their spare time . But most people don't have , Is that no solution ？ Of course not. .
The answer is to learn in the most efficient way , Get the most information in the shortest time , Think of yourself as a language designer , Share ideas with the best engineers .
According to my experience , If you have some programming experience , The most efficient learning method can help you understand the essence of a language in a week , Or the biggest difference between it and other languages .
Learning to program , The first step is not to hold a book or follow someone else's tutorial from beginning to end , The first step is to start thinking . Thinking starts with asking the right questions , Because the right thing to do is to improve your learning efficiency , The best way to understand the fundamentals of programming languages . such as ：
* Natural language has semantics and grammar , Does computer language have ？
* It's like other people can understand what you're saying , Why can computers understand the code we write ？
* When compiling and running code , What the computer is doing ？
* What is the history of computer development ？ From the era of punch in to assembly language to C, Even C++, Python, What is the driving force behind the development ？C++ And Python Why does this high level language appear ？
Which programming language should be used ？
It depends on your learning methods and goals .
If you are a man of stone , Willing to overcome the most difficult problems , And want to find out the core of programming , that C and C++ It's your first picnic .
Mastering them is very helpful for learning other languages , Because you've solved programming 、 The boundary between compiler and computer organization .
You can be a systems engineer C- Family skills , Write compilers and interpreters , Contribute to open source operating systems , Write drivers .
If you just want to create web And mobile applications , Please study Python, Java, Node.js, HTML, C#, Golang It's choice .
How can machines understand what we write ？
First , We need to know how language interacts between us humans and machines , It should be thought of as the same production process concept .
Programming languages are like what we call natural languages , It has grammatical and semantic meaning .
When we write down natural language , Or when it comes out , Others can understand them , Because we have the same grammar and semantics in our common knowledge .
For programming languages , We write them down , We want machines to understand them , So that it can carry out the tasks we assigned . That's why we design the whole mechanism between man and machine , Including the programming itself and its “ translate ” Tool chain .
When you choose to learn C, You still need to understand vonNeumann Architecture of , In this way, you will pay attention to whether the allocated memory is cleaned up when it is not needed , And be careful with the array index , wait . To solve these abstraction and description problems , People invented more languages .
C++、Java Using object-oriented Syntax , Enables us to describe problems in object-oriented methods . but , please remember ,OO It started as a design , And then it's built into the language .C++ and Java It's a compiler language .
Python Is a scripting language and has OO The explanatory language of grammar
How to teach yourself programming language ？
The classification of languages is very important , It's not that you know some fancy words about language , But it can guide you to learn programming . You may have seen some categories from different perspectives above , For example, explanatory language 、 Object oriented language .
▷ Find the tool chain of language .
If the language is a compiled language , Install its compiler , Write the simplest program , Produce output in stages . for example ,C and C++, install gcc, Write a hello world.c, Pre treatment 、 compile 、 link gcc Options for viewing the results of each phase .
If language is interpretive language , Start its interpreter in interactive mode , Write some code to see the results , for example ,Python.
▷ Practice language grammar and its characteristics .
* Use built-in types , Know how to operate them .
* How to define a custom type .
* Use imperative features , Know how to define functions and parameter passing mechanisms .
* If the language has OO characteristic , Use its OO attribute , For example, packaging 、 Inherit 、 polymorphism .
All in all , You need to be a humble learner , Do a lot of exercises , however , Your goal is to think as a language designer, not as a follower , Try to understand the soul of language .
Last , Whether you change careers or not , It's better to be a beginner , It's OK to be advanced , If you want to learn programming ~
【 Worthy of attention 】 my C/C++ Programming learning exchange Club ！【 Click to enter 】
Answer questions , Exchange of learning , Technical discussion , There are also many programming resources , Zero base video is great too ~