The truth is there’s no universal “correct” answer – the debate is mostly a matter of consistency and tooling, not a deep technical superiority. Tabs give you flexibility for personal indentation width, but they often break formatting in editors that don’t share the same settings, and they can cause noisy diffs. Spaces lock the visual width in stone, which means every developer sees the same layout and version control stays clean, but they waste a few bytes and force you to pick a width up front.
If you’re joining an existing codebase, just follow whatever that project already uses; if you’re starting a fresh project, pick one style (most open‑source projects today default to 4 spaces) and enforce it with an editorconfig or a linter. The one thing you should actually do is configure your editor to automatically apply that rule so you never have to think about it again.