mantianyu
V2EX  ›  问与答

为什么越来越多的配置文件不提倡使用tab?

  •  
  •   mantianyu · Jun 30, 2013 · 3414 views
    This topic created in 4771 days ago, the information mentioned may be changed or developed.
    apache2.4 httpd.conf, jekyll _config.yml, php.ini等等都不使用tab,要么直接就没有缩进,要么都换成了4个空格

    很多官方的配置文档也都建议用户不要使用tab,这是为啥?
    我们美式键盘上的tab键,将来会不会被淘汰而从键盘上去掉或改为其他功能?
    7 replies    1970-01-01 08:00:00 +08:00
    bcxx
        1
    bcxx  
       Jun 30, 2013
    摸摸楼主……
    swulling
        2
    swulling  
       Jun 30, 2013
    难道lz打四个空格的时候真傻乎乎的按四下空格么。。。
    Perry
        3
    Perry  
       Jun 30, 2013 via iPhone
    http://www.jwz.org/doc/tabs-vs-spaces.html
    另外,配置编辑器后Tab可以打出4个空格的〜
    mantianyu
        4
    mantianyu  
    OP
       Jun 30, 2013
    @swulling
    @bcxx
    @Perry

    鄙人也知道这个事儿,俺主要是想知道制表符 \t 在配置文件里为啥不被提倡用了呢
    谢 @Perry gg给的链接哈^_^
    swulling
        5
    swulling  
       Jun 30, 2013
    @mantianyu
    因为Tab在不同的编辑器里的长度不一,而空格则固定不变
    Muninn
        6
    Muninn  
       Jun 30, 2013
    楼主 你应该哀悼那个ascii码,而不是键盘按键...
    mytharcher
        7
    mytharcher  
       Jun 30, 2013
    我的观点同这篇文章:

    [TABs vs Spaces. The end of the debate.](http://www.iovene.com/posts/2007/05/tabs-vs-spaces-the-end-of-the-debate/)

    “use what ever you want for indenting, but use spaces for aligning.”
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1137 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 17:59 · PVG 01:59 · LAX 10:59 · JFK 13:59
    ♥ Do have faith in what you're doing.