http://www.perlmonks.org?node_id=138116


in reply to The first cargo cults

Well I'd venture to say that it's not ALWAYS a bad thing to cut and paste code (certainly not if you understand it and wrote it yourself).

Okay, a confession: I cut and pasted a lot of code when I first started Perl (that includes typing what I found in a book). My first project (and the reason I learned Perl) was to make a guestbook MY way. My reference was the Black Book of Perl - informative, but horribly organized. The only code I used for reference was the Ultimate Bulletin Board (UBB), yes THAT one.

About half of the code was my own, and about half was some sort of copy job which I vaguely understood. The guestbook worked, which was good enough for me.

Months pass, and I tend to hack Perl on a daily basis. I decided to go back to the guestbook to add a feature. I was somewhat horrified what I found in there, but needless to say it was a mess. I endeavored to fix it, and in the end it's far better then the cut and paste patch job. It's also a good feeling when you surpass the things that taught you.

So in a nutshell, sometimes 'cut and paste' makes a good crutch. Just keep in mind that in the long run, it will eventually hold you back - and it's certainly no substitute for learning the language.