π10π3β€1
β
When to use what?
Go β
Infrastructural programming and servers. Less is more. Simplicity.
Rust β
Resource-constrained environments. Every byte and CPU cycle matters. Safety is critical. Canβt say simple.
Pick your poison β οΈ π
#Tweet by inanc
βββββββββ
π @gopher_academy
Go β
Infrastructural programming and servers. Less is more. Simplicity.
Rust β
Resource-constrained environments. Every byte and CPU cycle matters. Safety is critical. Canβt say simple.
Pick your poison β οΈ π
#Tweet by inanc
βββββββββ
π @gopher_academy
π12π3
In Go, everything is passed by value. Even pointers.
#Tweet by inanc
βββββββββ
π @gopher_academy
#Tweet by inanc
βββββββββ
π @gopher_academy
π€5π2
π₯ Go is unconventional yet versatile.
π₯ Go isn't just OOP, functional, or procedural.
π It's a unique blend of all and beyond.
β If you aim for idiomatic code, don't confine it to any one style.
#Tweet by inanc
βββββββββ
π @gopher_academy
π₯ Go isn't just OOP, functional, or procedural.
π It's a unique blend of all and beyond.
β If you aim for idiomatic code, don't confine it to any one style.
#Tweet by inanc
βββββββββ
π @gopher_academy
π4π1π1π1
In golang, we "expect" errors, but we don't "expect" panics.
π Errors are our sane behavior
π± Panics are our manic behavior
#Tweet by inanc
βββββββββ
π @gopher_academy
π Errors are our sane behavior
π± Panics are our manic behavior
#Tweet by inanc
βββββββββ
π @gopher_academy
π3π2πΎ1π1
π6π1
A few golang tips for writing effective Go code:
1. Make it easy to read from top to bottom
2. Do not hide the cost of doing something
3. Do not prematurely abstract
These are not rules, just advice.
#Tweet by inanc
βββββββββ
π @gopher_academy
1. Make it easy to read from top to bottom
2. Do not hide the cost of doing something
3. Do not prematurely abstract
These are not rules, just advice.
#Tweet by inanc
βββββββββ
π @gopher_academy
π2π1π1
π golang Optimization Tip:
Convert string to []byte without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
βββββββββ
π @gopher_academy
Convert string to []byte without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
βββββββββ
π @gopher_academy
π3π2π1
π golang Optimization Tip:
Convert []byte to string without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
βββββββββ
π @gopher_academy
Convert []byte to string without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
βββββββββ
π @gopher_academy
π6
β
An error message better not contain:
failed,
cannot,
can't, ...
It's an error already + you hurt chained err output:
failed to open:
failed to connect:
failed to fly: ...
Instead, do
#Tweet by inanc
βββββββββ
π @gopher_academy
failed,
cannot,
can't, ...
It's an error already + you hurt chained err output:
failed to open:
failed to connect:
failed to fly: ...
Instead, do
opening:
connecting:
flying: no wings exist.
#Tweet by inanc
βββββββββ
π @gopher_academy
π7π3π1