JS Lint,Javascript 的语义必须如何?
所以 JSLint 是一个提升语义和语法的漂亮工具。我从客户站点获取到 JS Lint 的大多数 JS 通常会失败,尽管它们会吱吱作响,并且大多数站点功能仍然有效。我试图向他们推销修复他们的 Javascript,但他们认为它没有损坏(意味着它正在做他们想要做的事情)为什么要修复它?语义和语法对他们来说太抽象了。
您认为,使用 JS 的网站必须遵守 JS Lint 代码标准有多重要?符合 JS Lint 语义和语法的好论据是什么?
So JSLint is a nifty tool which promotes semantics and syntax. Most JS that I get from client's sites into JS Lint usually fails though they squeak by and most of the sites functionality still works. I try to sell them on fixing their Javascript but they see it as if it ain't broke ( meaning it is doing what they want it to do ) why fix it? Semantics and syntax is too abstract for them.
In your opinion, how important do sites with JS have to adhere to JS Lint code standards? What is a good argument for conforming to JS Lint semantics and syntax?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会举一些常见的 javascript 陷阱的例子。可能会导致维护期间需要更多时间进行调试。
全局变量:
括号和缩进:
还有更糟糕的例子。去找一些非常令人讨厌和混乱的代码,然后根据 jslint 修复它,并比较两个片段。你的卖点是干净代码的维护成本远低于维护脏代码的成本。
I would give some examples of common javascript pitfalls. Ones that could lead to more time debugging during maintenance.
Global variables:
Brackets and indentation:
There are much worse examples out there. Go find some really nasty and confusing code, then fix it according to jslint, and compare the two snippets. Your sell will be that maintenance cost of clean code is much less than the cost of maintaining dirty code.