Chapter 1 · Practice 3 of 3
Map what transfers from what you already know, and what does not
Why it matters
Your second language is much easier than your first, because loops, functions, data structures and debugging transfer. The danger is assuming everything transfers.
The Effective Go document says it plainly: a straightforward translation of a C++ or Java program into Go is unlikely to produce a satisfactory result, and to write Go well you need to understand its properties and idioms.
Before you start, list:
- What transfers: control flow, testing habits, HTTP, SQL.
- What is new: the type system, memory model, concurrency model, error handling, package system.
- What is different on purpose: the idioms the community expects.
Spend most of your time on the second and third lists.
Do
- List what is genuinely new in the technology
- Learn the community's idioms early
Avoid
- Writing your old language in new syntax