I always heard "2 seconds of space" which is a lot more than a few car lengths, to give yourself time to react to both what's in front of you and to the sides, and account for if their brakes perform better than yours. Two seconds of distance is a lot, though, and kind of impractical in traffic.
The recommendation changed from car lengths to seconds decades ago, but wasn't well communicated fwict. I learned car lengths from my dad and then seconds when I got my motorcycle endorsement.
If everyone were leaving 2 seconds of space, it also reduces stop and go traffic that is caused, or at least exacerbated, by the traffic wave phenomenon. But that's even less well socialized.