Couldn't basically anyone with a passing familiarity with coding write a clone of twitter?
Eh, not really. Someone who just finished intro to web development could probably make an app that lets people post short-form text snippets to a relational database, and shows these posts chronologically to followers upon request. It would run on a single server supporting perhaps a few thousand users.
Twitter is not that. Anytime you need to scale an app across thousands of machines running in multiple data centers, that requires some specialized skills above and beyond intro to programming. These are skills not unique to ex-Twitter engineers; Meta already had plenty of folks who can do that.
No, where the potential trade secret violations come into play is because Twitter is not just an app that shows you a chronological list of tweets from the people you're following. It has an algorithm to decide who sees what and when, finely tuned over many years to maximize engagement on the platform. Who you're following is just one of the inputs to this algorithm; you won't be shown everything the people you're following are tweeting, and you
will be shown some tweets from people you're
not following. Which ones to show? Why? In what order? Someone coming over from Twitter with strong insider knowledge of how Twitter answered these questions (and knowledge of things they tried that didn't work out so well) would be a major asset to someone trying to duplicate the service.
Plus, Truth Social is an obvious Twitter clone. Why aren't they being sued?
Did they poach ex-Twitter employees? Making an app that largely mimics the features of another app is (software patents notwithstanding) perfectly legal. Using insider trade secret knowledge as a shortcut to success is a different story. I know every time I've started a new job in software I've had to sign an agreement that I would promise not to a) use trade secrets from that job at a future employer, and b) use trade secrets from a previous job while working at this one.
edited to add: suppose you're an engineer with intimate knowledge of Twitter's algorithm, you're asked to implement something very similar at your next job, but asked to do it without divulging any of Twitter's trade secrets. How do you even do that? How can you realistically be expected to identify which bits of your brain are filled with general publicly-available knowledge about what a social media user might like to see, which bits are influenced by Twitter's secret information, and only use the former bits as you work? The employer and employee would be both exposing themselves to a lot of risk. Now, I'm sure there many (most?) ex-Twitter engineers don't know all that much about the feed algorithm and so there's less risk exposure there.