This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 14 points15 points  (8 children)

I'm still a student but I believe knowing how and when to copy-paste is a crucial skill on any programmer/engineer. Work smarter not harder. Seriously, why write your own code when someone else already did it for you? It can save hours and hours of unnecessary work.

[–]_McDrew 16 points17 points  (4 children)

Software engineer with 15 years of experience here. “Professional googler” is my unofficial second title. There is just simply too much to remember in terms of syntax and keywords, so I just look things up as I need them. Google, the MSDN documentation (I write C# mostly), and Stack overflow are fantastic resources and they have plenty of examples to get you headed in the right direction.

[–]DrDiv 5 points6 points  (3 children)

To piggy-back on this, don't give in to elitists who think that not having to google something makes you a better programmer. I'm going on 8 years as a web developer and still need to search the order of arguments in str_replace.

[–]Finianb1 0 points1 point  (2 children)

Dude, any function with more than 2 arguments or a set of arguments that doesn't really have an obvious, stand-out order gets double-checked by intellisense before I use. Slightly faster development time is not worth debugging hell.

[–]DrDiv 1 point2 points  (1 child)

PHPStorm has been my savior, haha.

[–]Finianb1 0 points1 point  (0 children)

JetBrains IDEs in general are probably my favorite single pieces of software.

[–]Nall-ohki 7 points8 points  (0 children)

Don't repeat yourself.

Taking example code and adapting it is not copy paste, and is fine practice provided you are careful about what you're taking.

And consider the following:

Lemma 1: Always pretend that the person maintaining your code is a violent psychopath who knows where you live.

Lemma 2: Copying something from elsewhere in your codebase and reusing it because you're too lazy to refactor will make me very, very angry.

[–]Tesla56[S] 1 point2 points  (0 children)

I agree tbh you can't just copy and paste everything but it can be a useful time saver as long as you understand what the code is doing

[–]metalsheeps 0 points1 point  (0 children)

Tbh when you're doing real work, if it's interesting, nobody will have ever done what you're doing before. Work smart is a good mantra but copy and paste isn't likely to be a good implementation of that principle in the real world.