ue6s0a
Last Updated: February 25, 2016
·
628
· hnordt
79f39dbd7c90349087908bb13ab8fb55

You are not lazy, sometimes Copy & Paste is a skill!

Whenever possible use Copy & Paste to write things like big variables and function names, that's not being lazy, it makes you more productive and help you avoid making mistakes.

It's worth noting that Copy & Paste is useful for small things, if you have to Copy & Paste a lot of code, you aren't following the DRY principle (http://en.wikipedia.org/wiki/Don't_repeat_yourself).

Say Thanks
Respond

2 Responses
Add your response

88

For learning, it's recommended that you never ever copy and paste, but rather, copy it manually, even if you're writting the exact same thing.
In my experience, and the experience of people I have worked with, if Copy & Paste makes you more productive, it's because the application you're writting code for completely lacks a decent design.

over 1 year ago ·
92
79f39dbd7c90349087908bb13ab8fb55

You are right lautarodragan, it's called DRY principle.

I think I expressed myself wrong, what I meant is that in some cases the Copy & Paste is useful, not necessarily to copy all the code.

For example, if you have declared averybigvar it's best to copy & paste to avoid typo like avrybigvar.

(PS: I've updated my tip)

over 1 year ago ·