Why software is difficultAfter having worked in different organization with different levels of maturity, and different backgrounds I mature some opinion on why software is difficult. But the answer is difficult and messy, and nobody like it. People don't scale One solid tec...Nov 26, 2022 · 4 min readpauldigian.com
Advanced go - Avoiding `if` for initialization using `sync.Once` and foot guns to watch out forWe already discussed when to use constructors and when let the user of your library initialize their structures. The short version is that if the structure makes sense and can be used as zero value, or with some fields unset. Or, in other words, if ...1BNov 21, 2021 · 8 min readpauldigian.com
Golang and context - an explanationThe Golang standard library comes with a simple interface, context.Context, which is a little harder to understand and use than the others. The difficulties in getting the context.Context interface may be the naming, maybe not super appropriate. In t...1SNov 12, 2021 · 12 min readpauldigian.com
Advanced go - Make synchronous code asynchronous with context.Context and channelsGo standard library comes with a nice little structure that allows to stop long-running goroutines, when theirs result is not needed anymore: context.Context. If any of the call you are making, has the potential to block for a long amount of time, it...Nov 7, 2021 · 3 min readpauldigian.com
Advanced go - Choosing between a constructor and declaring the typeIn go there are two ways to create structures. Either you instantiate the structure directly, populate its fields. Or you use a constructor, that will populate the structure fields. Suppose we have a structure: type Foo struct { Fuz int Bar [...Nov 4, 2021 · 3 min readpauldigian.com