pippellia on Nostr: my 2 sats about abstraction. I understand the itch about taking some piece of code ...
my 2 sats about abstraction. I understand the itch about taking some piece of code and making it more general, more abstract, however I try to resist it as much as possible. Why? Because it inevitably adds more complexity, it requires more effort to understand and debug. My rule now is that I abstract only when I have repeated the same code 2 or 3 times.
No-one will be confused by repeated code, which is not the case for an abstraction that doesn't fit or is premature.
Published at
2025-02-16 10:06:56Event JSON
{
"id": "10b96bc83ab37e137692416a3f08344310b7292f8764ae34f8d0610570b20560",
"pubkey": "f683e87035f7ad4f44e0b98cfbd9537e16455a92cd38cefc4cb31db7557f5ef2",
"created_at": 1739700416,
"kind": 1,
"tags": [
[
"p",
"f683e87035f7ad4f44e0b98cfbd9537e16455a92cd38cefc4cb31db7557f5ef2"
],
[
"p",
"06639a386c9c1014217622ccbcf40908c4f1a0c33e23f8d6d68f4abf655f8f71"
],
[
"e",
"216e96b48e5186b8fe8f9942482f18d0267051df8aec8af7a53588abb017e8ec",
"ws://192.168.18.7:7777",
"reply",
"f683e87035f7ad4f44e0b98cfbd9537e16455a92cd38cefc4cb31db7557f5ef2"
],
[
"e",
"20643eec3effa34a31d1a32e777fa9f322c1870e063e02046566bc3c4e90c051",
"wss://feeds.nostr.band/lang/en",
"root",
"06639a386c9c1014217622ccbcf40908c4f1a0c33e23f8d6d68f4abf655f8f71"
]
],
"content": "my 2 sats about abstraction. I understand the itch about taking some piece of code and making it more general, more abstract, however I try to resist it as much as possible. Why? Because it inevitably adds more complexity, it requires more effort to understand and debug. My rule now is that I abstract only when I have repeated the same code 2 or 3 times.\n\nNo-one will be confused by repeated code, which is not the case for an abstraction that doesn't fit or is premature.",
"sig": "966bb58f636336661a9057988ede6a15f1e29f5e74da0bae9161442713f8804e7b912ae833d31a6140402fbcf70166e7ef8f3b005a386d29691b965adaf83c71"
}