5 ms·
I copy and paste code all the time. I'm in the business of getting shit done, not learning everything ever, I don't need to learn the ins and outs of some obsc
by soup10 12y ago
I copy and paste code all the time. I'm in the business of getting shit done, not learning everything ever, I don't need to learn the ins and outs of some obscure algorithm I'm only going to use once. I also don't need to memorize Apis and boilerplate for technologies I rarely use. Of course once i'm settled into a domain I don't need google anymore. But it's invaluable for quickly diving into new stuff.
- Swizec 12y agoPlease never stop doing this. I get paid $$$++ to swoop in after people like you are done and whole teams grind to a halt productivity-wise because the codebase is so bad. You are doing god's work, son. Thank you.
- nomedeplume 12y agoplease define $$$++?
- Strom 12y agoIt means 'lots of money'.
- nomedeplume 12y ago...."lots of money" varies from community to community.
- dkersten 12y agoWhich is why saying lots of money if more useful than specifying an amount, because that amount may or may not be a lot of money where the reader is from, but might be a huge amount where the person who posted it is from.
- Swizec 12y agoWell, you take a dollar amount. Then you increase it. Then you increase it some more. Because companies who can afford it will pay you pretty much anything if you can make their whole engineering team even just a few percent more productive by improving the codebase. Or can figure out very hairy issues caused by Daily WTF style situations. For example, I have a friend who sometimes fixes bugs in compiled software running banking systems with no access to the original code and woefully out of date documentation. He gets paid some 300eur an hour in a country where the median developer salary is only about 30k eur per year (about 14eur/h) Sure, that particular type of problem likely/hopefully isn't caused by copy-paste programming, but it is caused by the sort of endemic issues copy-paste programmers to produce.
- nomedeplume 12y agoThanks for responding with a specific $ amount. I do indeed appreciate it.
- chubot 12y agoMan... can I ask what led a company into the situation where they need to fix software without source code access? Did they rely on a vendor that went out of business? I imagine it is ancient software from the 80's or 90's?
- Swizec 12y agoI don't know the whole story, but seeming as this was banking software I wouldn't be surprised if it was indeed written some time in the 80's or 90's and the original developers were nowhere to be found.
- nomedeplume 12y agoi know it's not your first language but since you mentioned you like to think and understand things, the correct syntax is '80s and '90s; the apostrophe is used to indicate letter omission. incidentally, my first language was basic. didn't want to omit that :)
- twelvechairs 12y agoYou are being offensive here - going all as hominem rather than actually demonstrating any reason parent comment is wrong.
- Swizec 12y agoYou missed this part of the post then: > whole teams grind to a halt productivity-wise because the codebase is so bad
- jesusmichael 12y agoI've seen that more from guys that "start from scratch" than guys who cut and paste... most guys who cut and paste also annotate and comment... most geniuses can't be bothered to both code and comment...
- randac 12y agoDon't be ridiculous. That does not make "You are doing god's work, son. Thank you." any less ad hominem, nor do you actually demonstrate any reasons. Your argument amounts to "copy+paste coding is bad, therefore your codebase is bad", yet at no point explains why. But keep downvoting anyone who points that out :)
- dannypgh 12y agoAn ad hominem argument is one in which you reject a position not on its merits but because of who is making it. They took a position that copy/pasting code leads to unmaintainable code, therefore his argument is not ad hominem. He's being insulting, sure, but that doesn't mean he's making an ad hominem argument.
- twelvechairs 12y agoIt is ad hominem. The ad hominem part is the part which infers the parent poster makes whole teams grind to a halt and also earns less than himself.
- deleted 12y ago
- soup10 12y agoLol my code base is fine thanks. Maximizing productivity and writing maintainable code are not mutually exclusive.
- jacquesm 12y agoNow I need to go buy another keyboard. Thanks :) To the GP: Swizec has it, please don't stop.
- lotsofmangos 12y agoThere is a fair amount of code you should copy/paste unless you are doing pure research, some because it has been so well studied it is almost a certainty that you are not going to drastically improve on it and others, such as encryption implementations, because it is actively dangerous to fuck about with unless you are extremely careful and a domain expert.
- cheald 12y agoIf you're copy-pasting encryption implementations rather than using an existing library, you're probably doing it wrong.
- lotsofmangos 12y agoWell yes, but libraries are really just an advanced form of copy/pasting and you can still do damage by using the library incorrectly, so you often end up using sections of examples by the people who wrote the library or who are otherwise experts in its use on how to implement the library correctly.
- cheald 12y agoSure, you can argue that library use is copy-pasting, if those snippets you're pasting come with regression tests and have been code-reviewed by multiple people. I'm going to go ahead and suggest that a tremendous number of encryption mistakes are made specifically because people copy-paste library invocations without understanding what they're invoking and why. When you just sling a chunk of code into a project without understanding what you're doing and why, the potential for bugs goes through the roof.
- lotsofmangos 12y agoI agree that you need to understand what you are doing and why. I'm not saying that these bits should be treated like magic, just that you should think very carefully before you differ from them by very much.
- deleted 12y ago[deleted]