Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Copy-and-paste programming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Origins == Copy-and-paste programming is often done by inexperienced or student programmers, who find the act of writing code from scratch difficult or irritating and prefer to search for a pre-written solution or partial solution they can use as a basis for their own problem solving.<ref name="inexperienced"> {{cite journal |url=http://portal.acm.org/citation.cfm?id=1272896&dl=GUIDE&coll=GUIDE&CFID=30889213&CFTOKEN=55540185 |title=Revisiting Novice Programmers Errors |year=2007 |publisher=acm.org |doi=10.1145/1272848.1272896 |accessdate=2008-06-04 |last1=Yarmish |first1=Gavriel |last2=Kopec |first2=Danny |journal=ACM SIGCSE Bulletin |volume=39 |issue=2 |pages=131β137 |s2cid=8854303 |url-access=subscription }} </ref> (See also [[Cargo cult programming]]) Inexperienced programmers who copy code often do not fully understand the pre-written code they are taking. As such, the problem arises more from their inexperience and lack of [[Extreme programming#Courage|courage in programming]] than from the act of copying and pasting, per se. The code often comes from disparate sources such as friends' or co-workers' code, [[Internet forum]]s, open-source projects, code provided by the student's professors/TAs, or [[computer science]] textbooks. The result risks being a disjointed clash of styles, and may have superfluous code that tackles problems for which new solutions are no longer required. A further problem is that [[Computer bug|bug]]s can easily be introduced by assumptions and design choices made in the separate sources that no longer apply when placed in a new environment. Such code may also, in effect, be unintentionally [[Obfuscated code|obfuscated]], as the names of variables, classes, functions and the like are typically left unchanged, even though their purpose may be completely different in the new context.<ref name="inexperienced"/> Copy-and-paste programming may also be a result of poor understanding of features common in computer languages, such as loop structures, functions and subroutines.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)