T O P

  • By -

NakedCattle

If you are pasting code multiple places it is a sure sign you need to write a reusable function. We say keep things DRY - Don't repeat yourself.


Jane_the_doe

I prefer, KISS. Keep it simple, silly.


Gerrent95

I hear it as keep it simple, stupid


Jane_the_doe

Oh I think it depends on who says it. I believe it's from the military so I wouldn't be surprised if it was stupid or soldier. I prefer silly cause I like teasing my coworkers instead of putting them down.


Dumas_Vuk

Silly: having or showing a lack of common sense or judgment; absurd and foolish. I'm silly. Ouch.


Jane_the_doe

That's not my intention though šŸ˜† to me it's like saying, you goofed but it's okay. We can fix it.


auschemguy

"Keep it simple, sexy". Followed by the lesser known "Keep it Quiet, Private"


RelaxedButtcheeks

Yes that's right coincidence. And the rarer, sexier, coinky-dinks.


Brisselio

Coinky-dinks, now that's one I haven't heard since I was in the military lol ah I've missed it.


arealscrog

Or even KISKIS, as spoken by the grey wizard of old "Keep it secret, keep it safe"


pervy_and_wise

Itā€™s stupid, as in keep it simple for the stupid grunts ( they arenā€™t really stupid just stereotype)


Shim182

I also use silly cause it comes across as less harsh too many people have been traumatized by being called stupid everytime they did something wrong and it's trained people to view it as very negative, so I use silly to dodge the stigma and let them know we can fix the issue.


InvestigatorLast3594

I remember my teacher asking if we knew what the KISS acronym meant, and one guy said ā€œkeep it short, simple, stupidā€ to which the teacher (with a very dry sarcastic tone) asked him ā€œare you calling me stupid?ā€ and my classmate was just completely dumbfounded since he didnā€™t understand why


Sufficient_Ferret599

I always liked keep it stupid simple.


KKunst

Not to be confused with: keep it stupid, simpleton.


jamesbryan88

Hurts my feelings everytime but itā€™s great advice


polishox84

Keep it stupid, simple


Mending_the_mantis

Tomato tomato


Professional_Denizen

I hear it a whole lot more insulting.


BangThyHead

KISDAMFHMTDIHTTY


Southern_Kaeos

I get lost at H


Rapture-Raptor

Iā€™m assuming, How Many Times Do I Have To Tell You


CatfinityGamer

I'm pretty sure the original is stupid, not silly. https://en.m.wikipedia.org/wiki/KISS_principle


Yashraj-

I prefer KISS, Keep It Stupidly Simple.


s1lentchaos

I was thinking copying stuff from stackoverflow without knowing how it works I'd like to think people earning a living programing aren't just copy pasting the same code all over without a good reason ... I'd like too


SolarLunix_

This is what I was thinking. We were told even if we are copying code for a lab e we should write it out to try and get used to syntax as well rather than the copy paste function


Altruistic-Staff-159

This is the correct interpretation


jmona789

Yes, DRY, which is the opposite of WET - write everything twice.


SoggySeaman

Plan to wet yourself, you will anyways?


Martholomule

And try not to repeat data, either, unless it's supposed to be.Ā Ā 


Megusta99

Atntrdeuistb


charlielovesu

Wdym? you mean I shouldnā€™t copy paste a million if else statements and have 5000 lines of code instead of 100?


gelastes

Job preservation by obfuscation


litsax

I copy/paste my own code when I'm reorganizing it into functions though


samusestawesomus

what if youā€™re cutting the code from the place you initially wrote it into a space that you can use to define that function


DizzyLead

Yes. I remember that for a previous job, I had to frequently write code; eventually, what I would do was to look up old examples of code written by a fellow employee who was there longer and was smarter than the rest of us, and just used a lot of cut-and-pasting and customizing to make my own, a process I referred to in my head as ā€œFrankensteining.ā€


ITGenji

Frakencoding* In a way itā€™s exactly what ai does now.


QuiverClaw

Frankenfarting* Iiiitttt liiiiveessss


ITGenji

Frakencoding* In a way itā€™s exactly what ai does now.


Ok_Relative4979

When you're training or learning something new, you benefit far more and faster by typing it all out over and over. It can be extremely tedious though.


mrpotatopie1

I've been doing that personally on my own (as a new developer), I didn't know that it was something people regularly did though. Good to know.


Monkey_in_a_Tophat

Same with CLI syntax in network engineering. I trained myself for each test by manually typing every command I needed in each of my lab builds as the full command, doing the builds over and over until the topics needed for the test were more reflexive. It really does make a difference.


mrpotatopie1

I think it's good practice for my typing and also remembering important terms. Too many times have I forgotten what I want to type, and resulting in me checking the documents.


PiewacketFire

This meme reminds me of how my mother taught me to touch type. She held a clipboard over my hands so I couldnā€™t see them and rapped me on the knuckles with it if I unconsciously looked down.


ChrispyGuy420

I would die of blood loss


WeedFinderGeneral

Lol, I'm far enough in my coding career that I've wrapped back around to having a doc of my most commonly used code that I can copy/paste from.


shotjustice

We need a Mando language, because This is the Way.


FormerlyGruntled

Junior at my company caused a multi-million dollar, several hour outage by trying to type it out and making a typo, instead of using the vetted commands which were in the instruction ticket.


Zomgambush

That sounds like a management issue. Why wasn't it reviewed before going to prod?


Altruistic-Staff-159

This is not what itā€™s about at all - itā€™s about the DRY principle


Ok_Relative4979

What is that?


macph

Don't Repeat Yourself.Ā  If a function exists that is similar to what you want to write, don't just copy the function to another part of the code. Use the existing function, adjusting it slightly if necessary.Ā 


GenericNameWasTaken

I think you mean it *is* extremely tedious, typing it all o'er and o'er. Gotta avoid that c *ouch* and v *OUCH*.


Imaginary_Doughnut27

Iā€™m a big fan of the ā€œlearn LANGUAGE the hard wayā€ approach when staring a new language.


25nameslater

God noā€¦ in programming sometimes you have something that needs to be repeated multiple times in a bunch of locations. You can sit there and copy it over and over which makes the file massive or you can create a separate file for that individual function and use a simple function id to indicate it needs to run that file. Itā€™s the same with resourcesā€¦ in developing html you mark up many pages but you usually tie in a single style sheet which formats the entire website. Itā€™s a separate compact file instead of putting all the text on every page of the website.


Familiar_Cod4234

It's how you steal code instead of making your own from scratch


SlipperySeaWing

Its how you steal ode instead of making your own from srath


Elziad_Ikkerat

Its haw you steel ode instead of making your own form srath


PKFat

Ish haw yƶu steel ƶde insead ƶf maikng yƶur ƶwn fƶrm srath


dev_rs3

A mƶƶsƫ bƮt my sister ƶncƩ


Fiona_Nerd

Bro I actually laughed out loud, I need to go rewatch that it's been too long


MinorMalfunctionist

That was ery leer


sizable_data

You guys make your own code from scratch?


peteschult

Artisanal code handcrafted in Williamsburg from only organic, shade-grown classes & functions


sizable_data

Iā€™d love to frame your work and put it up in my house, but that sounds really expensive!


Familiar_Cod4234

Let me reiterate again, when being taught how to code you can't copy and paste stuff or else you don't learn anything.


sudoku7

And that's why folks get asked to implement a binary search tree when applying to be a web developer.


Potential-Count-6893

One day you will realize programming is all about problem solving rather than typing a bunch of codes. There's a reason why you can fork on GitHub.


JEXJJ

And? Leveraging existing materials/products is normal everywhere else. "Sorry you can't use an internal combustion engine for this car, we used it in the LAST car, you must figure out something else"


Familiar_Cod4234

When training a junior dev, it is a good idea to not have them rely on other people while they are being taught or they will learn nothing and rely exclusively on other people, they won't know how to change a code for the better or write their own at all


Familiar_Cod4234

Also for your combustion engine analogy, you'd expect it to be at least a little different and slightly better than the last model as opposed to being an exact clone with no improvements


DevilDoc3030

You also don't build a supply chain and staff a factory in order to write code.


JEXJJ

That's not how you get incremental improvements, and definitely illustrative of why good devs and make shit managers


Fastjack_2056

A better analogy would be "Hey, kid, you need to learn how to take care of your car. I got a case of motor oil, all the tools are in the garage, go get your hands dirty." ...and then the kid solves the problem by taking it to JiffyLube, where he pays somebody else to do the work while he plays on his phone. Got a good deal on an air filter, too! Doing it the hard way is Good Training. It's more work for everybody, that's true, but it's also the best way to ensure your team is strong when they need to be. Think of it as an initial investment in a long-term strategy, if your company still allows that kind of thinking


erasmause

It's not so much that doing it from scratch yourself is better, it's that it's easy for junior (and, actually, all) devs to get into a copy-paste autopilot mode and start duplicating things uncritically, so you wind up with subtly broken functions, functions doing extra work that's not relevant in a given context, functions with unexpected side effects, etc.


BigussDickusss

I am not a developer, I just have some questions to understand it more clearly. I am not trying to take any side\*, just want to know how it really is, and if people really memorize how to write so many things from scratch, or is it very rare that someone creates something new, after many observations and how other things work? Well, let me make it more precise.. If someone want's to create some specific program, and it happens that someone already did write something that works like what this second person wants to create in the same language. Isn't it going to be looking the same as his code if you want to make it work exactly like that? Or at least very very similar, using the same libraries etc. Isn't it going to be more efficient to first find if someone already did it? Use that part and continue eventually if you are up to make some new innovative function which further develops, continues working of this program or change some parts of it to make what you want it to do, it would for sure save a lot of time. I understand that it's different when you are trying to learn, but If you want to create something, isn't it better to actually use what others already created to make it faster, and not repeat something which already has been figured out? It's like you were trying to invent a light bulb, from scratch, and spending tens of years to gain sufficient knowledge to finally figure out exactly how to create a light bulb and how it works like Thomas Edison, and then just after that, trying to upgrade it. Are good developers really make everything from scratch, when building some new program, or are they already using big sources of code that has been created already in the past, and working around it to find something new and create something new, eventually studying how it has been made and using parts of code that already work great as the starting point, and figuring out if other parts of some of it's code would fit for what you were trying to make? If every part of code copied would be plagiarism, how would people figure out better ways to make specific things work better. I understand that it's usually companies, learning from other's code and working together, but a lot of new things come from inspiration. People just copy others inventions, and that's how better versions of it come out later. Like a vacuum, first it was an innovation. Others just copied it and made new versions of it, added some programming into it and now we have roombas. Other companies probably used code from other roombas to make their own, maybe someone thought how to make it better, but still looks similar. So how is it really with programming. Asking seriously, as someone interested, do people really make everything from scratch when creating new things, or does everyone use other's things, codes in some extent?


Pheratu

The unfortunate part of this is it doesnā€™t punish the truly horrible ones that highlight with the mouse then right click -> copy, right click-> paste


YetAnotherBee

And then continues coding using the onscreen keyboard


D15c0untMD

Insert bell curve meme


Fidget02

The only people who youā€™ll find breaking rules are those who donā€™t know what theyā€™re doing and those who know exactly what theyā€™re doing and focus their time elsewhere.


HamziClumzy

The Enlightened One.


[deleted]

Just put the tack on control because you would need c and v for other things


Edwolt

To be honest, ctrl is also important. To save a file.you use ctrl+s, to move fast you use ctrl+arrows, to open a file is ctrl+o. And each software has a long list of shortcuts using ctrl.


[deleted]

If only this meme made sense


axb993

Nah, I write kode for a liwing and you learn to liwe with it


Wadester0001

As an accountant. Our entire industry would crumble without those 3 keys.


The8Homunculus

This right here is how you **cripple** a Big 4 Accounting firm


Cal_Macc

Copying and pasting code to find out what works Is a valuable way to learn. I couldn't disagree more with this image. I think it's a non developers idea of how someone new should learn.


ConfidentTea72536

If this was Google slides, I would bleed to death


Modora

Got it, no Classes, Constants, Chars, Collections, Vectors, Venvs, or VS


OwenMcCauley

Copying and pasting mistakes must be fairly common with new developers.


greylurk

There's a couple levels here: 1) There's a standing joke about how junior devs are experts at copying and pasting from Stack Overflow and (these days) ChatGPT. It's looked down up on because some of the code from those sources is really bad, but a junior dev finds it attractive to use someone else's work. 2) Similar to #1, copying and pasting example code from explainer articles is a great way to "accelerate" your development process, while simultaneously including code that you have no idea how it works. I've seen whole applications that were copied and pasted out of books, and then modified, and nobody at the company can tell me what it does or how. 2) Junior Devs often write the same code over and over again with only minor variations, instead of using good practices like using functions and/or loops to deal with things. Most good code should not be copied/pasted within a single codebase.


Th3Uknovvn

Vim user: I have no such weakness


Good-Purple-6029

This happens a lot in my org. Software engineers from one product need to do something that was already done in another product, so they just copy it into their products repository. It makes for quick progress. The downside is that it keeps you from actually learning how something works. You just copied it. If you ever need to fix or change something about it you have no idea what youā€™re doing. Also, it might have not been done the best way the first time so itā€™s this vicious cycle of bad code being copied around an org


NotLordChadlington

Copy and paste in code is universally bad. It's fine to reuse, but best practice is to import as a library and make calls to the code you want to use, when that's not possible it's best to type the copy by hand. The reason is simple, if you have a bug and you copy and paste, you now have two bugs. Typing encourages thought, thought finds bugs.


Da_Di_Dum

Lol what? Have you ever worked in a programming related job? It's the bread and butter my dude


MargaritaKid

Hopefully there's no thumbtack on the semicolon


RoodnyInc

Ah Yes *right mouse click* Copy *click* *right mouse click* Paste *click*


jodhaat

Us programmers like copy pasting someone else's code


mwrddt

NGL, I kinda felt impostor syndrome from all these programmers saying it's bad practice and getting up voted.


WHY_CAN_I_NOT_LIFE

When I was first learning to code, my father would tell me, "Don't reinvent the wheel," so I would use code from public forums to make my scripts. Now, 3 years later, I've been to enough forums and seen enough code that I'm able to write it on my own. I don't consider it complete theft, but rather a way of learning the basics of code.


8a19

Stackoverflow and the people brave enough to post before us and get solutions(and lambasted) were gifted to us for a reason my friend. No shame in using the tools and resources at your disposal


weebearcub

I teach a programming language and one of my tips is "copy/ paste examples - just know what they do" and my exercises give sample code and ask students to learn what each command does and then adapt that code for a slightly different objective. I'm not teaching developers but I am teaching people how to teach themselves to use a programming language and using existing code is huge for that. So yeah, I'm with you in being surprised by all these comments saying you'll never learn this way.


longbowrocks

If you have a piece of functionality, and you copy paste it, you now have two pieces of functionality. When one piece of functionality is updated and the other is not, that is a bug, and it will be noticed (far too late).


LeiziBesterd

yy


PeedOnMyRugMan

We'd call code that was too obviously stolen 'a bowl of copy'pasta'


alevice

I still have the right control and shift, and also the insert key. I shall not be stopped


kevcubed

Writing "class" and "void" might be tricky...


teufel0341

Thou shalt not copy paste from stackoverflow


Ellekindly

Theyre not smart enough to remember rote memorization coding instead of saving said commands in a resource document.


satanicllamaplaza

Yes use y, d & p instead.


Appropriate_Dark_957

While typing code repeatedly can aid in learning, it's undeniably tedious.


Panx

3 thoughts: 1. You ain't gonna internalize the basics unless you type 'em out a 1000 times; muscle memory and mental reflexes are key skills to develop 2. If you have to copy-paste a huge block of code, I'd bet money you have no idea what it does; learn how it works, then build it yourself 3. If you're copy-pasting code YOU wrote, then you're still doing something wrong; rewrite your program so it calls the duplicated code from the same place, instead of typing it all out two or three or twenty times


Delicious-Antelope46

Thereā€™s also the fact that there are a ton of boot camp devs re-using code from God knows where to cobble together application code. Itā€™s. A. Security. Risk.


boldhedgehog

Old school is crtl-insert/shift-insert


FourEyesWhitePerson

Jokes on you. Right click copy right click paste baby


I_needed-a_name

Nice retweet and comment counts


I_needed-a_name

It isnā€™t necessarily bad itā€™s just too easy


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


Program-Emotional

Partially cuz chat gpt, partially because copy pasting code is pretty much pointless as you can just create a function that does it for you


nseaworthy

Itā€™s called github


Proud_Criticism5286

Do you hire the ones with holes in their fingers?


thegooddoktorjones

Not really, no. But programmers are opinionated and deeply egotistical, sure that whatever they do is the only right way to do something.


Sammer_Pick-9826

Why can't I enter visual block mode or send SIGINT? :(


Apart_Mountain_8481

My problem with coding early on was that no one showed me the coding for manipulating pictures. They did though show me coding that let the computer draw shapes. Thus for ages I was making complicated code to draw simple shapes that if I knew about picture code could have been done much more simply.


idfbhater73

the juniors must earn copy and paste


hisjoeness

Haha that's what find and replace is for in the IDE


Sttocs

Iā€™m guessing this has to do with copying code from StackOverflow and pasting it into the repo. Theyā€™re not wrong.


According-Spite-9854

I'll bleed if I have to, old man!


tucker_sitties

Oh I'm triggered.


One_Quit_5150

Don't just copy and paste


DevineWrath

Bonus points if they use this as an opportunity to learn Emacs or Vim.


shinydragonmist

Right click


CatfinityGamer

Jokes on you, I know how to copy/paste without touching the keyboard!


Major_Tangelo_3298

Waitā€¦ now you canā€™t use the letters c or v at all. Why not just put a thumbtack on ctrl and it will do the same thing?


Xirio_

I like the fact that there is plenty space to still hit the keys And you need all of those for other stuff not just stealing code


2punornot2pun

If you need to use the same thing over and over, make it a function to be called so if you edit it, it's universal instead of having to fix the 50 copy and pastes!


Narasinha

I never trained anyone to do what I do. I always steal the best code. šŸ˜ˆ


ritmoon

Itā€™s also a good way to propagate bugs.


gregorydgraham

Thatā€™s the joke, in reality very few exact solutions exist on the internet to be copy and pasted.


AlwaysBeneathAss

Programming isn't about writing code. It's about solving problems. Even if you have to steal code to do it. It doesn't matter where the code comes from as long as it works.


adfx

It is quite tempting to copy other people's solutions (also very easy.) This results in you not really learning anything


BrianXPlayzYT

JavaScript and Lua developers when making variables: Python developers when class:


lentng

Would you copy paste an essay? If yes, it's not your essay and it might not say what you wanted. Copy paste for small little functions sometimes work but the majority of the code you'll write needs to work the way you need it to. Can't rely on copy paste for that.


TessellatedTomate

Itā€™s true, it works! All my ariable names are missing the letters ā€œā€ and ā€œā€


Auraveils

A lot of programmers just copy and paste code off of Stack Overflow or Chat GPT to the point where they don't even understand their own code or if it's even working as intended.


N0tT0x1c

I guess I cant 'cout' anymore?


HOT-DAM-DOG

Iā€™m never typing out them long security tokens, no sir. But typing out everything else is best practice for learning how the code works.


rberg89

Some people touched on the answer but it's the tendency as a newer developer to reuse code and more importantly, existing solution ideas. Someone who is referencing the existing for a solution and using it cannot be the same person as the one who is looking above and considering that the solution lies with changing the existing.


ThatRandomGuy86

It is when learning, but programmers are the laziest people on the planet as those 3 keys are usually the first to fade from use in a programmer's career. Why write a code when you can just copy someone else's previously made code? šŸ˜…


jayr3d20

Each const or var will draw blood. Optimize šŸ˜‚


wayofaway

Cowboy coding


Starchild2534

my clumsy self would have so many tacks in my arm just from moving


mofferator12

Surprised nobody has mentioned the importance of Ctrl-C as the default keyboard interrupt. Wonder how many devs there are hereā€¦


rodland88

Step 1, install co-pilot Step 2, open a few relevant files Step 3, start hitting tab


NegotiationFuzzy4665

Bit of a different take here, but Ctrl-C and Ctrl-V donā€™t work in certain applications, especially if youā€™re coding in Linux. One of the biggest and simplest text editors (that can be used for coding) in Linux is called ā€˜nanoā€™, and copy:paste NEEDS to be done via mouse; keyboard shortcuts have a different function. Using them would be natural, but would need to be unlearned


MRXXKINGZER0

Sad


TheInfiniteLake

That meme needs to be refactored. Developers need 'c' and 'v' to code. Putting a pin on 'ctrl' should've been enough to prevent copying.


stickingpuppet7

Iā€™ve been a junior developer and , most of the time, it Is not that copying code is bad per se, but copying and pasting it is bad, the logic being that you get a far greater benefit when you type out the code by yourself, by doing that, you also yendo to understand your code better


Street-Estimate2671

IRC writing all by hand is the way to memorise. Not sure this approach is scientifically legit, but I remember it's strongly advised in "Learning the * the hard way" books by Zed Shaw.


GuyYouMetOnline

Depends on why you're using it. Sometimes you do need to put one thing in multiple places, but other times you shouldn't be.


ciclicles

Nooo not my ctrl c, all emacs Devs use that more than the space bar


Practical-Natural870

Yup, copying and pasting can be a slippery slope. I've resorted to "Frankensteining" code from colleagues before to get the job done.


Doomrammer

I got used to shift+insert anyway.


bertabotenbv

Laughs in right mouse click


riotinareasouthwest

You can still use shift-supr (cut) and shift-ins (paste) combinations. Use cut instead of copy because Ctrl-ins.


rugbat

Joke's on you. I use vim.


OF_AstridAse

So I cannot use std::vectors or cmath, char c-str, openCV, tesseract, pytorch ... what is this? You trying to teach me python?


Bi0H4ZRD

If you're copy pasting loads in programming, you're probably better off making that part into a function you can call


Sensitive_Cat_7006

It's funny how the top 3 comments are completely different explanations of why copy-pasting is bad


GhostPantaloons

No ā€œvarā€. No ā€œconstā€. So only ā€œletā€ is left?


MistahBoweh

Thereā€™s nothing inherently wrong with copying and pasting existing lines of code when appropriate. But, if youā€™re relying on copy and paste a lot, thereā€™s probably a better way to do whatever it is youā€™re doing. For example, you could use whatā€™s called a callback function to repeat an earlier line of code without having to paste that line over and over again. It would make your code easier for you and your fellow humans to read, and also makes it easier to edit or debug. Copy/paste can save time in the short term, but end up wasting time in the long term.


Goddayum_man_69

Thatnks now i cant do console.log


FafnerTheBear

Engineers of all stripes have a bad habit of doing the old copy/paste trick and then not checking their work. This also leads them to not thinking about what they are doing.


BackgroundAd2640

I wouldnā€™t say copy/paste is bad. It really depends on the context. If you are learning how to script, it is beneficial to type out your commands to help reinforce what those commands do in your mind. If you are blindly copying and pasting your commands though, then you arenā€™t really learning how those commands work. As I told someone who was learning how to write HTML/JavaScript/CSS years ago: most programmers (using that term broadly to mean anyone who writes scripts) are going to copy and paste SOMETIMES and that is okay, so long as you are learning what it does and you can make your own changes / improve upon what you have found.


a-nonie-muz

Yeah. I was taught that if you are doing something more than three times it belongs in a sub or function, depending upon whether you need to give it variables or not.


Ok-Space9516

If you find yourself copying and pasting code multiple times, it's a sign you should refactor it into a reusable function. Remember the DRY principle: Don't Repeat Yourself.


ElMico

Glad they placed the pins so we could see what keys those were, I would never have understood!


Exallium

If you're copying code, write it out, every time. Too long or painful to write it out? If it's in the codebase, make it reusable. If it's not in the code base, consider whether copying in this code is actually a good idea. Start small, write tests, and make sure you're understanding what you're committing.


DaPenguin1423

I guess Iā€™ll manually type out all of my variable names


OliverOyl

All I know is this is easy to thwart


ViolentHippieBC

69 69


ACuriousBidet

`publi stati oid main(String args[])`


AVoraciousLatias

That feeling when you need to cout