Re:Singleton Pattern in Go
by thomasahle on Sunday July 12, 2015 @06:02PM
(#9875163)
I find that a better approach is to try and isolate pieces of code that needs access to specific resources, such as configuration files or standard output. Performing IO tasks, from every module in a code base, is an easy way to create very unmaintainable code.
Of course this is all a tradeoff with other code structuring ideals. Programming languages with Monads tend to be very good at isolating such things.
Of course this is all a tradeoff with other code structuring ideals. Programming languages with Monads tend to be very good at isolating such things.