←back to thread

361 points mmphosis | 1 comments | | HN request time: 0.435s | source
Show context
vander_elst ◴[] No.42165926[source]
> It's better to have some wonky parameterization than it is to have multiple implementations of nearly the same thing. Improving the parameters will be easier than to consolidate four different implementations if this situation comes up again.

From https://go-proverbs.github.io/: A little copying is better than a little dependency.

Curious to see how the community is divided on this, I think I'm more leaning towards the single implementation side.

replies(4): >>42165963 #>>42166107 #>>42166264 #>>42169200 #
OtomotO ◴[] No.42165963[source]
I decide on a case by case basis.

I've been bitten by both decisions in the past. Prematurely abstracting and "what's 4 copies gonna do, that's totally manageable" until it cost quite some time to fix bugs (multiple times then, and because of diverged code paths, with multiple different solutions)

replies(1): >>42166207 #
1. ulbu ◴[] No.42166207[source]
I think an abstraction should imply/enforce a common abstract structure. It inscribes an abstraction layer into the system. Moving a couple of concrete lines into a single named scope is orthogonal to this.