cpp-best-practices / cpp-best-practices/cppbestpractices
Never Mix Tabs and Spaces - revisited
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 8.8k
- Forks
- 902
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I was always in the - use only spaces - group for coding.
Until recently, when I started using clang-format. It has many options:
> UseTab (UseTabStyle)
> The way to use tab characters in the resulting file.
> Possible values:
> UT_Never (in configuration: Never) Never use tab.
> UT_ForIndentation (in configuration: ForIndentation) Use tabs only for indentation.
> UT_ForContinuationAndIndentation (in configuration: ForContinuationAndIndentation) Use tabs only for line continuation and indentation.
> UT_Always (in configuration: Always) Use tabs whenever we need to fill whitespace that spans at least from one tab stop to the next one.
Now I use the setting: ForIndentation
Which uses Tabs for indenting the the block, and if more indentation is required for aligning, then spaces are used.
So it doesn't matter wether someone has 2, 4, or 8 spaces per tab, the code is always aligned correctly.
Currently my stance is: use Tab for indenting, use space for aligning.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
No se menciona ningún archivo, prueba ni punto de entrada. Empieza por localizar las directrices existentes del repositorio sobre el estilo de código y determina si esta discusión tiene un resultado acordado; para darlo por terminado sería necesario contar con una política decidida sobre tabulaciones y espacios, documentada en las directrices correspondientes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100