I really wonder who those folks copy-pasting from Stack Overflow all day are. I only rarely find pieces of code that I can copy-paste. Typically Stack Overflow only gives me an idea of how to solve something, but incorporating that idea into my code base is still not trivial.
A few weeks ago someone on a call said "we all know that programming is mostly copy and pasting anyway" A few people laughed, but I said that if I catch myself copy and pasting then I know that something is very wrong. It was kind of awkward, but I didn't like my job being trivialized by people who never really did it.
It would be like if I said plumbing or auto repair is just watching youtube videos and going to lowes. Just because I've managed to do a few simple things, doesn't mean I'm in a position to belittle an entire profession.
That said, I am also shocked by how many full time developers don't take the time to understand their own code. Let alone the libraries they use.
> That said, I am also shocked by how many full time developers don't take the time to understand their own code. Let alone the libraries they use.
Me too, then I understood that code and programming is commoditized. As long as it works and looks pretty on the outside and it can be sold, it's fair game.
"There'll be bugs anyway, we can solve these problems somehow" they probably think.
Heck even containers and K8S is promoted with "Developers are unreliable in documenting what they've done. Let's make things immutable so, they can't monkey around on running systems, and make undocumented changes" motto.
I still run perf on my code and look for IPC and cache trashing ratio numbers and try to optimize things, thinking "How can I make this more efficient so it can run faster on this". I don't regret that.
I am one of those. Unless it’s a few lines of standard library calls for the behavior I’m seeking, If I am copy and pasting a function over its as a template.
I then modify the majority of the answer to fit any special criteria outside of the general case I asked, or more frequently, modify the code beyond the minimum viable answer to fit in the test suite/logging framework/performance monitoring/etc that is involved in my platform
Still call it copy and pasting in casual conversation even if there’s not a single line that’s recognizable between where I started in stack overflow vs where I ended up
I always look into the internals of libraries I use, it's usually easier, and faster than reading the documentation. Sure, there are some libraries that so advanced that it makes this difficult, but you should still know what it's doing, and how the code is organized.
The idea of an abstraction layer is to make it easier to read and write code that is at a different layer. Many of us write our own abstractions, it's not because we don't understand what its doing.
> I really wonder who those folks copy-pasting from Stack Overflow all day are.
I can think about people who can do this happily. Some of them are professional programmers. Some are self-taught. Some have CS education. Seriously.
OTOH, I'm similar to you. I either re-use my own snippets or read SO or similar sites to get an idea generally how a problem is solved and adapt it to my code unless I find the concept I'm looking for inside the language docs or books I have.
There is certainly a balance. When I want to implement feature X a client has requested but I have to deal with home grown database abstraction layers and custom AJAX API structures - I get the feeling that a third party library probably does it better and has more eyes on the code than exist at my company.
That said I would probably not look to a third party library to just to simple data transformation stuff. Probably the only thing I do copy almost verbatim from SO are things like Awk/Sed commands that are easy/low risk to test but would take hours to derive myself.
Thank you! I've never understood this meme about copy-pasting. I honestly rarely end up using SO and when I do, I almost never copy paste from there. It's not because it's some kind of weird principle I have - I will copy paste if I think it makes sense - it's just rare that I want the exact thing they have written there (it's in JS and I'm using TS, it's using another library than I am, etc) and generally I'm looking for information rather than code.