Why Nostr? What is Njump?
2024-09-19 20:09:39
in reply to

mleku on Nostr: templates are just complicated garbage code generators that take ages to compile, aka ...

templates are just complicated garbage code generators that take ages to compile, aka "generics", i have written dozens of code generators for teh same kinds of purposes and i could count the number of times it's been important on two hands in the last 8 years

interfaces achieve the same result but force you to actually think about it so the compiler doesn't have to spend many seconds trying to figure out what you mean when you refer to a method on a type that isn't explicitly tied to it

i have lost count of how many times i've used interfaces for this kind of polymorphism but it's also quite overrated, it's more useful for plugging modules together without needing to know the internals, ie, it helps with encapsulation

go has simple types of generics but only on value types, and they are actually handy a lot (especially between types of integers and between strings and byte buffers)
Author Public Key
npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku