大多数编程语言的大多数风格指南都建议最大行长度,通常为80个字符.这对于
HTML和
JavaScript来说似乎是不切实际的(当嵌入在HTML中时).有关HTML / JavaScript的实际线路长度限制的共识吗?还是一般是由开发者的常识来决定的?
解决方法
既然你提到JavaScript,那就是
Douglas Crockford这个话题呢?
Avoid lines longer than 80 characters. When a statement will not fit on a single line,it may be necessary to break it. Place the break after an operator,ideally after a comma. A break after an operator decreases the likelihood that a copy-paste error will be masked by semicolon insertion. The next line should be indented 8 spaces.
From: 07001