current position:Home>Python and go languages are so popular, which is more suitable for you?
Python and go languages are so popular, which is more suitable for you?
2022-01-30 00:47:02 【TSINGSEE】
In this paper , We discussed Python and Go The difference between the two most popular programming languages in the world 、 Similarities and use cases . Start with a quick comparison of the two , Then look at their readability 、 Speed 、 How to stack aspects such as ease of learning .
Python and Go Different , Usually used for different purposes . Python Is the main language of data scientists , among Go Is the language of server-side commands . Go Is the language used to run the software . It's a faster language , With Java and C++ Speed execution .
Python Is used to write readable 、 A language in which code can be shared —— So the large community around it .
Technically speaking ,Go It is a procedural functional language built for speed , and Python It's an object-oriented 、 imperative 、 Functional and procedural languages . Go Support concurrency , That is, the algorithm can run its steps disorderly , and Python I won't support it .
In short , If you're dealing with data and the audience is people , Please use Python. If you are using a server , Please use Go.
Python programing language
Python On 1991 First released in 2004 . from Guido van Rossum Design ,Python Our design philosophy is centered on code readability .
Python It's an explanatory 、 advanced 、 Universal programming language . It's object-oriented . Because its design focuses on readability ,Python The community will be based on the code Pythonic Rate each other's codes to a certain degree . Because of its readability ,Python Very suitable :
- Learning to program
- Collect ideas quickly
- Share code with others
Go programing language
Go yes Golang Abbreviation ,Go By the first Robert Griesemer、Rob Pike and Ken Thompson On 2007 In Google Design .
Go Is a statically typed compiled programming language , from Google Open source and maintain . Go yes C Part of a series of programming languages , It uses a garbage collector to handle memory leaks . In the design Golang when , Its creators want to improve what already exists , One of them is readability .
1、 Readability
The basic standard for unreadable code is Java and C++. Python and Go All hope to improve them . Go Some changes have been made . And Python similar ,Go To cancel the :
- Colon at end of line
- Use of parentheses and parentheses .
If you are familiar with C Language level , Then it should look familiar :
Go Code example :
package main
import "fmt"
func split(sum int) (x, y int) {
x = sum * 4 / 9
y = sum - x
return
}
func main() {
fmt.Println(split(17))
}
Copy code
return : 7 10
Python Code example ( Not -Pythonic):
even_numbers = []
for number in range(10):
if number % 2 == 0:
even_numbers.append(number)
print(even_numbers)
Copy code
Python Code example (Pythonic):
even_numbers = [ x for x in range(10) if x % 2 == 0]
print(even_numbers)
Copy code
return :
[0, 2, 4, 6, 8]
Copy code
2、 Error handling
majority IDE Will help in writing Python Error found while code . And Python Different ,Go No error handling . It's built for people who already know how to code . Although easier to read and type , But the price of simplicity is to leave more room for errors in the code , This means that it will take more time to debug the code .
3、 Speed
Speaking of speed ,Go Soon .Go The original intention is to be fast , But it's not Python The only goal of . In most benchmarks ,Go Far more than Python.Go Even more than Java The speed of , It is generally accepted that Java Than Python Much faster . If it comes down to the need for a program to quickly load software , that Go Namely Go The choice of .
4、 library
Python Than Go Good morning! 16 year , So a larger community has been built around it . In this community , It faces all types of Stack Overflow A lot of support : beginner 、 Course 、 Tutorials and instructions , And finally Python library . Probably , Never have to be in Python Start from scratch .
Python The library is especially huge . They can let anyone who writes code do what they want to do on the first day . Use Pandas You can easily explore data tables , Use TensorFlow and PyTorch Machine learning can be done easily .
Go No such support is provided . You have to write all your own scripts to search the data table . stay Go Developing machine learning in will be a huge effort .( top Go Libraries are related to server maintenance )
5、 share
And Jupyter notebook Share executable Python Code is one of the common workflow tools in the world of data science . Jupyter Notebooks and Google Colab Notebooks allow Python Users read and execute code in a very interactive reading and writing experience .
stay Go It will be difficult to start and share these types of charts .
6、 Easy to learn
Programming languages are better designed 、 More intelligent . The readability of any code makes it easy to learn . In the programming world , The accepted fact is that **, If you learn a language , You can learn any other language —— You just need to delve into .**
Discussing differences only makes sense for picky people and people who can already read and write in one language . In a sense , These differences don't matter , It should involve a person's choice to start programming . contrary , These differences are only important when choosing the language best suited to perform the function .
Conclusion : choose Go still Python?
Go and Python Are easy to use and learn .Go It's really fast . Python There is a lot of community support .
at present , stay Go The development of ,Go Mainly used for server-side applications .Python Is the preferred language for data scientists , And it's likely to last a long time . all ML Library developers are investing time in Python Development Library .Go May get there in time , But for now , There is room for two languages in the programmer's Toolkit .
TSINGSEE When the R & D personnel of Qingxi video are doing platform development , Use... In intelligent analysis Python There will be more compilations , In part of the basic level call capacity, we use Golang More . You can choose the language of initial learning according to your own needs , Or through our open source project EasyDarwin To test it .
We are in artificial intelligence technology + Video field , take AI testing 、 Intelligent recognition technology is integrated into various video application scenarios , Such as : Security monitoring 、 Face detection in video 、 People flow statistics 、 Dangerous behavior ( climb to a higher point 、 Fall down 、 Push, etc ) Detection and identification, etc . Typical examples are EasyCVR Video convergence cloud service , have AI Face recognition 、 License plate recognition 、 Voice talk 、 Pan tilt control 、 Audible and visual alarm 、 The ability of monitoring video analysis and data collection .
Of course , Some netizens also think that : As a programming language ,Golang Is better than Python. Go In most cases, it definitely has the upper hand , It may not Python The fame gained over the years and the expansion of the Internet , but Go It must also catch up in this regard . Welcome to discuss with us in the comments section .
copyright notice
author[TSINGSEE],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/01/202201300046583493.html
The sidebar is recommended
- Install tensorflow and python 3.6 in Windows 7
- Python collects and monitors system data -- psutil
- Getting started with Python - object oriented - special methods
- Teach you how to use Python to transform an alien invasion game
- You can easily get started with Excel. Python data analysis package pandas (VI): sorting
- Implementation of top-level design pattern in Python
- Using linear systems in python with scipy.linalg
- How to get started quickly? How to learn Python
- Modifying Python environment with Mac OS security
- Better use atom to support jupyter based Python development
guess what you like
-
Better use atom to support jupyter based Python development
-
Fast power modulus Python implementation of large numbers
-
Python architects recommend the book "Python programmer's Guide" which must be read by self-study Python architects. You are welcome to take it away
-
Decoding the verification code of Taobao slider with Python + selenium, the road of information security
-
Python game development, pyGame module, python implementation of skiing games
-
Python collects and monitors system data -- psutil
-
Python + selenium automated test: page object mode
-
You can easily get started with Excel. Python data analysis package pandas (IV): any grouping score bar
-
Opencv skills | saving pictures in common formats as transparent background pictures (with Python source code) - teach you to easily make logo
-
Python ThreadPoolExecutor restrictions_ work_ Queue size
Random recommended
- Python generates and deploys verification codes with one click (Django)
- With "Python" advanced, you can catch all the advanced syntax! Advanced function + file operation, do not look at regret Series ~
- At the beginning of "Python", you must see the series. 10000 words are only for you. It is recommended to like the collection ~
- [Python kaggle] pandas basic exercises in machine learning series (6)
- Using linear systems in python with scipy.linalg
- The founder of pandas teaches you how to use Python for data analysis (mind mapping)
- Using Python to realize national second-hand housing data capture + map display
- Python image processing, automatic generation of GIF dynamic pictures
- Pandas advanced tutorial: time processing
- How to make Python run faster? Six tips!
- Django: use of elastic search search system
- Python 3.10 official release
- Python chat room (Tkinter writing interface, streaming, socket to realize private chat, group chat, check chat records, Mysql to store data)
- This pandas exercise must be successfully won
- [algorithm learning] sword finger offer 64 Find 1 + 2 +... + n (Java / C / C + + / Python / go / trust)
- leetcode 58. Length of Last Word(python)
- Problems encountered in writing the HTML content of articles into the database during the development of Django blog
- Understand Python's built-in function and add a print function yourself
- Python implements JS encryption algorithm in thousands of music websites
- leetcode 35. Search Insert Position(python)
- leetcode 1829. Maximum XOR for Each Query(python)
- [introduction to Python visualization]: 12 small examples of complete data visualization, taking you to play with visualization ~
- Learning this Python library can reduce at least 100 lines of code
- leetcode 67. Add Binary(python)
- Regular re parameter replacement of Python 3 interface automation test framework
- V. pandas based on Python
- Only 15 lines of code is needed for face detection! (using Python and openCV)
- [Python crawler Sao operation] you can crawl Sirius cinema movies without paying
- leetcode 69. Sqrt(x)(python)
- Teach you to read the source code of Cpython (I)
- Snowball learning started in the fourth quarter of Python. One needs three meals. I have a new understanding of Python functional programming, process-oriented, object-oriented and functional
- leetcode 88. Merge Sorted Array(python)
- Don't you know more about a python library before the end of 2021?
- Python crawler web page parsing artifact XPath quick start teaching!!!
- Use Python and OpenCV to watermark the image
- String and related methods of Python data type introduction
- Heapq module of Python module
- Introduction to beautiful soup of Python crawler weapon, detailed explanation, actual combat summary!!!
- Event loop of Python collaboration series
- Django docking pin login system