Conclusion

  • create an indentation workflow that works regardless of the indentation style
    • use [Tab] to create indentation
    • use [Ctrl + Arrow right] to skip indentation
  • IDE’s make difference negligible
  • it’s a project decision not a developer one
  • you will have to use both

Nevertheless, people love to argue especially about highly controversial topics like this one. So despite it being mainly irrelevant, here are a few points for project decisions

Default implementation

Pressing [Tab] in different environments has different affects.

Move to the right until…

  1. the current column is a multiple of 8 (Unix systems, Ecams, Vim)
  2. the current column is a multiple of 4 (Windows)
  3. the next tab stop (Microsoft Word)

Spaces

Pasted_image_20221230123246.png

  • can be entered and pasted in all environments like terminals, publishings and browsers
  • consistent cursor speed when going through

Tabs

Pasted_image_20221230123232.png

  • a character specifically meant for indentation
  • customize indentation visualization according to developer’s preferences without changing the code thus separating data and presentation
  • seamlessly import code without half-indenting or misalignment due to different indentation sizes
  • noticeable mistakes in the level of indentation
  • don’t micro manage spaces
  • are consistent, they are only used for indentation, unless you are commenting wrong.
  • less storage size
  • take less time to go through

Secondary indentation using spaces


Sources:

Related:

Tags:
Discussions