News for hackers. Stuff that matters.
Re:The Wrong Abstraction (2016) by Tainnor on Sunday July 05, 2020 @05:13PM (#23742047)
I can't judge that without more context. If this is just accidental duplication, it's pointless to abstract it away. But if it's a line of code that is necessary to deal with some gotcha of a particular library etc., it's probably good to extract and add an explanatory comment.
Re:The Wrong Abstraction (2016) by dave_sid on Sunday July 05, 2020 @07:58PM (#23743320)
“Accidental duplication” well said. Not enough people even consider this before deciding that they must remove the duplicate code. Will each duplicate section change for the same reason? If not then it’s not really duplicate code, it just looks the same.