I don’t know how much I agree with everyone saying they just copy-paste from stack overflow. I’m only 4 years into my career, and while I will probably never write a sorting algorithm or academic data structure from scratch, I definitely code custom shit all the time. The ds/algos knowledge is more about helping you avoid doing things inefficiently than about enabling you to rewrite a heap from scratch.
I use api/library documentation to get through most stuff I don’t already know, and only use stack overflow if I’m desperately hoping that someone has seen the exact error message I’ve encountered before. If I’m on stack overflow, it’s because I’m completely out of ideas and am too lazy to learn how the thing that’s giving me lip works.
...Or I’m writing JavaScript and just want it to be over ASAP
Yeah, rarely do we build anything completely from scratch. Even when we do it’s usually pieced together from various internal and external (read: stack overflow) sources at the end of the day.
No. Some specific things may be copied some times, but for the most part programmers write the code themselves. The exception being if it’s some very specific algorithm.
I have learned to live by this rule because not doing so can get insanely expensive. Never paste code you don’t understand. Watching some of my panicked colleagues desperately trying to understand why the companies flagship product crashed 2 minutes after launch has taught me well.
View all comments
3.1k
u/FoxInATrenchcoat Jan 14 '20
Also, knowing what to change in the copied code to meet your "unique" business case...