← Back to context

Comment by littlecranky67

2 years ago

As a JavaScript Dev, around 2010-2012 it was not uncommon to see `setTimeout(..., n)` hacks, often with n=0 but sometimes even n=1000, n=5000 into a codebase. This could workaround some bugs, and given the overall low-quality state of the JS ecosystem back then, often a last-resort.

And yes, am guilty too of committing this to prod back then. I think I haven't had a case where this was deployed in the last decade, but in the ugly SPA days pre angular v1 (and even during angular v1), where you code was this big glued-together conglomerate of various 3rd party UI libraries, this was common. Its ugly as hell, and you really had to be there at that time to understand this. But often it was just a cheap alternative, while debugging and fixing the truly underlying cause would be several man-days or even weeks.

My point being: It might have slipped their QA cracks and was at some point intended to workaround a bug of some obscure Firefox behavior. For a company at youtube's scale this is however pretty embarrassing.