The author explains why they switched from primarily using Python to primarily using Go for serious projects. Some key reasons include that Go has better performance, code quality, testing, and concurrency features compared to Python. While Python is still good for hobby projects, Go enforces error handling, has built-in profiling tools, and makes deployment easier due to compiling to a single binary.
DevEX - reference for building teams, processes, and platforms
Why I switched from Python to Go for serious projects
1. Why I switch from
python to Go?
weng.wei@zalora.com
2. About Myself
•
Coding python since 2006
•
Speaker @ PyCon China 2013
•
Architect @ zalora.com
•
https://github.com/Wuvist
!
•
Switching to Go last year
21. Python
•
All exception checked?
•
Which one will crash the process?
!
•
Dunno?
•
Service running in “unknown state” is the worse
thing could happen on production server!
36. •
go is just like python
•
•
•
easy
concise
Yes, go needs more code than python
•
•
Usually exception checking
Don’t really need to trade productivity for
performance & code quality
38. •
pip install MySQL-python
•
may work, if you have the prerequisites
•
prerequisites are system wide
•
MySQL-python is system wide
•
So, vitualenv?
39. go
•
go get = pip (kind of)
•
gopath = per project virtualenv
!
•
Both are built-in tools
44. gevent
>>> from gevent import monkey; monkey.patch_socket()!
>>> import urllib2 # it's usable from multiple greenlets now
http://www.gevent.org/intro.html#monkey-patching
45. •
How about MySQL-python/pylibmc?
•
Do you really want monkey patch?
•
•
Explicit is better than implicit. - Zen of python?
Or wait for python 3.4?
•
beta 3, 26 January 2014
50. Gotcha
•
Template support is poor
•
Coding with static Type could be tedious
•
•
•
No generic type
reflection is awful
JSON (parsing) is slow! Much slow than python
•
•
https://code.google.com/p/go/issues/detail?id=5683
Only fields with capital letters are exported