Home  >  Article  >  Backend Development  >  How to transition from PHP to golang

How to transition from PHP to golang

王林
王林forward
2019-09-10 11:49:314477browse

How to transition from PHP to golang

What should you pay attention to when switching from php to golang?

First of all, let’s briefly understand the golang language

Introduction:

Go is an open source programming language that makes construction simple, reliable and efficient software made easy.

The Go language is designed as a systems programming language for use on giant central servers running web servers, storage clusters, or similar purposes. For the field of high-performance distributed systems, Go language undoubtedly has higher development efficiency than most other languages. It provides massive parallel support, which is perfect for game server development.

Language features:

Simple, fast, safe

Parallel, interesting, open source

Memory management, array safety, compilation Quickly

Issues that need attention:

1. Programming ideas

This sounds very vague and difficult to be specific. It is described, but it is closely related to actual research and development. When coming into contact with Go, it is easy to think subjectively and write Go as Java and PHP. Therefore, don’t carry historical baggage when you first come into contact with Go. Pay attention to understanding the programming ideas advocated by go.

2. Analogical thinking

When switching technology stacks, of course the technical middleware and development tools often used in PHP will also switch accordingly.

A brief list:

Consistency coordination: zookeeper => etcd
Message queue: kafka => nsq
Development framework: Laravel/ThinkPHP/Yaf => Gin/Beego

Note: Of course, this is just a brief explanation. The middleware used in the PHP development process will not be limited to the above, depending on the company's technology selection.

The above content is for reference only!

Recommended video tutorial: go video tutorial

The above is the detailed content of How to transition from PHP to golang. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:go语言中文网. If there is any infringement, please contact admin@php.cn delete