Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offside-rule 的问题 #20

Open
hax opened this issue Apr 2, 2015 · 0 comments
Open

offside-rule 的问题 #20

hax opened this issue Apr 2, 2015 · 0 comments
Labels

Comments

@hax
Copy link
Owner

hax commented Apr 2, 2015

王垠抨击过缩进语法。其中提到缩进很容易在编辑的时候弄坏,比如不小心(猫跳到键盘上?)输入或删去一些空格。而传统语法没有这个问题是因为恰好输入或删除成对的符号(花括号对或begin/end对)的概率小多了。比较来说,缩进是单点变更就会产生语义差异,因而危险。

需要承认这是一个合理的责难。其实可以和 rm -rf / temp 的空格惨案相类比。紧凑的语法往往造成这种问题。

不过实践上似乎并未看到或听到很多实际的惨案,即使coffee、yaml已经相当普及。

有一些方法来克服这一问题:

  • 受控的编辑环境
  • 语法冗余结构
    • 引入类似花括号或begin/end的要素
    • 引入类似/的terminator
@hax hax added the 笔记 label Apr 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant