4 ms·
I really wonder about the usefulness of implementing a language feature to reduce the need to copy paste in an editor.
by wisnoskij 4y ago
I really wonder about the usefulness of implementing a language feature to reduce the need to copy paste in an editor.
- mcronce 4y agoGenerics are a language feature to reduce the need to copy and paste in an editor. For that matter, functions are a language feature to reduce the need to copy and paste in an editor.
- wtetzner 4y agoReally? You don't see the problem with trying to maintain code that's been copy-pasted everywhere with slight differences? Doesn't it seem easier to maintain one implementation of something than N implementations?
- cercatrova 4y agoIsn't that basically all language features? I could also write print("Hello") print("Hello2") print("Hello3") print("Hello4") print("Hello5") (which I partially copy-pasted above) but I use a for-loop instead.
- pyrale 4y agoAs a library maintainer, you can't copy-paste a line for a type that isn't written yet. As a library user, you can't copy-paste a line for a type you just created in a library you don't maintain. Being able to do what you describe lets a maintainer create an interface for all the future types that satisfy given requirements.