Giter VIP home page Giter VIP logo

ultimate-go's Introduction

๐Ÿ’ฅ Big Points ๐ŸŽถ

  • Remember LESS is MORE.

  • readability = not hiding the cost; simplicity = hide complexity

  • If you don't UNDERSTAND the DATA, you DON'T UNDERSTAND the PROBLEM you're working on.

  • Remember: stack (stay on stack) vs heap (share on heap)

  • Take command of type & Take command of semantics

  • Mantra: REDUCE, MINIMIZE, SIMPLIFY.

  • Never share a string or slice unless you're marshaling or unmarshaling.

  • Small is fast = because smaller data structures can stay within the cachelines.

  • Memory leak in go: a reference on the heap that isn't garbage collected AND not being used.

  • It's never a good reason to alter a data set after you pull it!

  • Know your length when getting a slice of a slice.

  • (Big NO NO) Don't mix value semantics WITH pointer semantics; vice versa.

  • When in doubt USE pointer semantics; except with time.

  • Method sets dictate interface compliance.

  • We do not use embedding to reuse state! We use embedding to reuse behavior. (WE EMBED BECAUSE WE NEED BEHAVIOR)

  • Group by behavior (by things that they do vs. what they are).

  • There is implicit conversion in go with interface types because they are valueless and same memory model.

  • Always return the error interface type

  • Don't use pointer semantics when dealing with error handling, because the addresses are always different.

  • You are not allowed to both: log an error && pass it up.

  • You are not allowed to create a go routine unless you can determine WHEN and HOW it will be terminated

  • Do not think of channels as queues, but as signals.

  • Don't use a buffer larger than 1; Anything more and it's unsafe.

    • Using <=1 = somewhat of a garuntee.
    • Easier to catch problems/bugs.

ultimate-go's People

Contributors

derekahn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.