LWN.net Logo

Quotes of the week

If you are getting no feedback just submit it next merge window. Either its offended nobody or they've forgotten to notice - in both cases submitting it will have the desired effect.
-- Alan Cox

I'm thinking of an app which prepares pages full of scurrilous rumour, then waits around looking at its /proc/self/smaps to see if anyone else is writing stories like that!
-- Hugh Dickins ponders security threats

Well I'm sorry I hardcoded a lack of beer into the serial layer to save a microsecond, you'll have to go without.... It works for me so clearly your usage pattern isn't interesting.
-- Alan Cox

The inventor of copy-n-paste has a lot to answer for.
-- Andrew Morton
(Log in to post comments)

Copy and paste

Posted May 14, 2009 18:27 UTC (Thu) by man_ls (subscriber, #15091) [Link]

The inventor of copy-n-paste has a lot to answer for.
Having worked at a place where repeated code was the norm, situation that lead one developer to sing one day "copy-paste is a programmer's best friend" -- and to horrid quantities of unstable code, I sympathize with the sentiment. Write-and-forget code has its place though, something that eXtreme Programming proponents apparently never learned with their OAOO rule. Throwaway code is usual at least in proofs of concept, quick and dirty tools or test code.

But in general, removal of duplicate code is a worthy and interesting exercise. Lately I have discovered that Python facilities such as lambda functions or generator expressions make it much easier than in languages of the C family.

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds