Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Copy-Paste Coding Culture

Copy-Paste Coding Culture

Scheduled Pinned Locked Moved The Lounge
helpquestion
31 Posts 26 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jacquers
    wrote on last edited by
    #1

    I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

    W M M D P 18 Replies Last reply
    0
    • J Jacquers

      I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

      W Offline
      W Offline
      W Balboos GHB
      wrote on last edited by
      #2

      All you need to do is spend some time looking at "Q&A" to answer your question.

      Ravings en masse^

      "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

      "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

      1 Reply Last reply
      0
      • J Jacquers

        I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

        M Offline
        M Offline
        megaadam
        wrote on last edited by
        #3

        I have to admit that I'm guilty of this... exactly like you!

        ... such stuff as dreams are made on

        1 Reply Last reply
        0
        • J Jacquers

          I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

          M Offline
          M Offline
          Marc Clifton
          wrote on last edited by
          #4

          Jacquers wrote:

          It works, but you don't necessarily understand the solution.

          There's two categories. First, are code snippets for doing something I'm too lazy to figure out on my own and/or don't want to read through reams of MSDN documentation to figure it out. Those code snippets tend to be no more than 50 lines long (usually 1-5 lines) and I always look at the code to understand it, particularly as there are minor tweaks that often need to be made, anything from styling to turning it into a more general purpose function that I can add to my toolchest. The second category is "this is a cool package." Examples include FluentMigrator, NewtonsoftJson, FluentCommandLineProcessor. This is the "copy and paste" an entire project into my code base. No, I don't use Nuget unless absolutely necessary. Any open source package I clone and make sure that I can build it from the source. If it has too many warnings, doesn't compile with C# 7 / .NET 4.7, builds only with x86 rather than "Any CPU" or has other issues, it's rejected. Once it passes that basic test, I don't look very carefully at the source except perhaps out of curiosity because it's too much effort to get into the thinking of the developer, however I do peruse the file structure and class structure to get a comfortable "ok, this looks well thought out" feeling.

          Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

          1 Reply Last reply
          0
          • J Jacquers

            I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

            D Offline
            D Offline
            Dan Neely
            wrote on last edited by
            #5

            I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

            Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

            J 1 Reply Last reply
            0
            • J Jacquers

              I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

              P Offline
              P Offline
              PeejayAdams
              wrote on last edited by
              #6

              I think it's fine in certain circumstances. If I need to do something that's way outside my usual scope and not something I'm likely to ever do again, I'm perfectly happy to "borrow" a few lines of code but I still like to refactor it a little and tidy it up along the way. That way I might not be getting a particularly deep understanding of the code but at least I'm figuring out what's doing what. If it's something that I do need to know, my preferred method is to just read a few code samples and then write it for myself. I do despair when I see people paste in what is obviously meant to be illustrative code ("myConnectionString", "yourObject", "//Do whatever you need to do here ..." etc.) and leave it in its original form.

              98.4% of statistics are made up on the spot.

              1 Reply Last reply
              0
              • J Jacquers

                I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                F Offline
                F Offline
                F ES Sitecore
                wrote on last edited by
                #7

                Me copy and paste code? I'm so hardcore I disable Intellisense.

                D 1 Reply Last reply
                0
                • D Dan Neely

                  I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                  Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

                  J Offline
                  J Offline
                  Jacquers
                  wrote on last edited by
                  #8

                  Well done sir :thumbsup: :laugh:

                  1 Reply Last reply
                  0
                  • J Jacquers

                    I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                    Kornfeld Eliyahu PeterK Offline
                    Kornfeld Eliyahu PeterK Offline
                    Kornfeld Eliyahu Peter
                    wrote on last edited by
                    #9

                    The problem is not to Copy-Paste or not (I do it too)... The problem is accepting code into your application, you do not understand fully... To look up a solution to a new problem is probably the best way to learn, but to not research it to the very end is a crime!

                    Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                    "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                    1 Reply Last reply
                    0
                    • J Jacquers

                      I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                      OriginalGriffO Offline
                      OriginalGriffO Offline
                      OriginalGriff
                      wrote on last edited by
                      #10

                      I will use a "developed control" without looking too hard (or even at all :-O ) at the source code, provided it's from a source that I trust. But I won't copy'n'paste code - even small snippets - without understanding how it does what it does. If I don't, then I'm in the position of "then a miracle occurs" and I can't fix it in response to changes, or do it again next time something similar occurs. I do not understand the "grab random code from the internet and hope it works" mentality - it just seems counterproductive in the long term to me. I don't think it does "speed up development" - it gets you out of a hole right now, but drops you in a bigger one later on!

                      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                      D J 2 Replies Last reply
                      0
                      • J Jacquers

                        I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        As others say I'll also copy/paste code, clean it up, but I always take the time to properly understand [and improve to better fit the situation]. I'll never accept black boxes inside my source. If it's a somewhat significant "borrow" I'll leave a comment/partial url in my source referring back to where I found it and the authors name - even if I subsequently / substantially rewrite it. Why? starting from real/complete and working example: can try it, test it, and see what breaks it. once it's initially working then I'll refer to the dry msdn docs to fully understand the methods / return values / got-yas etc. After that very often I'll do a rewrite (and re-test) now that I have the "inner-mechanicals" in my head - to ensure I really do understand what's happening (and just in case it later breaks).

                        Installing Signature... Do not switch off your computer.

                        1 Reply Last reply
                        0
                        • F F ES Sitecore

                          Me copy and paste code? I'm so hardcore I disable Intellisense.

                          D Offline
                          D Offline
                          Dave Kreskowiak
                          wrote on last edited by
                          #12

                          You use an IDE? Shit, I used to write code in EDLIN. :)

                          System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                          Click this: Asking questions is a skill. Seriously, do it.
                          Dave Kreskowiak

                          M 1 Reply Last reply
                          0
                          • OriginalGriffO OriginalGriff

                            I will use a "developed control" without looking too hard (or even at all :-O ) at the source code, provided it's from a source that I trust. But I won't copy'n'paste code - even small snippets - without understanding how it does what it does. If I don't, then I'm in the position of "then a miracle occurs" and I can't fix it in response to changes, or do it again next time something similar occurs. I do not understand the "grab random code from the internet and hope it works" mentality - it just seems counterproductive in the long term to me. I don't think it does "speed up development" - it gets you out of a hole right now, but drops you in a bigger one later on!

                            Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

                            D Offline
                            D Offline
                            Dave Kreskowiak
                            wrote on last edited by
                            #13

                            OriginalGriff wrote:

                            I do not understand the "grab random code from the internet and hope it works" mentality - it just seems counterproductive in the long term to me.

                            I think that may stem from the mistaken belief that there is only ever one way to do something. A sure sign of someone who doesn't have much, if any, experience understanding algorithms and/or writing code.

                            System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                            Click this: Asking questions is a skill. Seriously, do it.
                            Dave Kreskowiak

                            OriginalGriffO 1 Reply Last reply
                            0
                            • D Dave Kreskowiak

                              OriginalGriff wrote:

                              I do not understand the "grab random code from the internet and hope it works" mentality - it just seems counterproductive in the long term to me.

                              I think that may stem from the mistaken belief that there is only ever one way to do something. A sure sign of someone who doesn't have much, if any, experience understanding algorithms and/or writing code.

                              System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                              Click this: Asking questions is a skill. Seriously, do it.
                              Dave Kreskowiak

                              OriginalGriffO Offline
                              OriginalGriffO Offline
                              OriginalGriff
                              wrote on last edited by
                              #14

                              I know what you mean, and that just makes it even weirder - since it seems to be a "yoof thing" and they grew up in a much more "no-wrong answers" education system than we did. Or at least I did - there was one right answer and you were supposed to know it rather than work it out for yourself in pretty much all subjects.

                              Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

                              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                              P M 2 Replies Last reply
                              0
                              • D Dave Kreskowiak

                                You use an IDE? Shit, I used to write code in EDLIN. :)

                                System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                                Click this: Asking questions is a skill. Seriously, do it.
                                Dave Kreskowiak

                                M Offline
                                M Offline
                                MarkTJohnson
                                wrote on last edited by
                                #15

                                EDLIN? Back in the day they only used zeroes, ones were too expensive.

                                1 Reply Last reply
                                0
                                • J Jacquers

                                  I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                                  P Offline
                                  P Offline
                                  Pualee
                                  wrote on last edited by
                                  #16

                                  It is not entirely the fault of the coders... I remember being able to find manuals accurately documenting APIs and giving examples of how to use them. Now, if I can even find the necessary documentation for something, it is just as likely to be incomplete as inaccurate. I have to rely on web searches to find code snippets where documentation does not exist.

                                  D 1 Reply Last reply
                                  0
                                  • J Jacquers

                                    I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                                    D Offline
                                    D Offline
                                    dandy72
                                    wrote on last edited by
                                    #17

                                    I'm guilty of the opposite - if I don't understand a "borrowed" solution, I'll pretty much take it apart and rebuild it until I do, so in the end, even though I have a solution that I finally understand, I often feel that I really, really, should've "just moved on" and saved myself a lot of time.

                                    1 Reply Last reply
                                    0
                                    • J Jacquers

                                      I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                                      M Offline
                                      M Offline
                                      Munchies_Matt
                                      wrote on last edited by
                                      #18

                                      WTF!!!!??? Do you? Jesus Christ, that sucks. You useless lazy F*&^$*%*r

                                      1 Reply Last reply
                                      0
                                      • P Pualee

                                        It is not entirely the fault of the coders... I remember being able to find manuals accurately documenting APIs and giving examples of how to use them. Now, if I can even find the necessary documentation for something, it is just as likely to be incomplete as inaccurate. I have to rely on web searches to find code snippets where documentation does not exist.

                                        D Offline
                                        D Offline
                                        Derek Hunter
                                        wrote on last edited by
                                        #19

                                        I completely agree with this. I really, really miss having authoritative documentation - i.e. complete and accurate.

                                        N 1 Reply Last reply
                                        0
                                        • J Jacquers

                                          I have to admit that I'm guilty of this... I need to solve a problem, so I Google, find a working solution and paste it into my code. It works, but you don't necessarily understand the solution. On the one hand having answers so easily available speeds up development, but on the other it makes for developers that don't really understand what they are doing?

                                          S Offline
                                          S Offline
                                          sir_download_alot
                                          wrote on last edited by
                                          #20

                                          Yes, mankind hasn't developed because everybody invented their own version of the wheel. We have developed because we are capable of putting things together to create new things. I copy and get inspiration from other code a lot, otherwise I wouldn't be able to keep my deadlines. I do review and try to understand the code that I copy. Sometimes I need to alter it for my specific purposes but it already saves me a ton of time not having to read all the documentation. On the other hand I'm also putting my solutions out there for others to use.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups