Tech IndustryApr 16, 2019

Copy/paste culture at FB

This is my first job as an employee. I’ve always been a contractor before this. Facebook engineering has a strong copy/paste culture between apps. This is in the name of moving fast, which is an admirable goal. However, I’m not used to it. Do other FAANG companies have the same sort of engineering culture?

Add a comment
Uber zippedy Apr 16, 2019

No, not at all

Castlight Health whaaaaaat Apr 16, 2019

That explains a lot.

Facebook this.sucks Apr 16, 2019

Pretty sure u r not an engineer and don't understand what op is talking about

Castlight Health whaaaaaat Apr 16, 2019

I understand that you should be extracting good code to common libraries. I also understand that you guys have huge outages. Sounds like bad engineering to me.

GrubHub dvydnusni Apr 16, 2019

What do you mean exactly by copy/paste culture?

Facebook mxmn OP Apr 16, 2019

When building a new feature, you’re encouraged to copy and paste from other apps. This lets you move faster, but you don’t understand the code you’ve copied. This is generally thought of as a bad way of coding, but it seems to be working here, and for some of the employees.

GrubHub dvydnusni Apr 16, 2019

Repurposing code is sometimes efficient to get quick turn around I don’t see anything wrong with it- I guess “copy understand and then paste” is the culture you should induce.

LinkedIn EAM Apr 16, 2019

Reusability is a big factor of craftsmanship at LinkedIn.

Amazon Zingo Apr 16, 2019

Y i k e s

Twitter 🔥🔥🔥/ Apr 16, 2019

Why copy paste? Extract the common code/feature and let both apps depend on that common library.

Amazon vLfK28 Apr 16, 2019

They don't teach that on leetcode

Microsoft jT47lg Apr 16, 2019

If you want to make a profit you must reuse stuff. Not understanding what you’ve copied and its suitability for the task is a different problem. If you’re just trying to get to the AB testing phase and expect to throw away a lot of stuff along the way, then you really have to copy stuff often.

Google shito Apr 16, 2019

There is a big difference between copy paste and reuse. Copy paste usually means copying the same feature and checking it in. It's a terrible thing to do, as the improvements in the original code don't get ported here. If you find a bug, you will potentially have 20 places to update the code. If you skip updating others, other teams may face (or notice) the exact same bug you faced soon and spend debugging time only to reinvent the debugging cycle. Always remember debugging in production is costly (more time - as you have to often fix data) than development bug fixes or feature updates. Reusable code, on the other hand is great. It may mean as part of reusing, you may refactor some code so it is generic enough to be reused in many places. This is both Noble goal and helps productivity long term. It also prevents reinventing the wheel. The flip side of it is that if the code is changed elsewhere, your code may break. The way you get around this problem is continuous integration and unit tests. What are you referring to?

Google Bergey Sin Apr 16, 2019

It really depends. I used to be dogmatic about never copying and pasting, but for short snippets (say, less than 20 lines), copying and pasting is often better than creating complex dependencies between different projects to save reusing one tiny method. I would never advocate copying and pasting a 300 lines library though.

Google catburglar Apr 16, 2019

Not at Google.