Python contrast with Golang

I. Introduction

  Just read a soft paper, saying, "talent is the most effective way to change life," anyway, then, is the scientific and technological progress in general, to have been in the car, you have to keep learning, just recently ready to learn Golang, the recent fire can not fire it, just have some basic Python, and so want while learning Golang, the contrast with Python, Python knowledge leak under fill a vacancy, I finally believe that language is the same, but the syntax is not the same individual, look Python used to write notes, and now look back, very sloppy Ha, so it is ready to take this opportunity to note that Python reconstruction reconstruction, supplement the supplement while recording under Golang the learning process.

II: Features

1.Python

① interpreted language

  Before running the program does not need to compile, translate only when running programs in specialized interpreter responsible for interpreting the program code each time the statement is executed. Such an interpreted language translation will be performed once every time, efficiency is relatively low.

② dynamic data types 

  Support overloaded operators, also supports generic design. (Operator overloading, the existing operator is redefined, giving it another function, to accommodate different data types. When a generic design that need not specify the type defined, again at the time specified by the client Types of)

③ fully object-oriented languages

  Functions, modules, numbers, strings are objects in Python, then all objects

  Fully supports inheritance, overloading, multiple inheritance 

④ has a strong standard library

  The core Python language only contain numbers, strings, lists, tuples, dictionaries, collections, documents and other common types and functions, and provides a system managed by the Python standard library, network communications, text processing, database interfaces, graphics systems, XML processing and other additional features.

⑤ community provides a large number of third-party libraries  

  Python provides a large community of third-party modules, used in a manner similar to the standard library. Their function covering scientific computing, artificial intelligence, machine learning, Web development, database interface, graphics system fields.

 

2.Golang

① static strongly-typed, compiled, and hairstyle

  Statically typed language, but there is a feeling of dynamic languages. (Statically typed language that can be checked at compile time out of most of the problems hidden feeling of dynamic languages ​​because there are many packages can be used to write high efficiency)

  Can be directly compiled into machine code, does not depend on other libraries, glibc version has certain requirements, the deployment is to throw up a file is complete.

  Language level support for concurrency, this is the most important feature of Go, a natural support concurrency. Go is the gene which support concurrency, you can take full advantage of multi-core, very easy to use concurrency.

② garbage collection

  Built-in runtime, support for garbage collection, which belongs to one of the characteristics of dynamic language, even though at present GC (memory garbage collection) is not perfect, but enough for most situations we can encounter, especially Go1.1 after the GC.

③ supports object-oriented programming

  There are types of interface types and realization of the concept, but with a drop-in replacement of inheritance.

rich standard library

  Go has already built a large number of libraries, especially network library is very powerful.

⑤ Embedded C Support

  Go inside can also directly include C code using the existing rich library of C

III: Application

1.Python

① Network Programming

  web applications, web crawler

② data analysis and machine learning
③ automated testing
④ automated operation and maintenance

2.Golang

① Server Programming

  Log processing, data packing, virtual machine processing, and file systems.

② distributed systems, database agents, etc.
③ Network Programming

  This one most widely used, including Web applications, API applications, download applications.

④ memory database

  groupcache, couchbase google as part of the development of the formation.

⑥ cloud platform

 

Guess you like

Origin www.cnblogs.com/huiyichanmian/p/11259000.html