Copy and Paste is the work of the devil
-
It is even more devilish if you copy and paste your own code. It's down right perverted, I tell you. :sigh:
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011) -
It is even more devilish if you copy and paste your own code. It's down right perverted, I tell you. :sigh:
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011)Then call me a heretic. Copy/paste isn't so bad if you pay attention. I keep a few snippets/scripts at the ready. They tend to be special cases that don't lend themselves well to the "Correct Way"™... and (by design) they never compile. That keeps me from being stupid once the caffeine runs low.
-
I avoid copy/paste by using cut/paste/paste. I basically paste back the original contents and then paste again to make the duplicate. This way I never have to Ctrl-C, it's always Ctrl-X for me. :-D
Regards, Nish
My technology blog: voidnish.wordpress.com You've gotta read this : Using lambdas - C++ vs. C# vs. C++/CX vs. C++/CLI
That is my preferred method, as well. :-D
Just think of it as evolution in action.
-
Ctrl, X, C, V...the most popular keys on my keyboard! I usually keep on or two Notepad windows available for scratch areas or to remove formatting.
"Go forth into the source" - Neal Morse
-
It is even more devilish if you copy and paste your own code. It's down right perverted, I tell you. :sigh:
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011)There is a new awesome CodeRush functionality that can scan your code (C# or VB.NET) in the background for duplicated code and offers to consolidate it : http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/duplicate_code.xml http://community.devexpress.com/blogs/markmiller/archive/2011/11/29/duplicate-detection-and-consolidation-in-coderush-for-visual-studio.aspx
-
It is even more devilish if you copy and paste your own code. It's down right perverted, I tell you. :sigh:
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011)Slacker007 wrote:
It is even more devilish if you copy and paste your own code. It's down right perverted, I tell you.
Depends on the context. Reuse via the library idiom requires planning, requirements, dependency resolution and education. The last by itself can often preclude usage both in small and larger enterprises. Even a simple class usage can be complicated by differing requirements. I would much rather see similar code in two places versus code in one place with is complicated by a number of conditionals in that code base which exist solely to deal with requirements for different usage (which is something that I have seen.) That latter alternative can lead to very fragile code. I continue to see well intentioned code created as real libraries based on a single usage which has no better chance of succeeding than implementing a base class based on a single child class. People can't even understand usage requirements for libraries that are used in multiple places as they will attempt to push application specific functionality into such libraries because it is related (or even just convenient.)
-
It is even more devilish if you copy and paste your own code. It's down right perverted, I tell you. :sigh:
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011)I mostly use it for copying long variable names, but even that is rarely necessary thanks to great tools like VisualAssist. When copying entire lines of code it's usually no more than 1-2 lines, i. e. not enough to trouble myself with extracting a separate function. I do see the effects of 'evil' copying code though: parts of our application date back to the times of the structured programming paradigm, and there are lots of functions that are 95% identical to others, and it is a real pain when I need to change something within one of those, because it's often hard to locate the 'evil twins'.