r/programming • • Mar 27 '23

Twitter Source Code Leaked on GitHub

https://www.cyberkendra.com/2023/03/twitter-source-code-leaked-on-github.html
8.0k Upvotes

717 comments sorted by

View all comments

205

u/lafeber Mar 27 '23

A small API change had massive ramifications. The code stack is extremely brittle for no good reason.

Will ultimately need a complete rewrite.

Elon, 3 weeks ago

33

u/WhipsAndMarkovChains Mar 27 '23

Someone link to the recording from a couple months ago where Musk says a “full stack rewrite” is needed and a former senior engineer from Twitter presses him on the issue. The engineer asks an extremely reasonable question like “what’s wrong with the current stack and what do you want to switch to?” and Musk can’t respond.

20

u/[deleted] Mar 27 '23

11

u/lyzurd_kween_ Mar 27 '23

elon musk is so highly regarded and incompetent when it comes to actual software work, i am shocked he was able to reach the stature he currently has. right place at the right time i guess.

2

u/[deleted] Mar 28 '23

Or just it was having rich parents

→ More replies (5)

92

u/PM_YOUR_SOURCECODE Mar 27 '23

Ok, so all the engineers who had to pass BS LeetCode interviews/whiteboarding couldn’t write a flexible and maintainable codebase? Is that the conclusion here?

64

u/pale_blue_is Mar 27 '23

As someone who works at an unremarkable company and earns a wage slightly above market value, aren't you talking about basically every silicon valley startup from the past 10 yrs?

17

u/BasicDesignAdvice Mar 27 '23

Those stupid tests are at every company. I work at a household name media company making video games no where near Silicon Valley. Same shit.

221

u/Marrk Mar 27 '23

The conclusion is Musk has no idea what he's talking about

11

u/voidstarcpp Mar 27 '23

Musk has made many public fumbles speaking technically about Twitter but it's not like there's any shortage of complaints about product quality from current and former employees, including well before the sale to Elon.

→ More replies (2)

4

u/anlskjdfiajelf Mar 27 '23

I mean he called it a "code stack" LOL. Just jam together buzz words, he's so smart 😂

→ More replies (16)

27

u/TheWhyOfFry Mar 27 '23

I mean, it’s very possible that it was a brittle code base before they got well known and could be selective about who they hire. And it’s also possible the v1 api that powered external apps couldn’t be shut down because of the massive backlash it would cause, which could force Twitter to keep some bad code in there.

That said, musk probably just doesn’t understand the language it’s written nor the architecture and fired anyone who understood it. Of course it’s “brittle” when you make totally incompatible changes because you have no idea what you’re doing.

20

u/KagakuNinja Mar 27 '23

As Twitter was becoming more popular, they rewrote the system, moving from Ruby to Scala. Scala is a niche language, and depending on how it is used, can get very hard to understand, especially for people unfamiliar with functional programming.

That said, Twitter devs had a great reputation, and when I interviewed there, I got the impression that they were not FP zealots.

3

u/TheWhyOfFry Mar 27 '23

No doubt the functional paradigm and generics are beyond musk’s comprehension… let alone graphQL.

7

u/[deleted] Mar 27 '23

Yeah because lc has nothing to do with actual software engineering and who ever came up with the idea to interview like that needs to be slapped

→ More replies (3)

3

u/marcio0 Mar 27 '23

well, at least whatever error happens is not at O( n2 )

3

u/jammer170 Mar 27 '23 edited Mar 27 '23

It is very hard to generalize, but from my anecdotal experience, yes. I have worked for several FAANG companies, and while they had some competent engineers, the actual quality of some of the code bases were pretty hideous. It really makes sense if you think about it. Those that pass the LeetCode tests are more akin to architects. While they have necessary skills needed to complete the job, I wouldn't work in a building built by just architects - you need competent foremen and welders and electricians and constructions workers and so on. The same is true of programming - lots of these LeetCode programmers don't understand low level optimization, maintainability, DRY coding, etc. They think algorithmically its good and the rest is just unimportant. Mind, that isn't all of them, but anecdotally it is a notable amount and I do frequently see obvious problems that leave me shaking my head.

0

u/[deleted] Mar 27 '23

[deleted]

6

u/jammer170 Mar 27 '23 edited Mar 27 '23

Sort of. It isn't that LeetCode skills are unimportant, and certainly they are necessary, but only for specific goals. When Twitter grew extremely large, they need a team of LeetCoders to come up with a scaling solution. Amazon clearly has massive scaling needs - their LeetCoders essentially came up with the base for AWS. The thing is, they are only needed at certain points for certain problems - and the vast majority of programming projects will never need them (even at FAANG companies). However, every project needs good engineering and craftsmanship. That is a skill that needs to be tested in interviews more and needs to be a base skill every programmer, "leet" or not, should possess. "Leet" skills, on the other hand, should mostly be relegated to research teams or projects where scaling is extremely likely to be a problem (Netflix, for example, was clearly going to need to deal with scaling issues given that they would be delivering a high bandwidth product to large numbers of people, even if they never got insanely big).

What I have anecdotally seen is that FAANG companies are far too heavy with LeetCoders and lack people with craftsman's skills. They test the heck out of people for strong algorithmic and theoretical problem solving skills, but never for reliability and maintainability skills. What's more, people who are good at LeetCode are interested in that - they get bored and find the project uninteresting when the skills they were hired for aren't being used. So they either do halfhearted work on the craftsman side of things, or make every problem overly complicated so they can use those skills, which is generally counter to easily maintained code. It is far better to do a brute force search of a small data set than to implement some clever algorithm to optimally search the data, if it is likely to be only an occasional occurrence.

Mind, this is all a generalization, and I think there are some "LeetCode" skills that are way less "leet" than they are treated and if presented in the correct way could easily be used by the vast majority of programmers, and for some reason they aren't. So I am highly skeptical that these skills should be given the weight they are. Particularly since it enables interviewers to spike the difficulty of a problem if they don't like an interviewee for some random reason, or lower it to benefit some other.

→ More replies (1)
→ More replies (5)

4

u/lazilyloaded Mar 27 '23

for no good reason

Sure, but the bad reason is "because you executive types always want the new features yesterday"

2

u/[deleted] Mar 27 '23 edited Nov 17 '24

jeans apparatus gaping versed divide retire close alleged books grandiose

This post was mass deleted and anonymized with Redact

4

u/anlskjdfiajelf Mar 27 '23

Ugh. That guy bugs me so much lol. Man sucks off Elon for sport

5

u/Anomynoms13 Mar 27 '23

Accidentally removed a semicolon?

7

u/TheWhyOfFry Mar 27 '23

In scala? 🤔

4

u/KagakuNinja Mar 27 '23

They accidentally reified a kleisli.

→ More replies (1)