I got started playing D&D in person, but that quickly changed as I returned to college out-of-state.
I like the opportunity to play in person. It’s a lot easier to pick up on the group’s energy, and body language and tone of voice come across a lot better across the table. It’s easy to engage with each other without distractions.
But in my experience, it’s not exactly a choice of online versus in person. Your group might be spread across the corners of the world (or just too far away to drive), or you find a group online to begin with. Online play presents a few challenges that just aren’t a factor when you can inhabit the same physical space all together.
This is the case if all of your group tunes in from separate locations, or your group is a mix of in person and video calling-in.