|
|
|
|
|
by SomaticPirate
2228 days ago
|
|
William Kennedy has an excellent post on this https://www.ardanlabs.com/blog/2017/06/design-philosophy-on-...
As someone who has written (and read) a decent amount of Go the value vs pointer semantics of the function informs me of how the creator intends for the type to be used. Seeing pointer receivers informs me that there is an expectation of modifying the state while value pointers (which are thankfully more common) return a copy of the data. |
|
that comes out to 20 loc per 8.5x11 piece of printer paper.
I feel like that's nearly an order or magnitude too low.