Also, the real problem with code on the right in OP is all the state mutations made to the arguments passed into the functions. Not too familiar with golang, but this really could use some sort of builder pattern or something, if you’re going to mutate the object.
Kind of a bad example overall too, as I rarely see code like this in practice.
This is exactly the point made in this 2010 article that’s probably one of the things I link to most often in online discussions.
https://whatheco.de/2010/12/07/function-hell/
Also, the real problem with code on the right in OP is all the state mutations made to the arguments passed into the functions. Not too familiar with golang, but this really could use some sort of builder pattern or something, if you’re going to mutate the object.
Kind of a bad example overall too, as I rarely see code like this in practice.