Hi,
I have been wondering. Given Go's feature set, what would be the appropriate programming paradigm for Go? I am sure that the designers of Go must have certain use cases in their minds when they design the language.
At a glance, it seems that Go is designed to be a major update to C. It looks like C with a better support for modularity, Unicode, memory management, and concurrency with a major overhaul to the standard library to reflect the modern needs. If that is the case, then data-centric, procedural approach ala C should be the recommended approach to designing Go programs.
On the other hand, Go's support for method also indicate that Go can support object oriented programming. However, Go's support for OO seems half-baked. The struct's private methods are still visible to others in the same package. They look like C++ friend classes. Go's inheritance (via composition) is either data-only or function-signature-only inheritance. It is not a true inheritance where both the data and the behavior are inherited. The list goes on. Although you can implement a true OO in Go if you really insist, the amount of work that goes into it seems unnecessary especially if the language isn't really designed for it in the first place.
So, when designing Go programs, should we model objects as in the case of OO or should we start with data modelling ala C language? Earlier I started out with OO approach for a pet project and later on I am reeling with pain for trying to model objects. I wonder whether I should have started out with data-centric procedural approach instead.
Thanks.
Henry