DEV Community

Discussion on: 4 Spaces or 2?

Collapse
 
goyo profile image
Grzegorz Ziemonski

Tabs, people, use tabs. Then you can choose however many spaces you wish.

Collapse
 
nektro profile image
Meghan (she/her)

or use vs code and still be able to pick the number of spaces you want

Collapse
 
wolfhoundjesse profile image
Jesse M. Holmes • Edited

I started contributing to a project last night, and after asking this question an issue appeared a few hours ago that is pretty relative to your point!

Tabs are breaking YAML

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

This is unfortunate that YAML chose not to accept tabs. There's no practical reason not to allow it.

Collapse
 
wolfhoundjesse profile image
Jesse M. Holmes

In VSCode there are options like setting the tabs equal to a number of spaces, or you can even have tab insert spaces, I believe.

In other words, I’m not sure what you mean. 😂

Collapse
 
avalander profile image
Avalander

If the line starts with the tab character, I can configure VS Code to show it as either two or four (or any other number) spaces, so the same code can have different indentation space in your machine than in mine.

If I configure VS Code to set two spaces every time I press tab, it is unfortunately not possible for somebody who prefers four spaces indentation to visualise the code that way.

Thread Thread
 
wolfhoundjesse profile image
Jesse M. Holmes

This is the first time any part of this discussion has made sense to me. 🤩