+1 Don't think this working for a startup offers much advantage for an engineer if they later decide to work on their own.
If you already know programming, there isn't a lot of value add that couple years of startup experience offers in terms of your programming skills.
The skills that you don't have -- Sales, marketing, hiring -- you will still not have. Working for a startup, as say, a frontend engineer for couple years does not help you get better at Sales. You'll need to hire for them or rely on co-founders anyway. The "wearing multiple hats" trope is extremely over hyped in my experience.
If you already know programming, there isn't a lot of value add that couple years of startup experience offers in terms of your programming skills.
The skills that you don't have -- Sales, marketing, hiring -- you will still not have. Working for a startup, as say, a frontend engineer for couple years does not help you get better at Sales. You'll need to hire for them or rely on co-founders anyway. The "wearing multiple hats" trope is extremely over hyped in my experience.