当前位置:网站首页>Preparation before learning golang

Preparation before learning golang

2020-12-08 09:17:30 The simplicity of developing small programs

Learning any language , We need to understand and learn a good foundation , As for the various frameworks based on the language , For us , Are tools. . Lay a solid foundation , It doesn't mean memorizing only the key words and grammar of the language , More importantly, we need to know what it is , Why do you use it like this , It includes program thinking logic and implementation method .

What is? golang

Go( also called Golang) yes Google A static strong type of development 、 A compiled 、 And hairstyles , And has the garbage collection function programming language .

Go The grammar of is close to C Language , But for the declaration of variables ( English :type declaration) Somewhat different .Go Support garbage collection function . adopt goroutine Parallel construction with channels can build thread pools and pipes, etc .

And C++ comparison ,Go It does not include enumeration 、 exception handling 、 Inherit 、 Generic 、 Assertion 、 Virtual function and other functions , But it has increased section (Slice) type 、 Concurrent 、 The Conduit 、 Garbage collection function 、 Language level support for features such as interfaces .

differ Java,Go Native provides associative arrays ( Also known as hash table (Hashes) Or a dictionary (Dictionaries)).

Why golang

An online statement said Go Language is “C The idea of language plus Python The attitude of the ”, I really agree with this view . From my point of view , Namely Go Language has found a balance between development efficiency and execution efficiency . This is very similar to Java, It's the combination of efficiency and development .

I'm familiar with ( understand ) The language of ,C、C++ It's the most efficient language , and Python、PHP、JavaScript The execution efficiency is relatively low . But from the perspective of developing and implementing business logic ,PHP、Python、JavaScript It's really fast , They have a lot of common data structures built in , Function method .

C(C++) The characteristic of language is to keep the language as small as possible , The bottom layer is not shielded and the bottom layer is friendly , Focus on the execution efficiency and performance of the language . and Python(PHP,JavaScript) Is characterized by doing as many things as possible with as little code as possible , Try not to focus on the bottom OS, Programmers try their best to realize business logic .golang It's about trying to balance .

In general , Compared with the language of execution efficiency first ,golang More efficient development ; Compare development efficiency first languages ,golang More efficient execution , It balances execution efficiency with development efficiency .

How to learn golang

golang The grammar of is simple , High development efficiency , It doesn't mean that you don't need to learn and memorize . Learning basic knowledge is the premise of learning any language well . Of course , I'm against learning for the sake of learning . My learning philosophy is , Learn with your needs . This way, you won't be able to learn what you just learned , It was soon forgotten . We start with the real need to do the project , In the step-by-step demand , Establish the relationship between the relevant knowledge points of learning , Finally achieve successful learning golang Purpose . One is learning golang Design concept , Second, learning golang Characteristics of , Third, learning software design , Fourth, in-depth study golang Combined with software development . So there's this tutorial .

golang What's the use

golang There is a proximity to c The speed of language execution , At the same time, it's close to php Language development efficiency .golang It's easy to use 、 Code description is efficient 、 Unified coding specifications 、 Quick start . such golang It has a wide range of development prospects .

Whereas golang The characteristics and original intention of the design ,golang As a server programming language , It's great for working with logs 、 Data packaging 、 Virtual machine processing 、 file system 、 Distributed systems 、 Database agent, etc ; Network programming ,golang Widely used in Web application 、API application 、 Download apps, etc ; besides ,golang It is also suitable for in memory database and cloud platform , At present, many foreign cloud platforms are developed by using .

We will learn to use this time golang Develop websites to learn more golang Development .

actual combat

Start with the preparation knowledge above , We are right. golang We have a preliminary understanding of , got it golang What is it? , Why choose golang、 How to learn golnag、golang What kind of knowledge do you have . When you're done with it , We have only one left to start .

The real beginning , It's real combat , It's about getting into the topic right from the beginning , Take it directly golang To develop a website . Before we start , We need to first according to the actual development of the website to sort out a demand , Then according to the needs to start from scratch to learn golang. here , Let's take the example of a blog website we need to develop , Start the learning process of this tutorial .

版权声明
本文为[The simplicity of developing small programs]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/12/20201208091711983o.html