TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What do you do with mismatching braces in c style languages?

4 点作者 omidfi超过 8 年前
I&#x27;m kind of ashamed by asking this. But it has been on my mind for a long time. While writing code in c-style languages, many times I find myself lost among mismatching braces! For example look at this: (function(){ &#x2F;&#x2F; from JavaScript the good parts var add_the_handlers = function (notes) { var i; for ( i = 0; i &lt; nodes.length; i += 1) { nodes[i].onclick = function (e) { alert(i); }; }; };<p>}());<p>My editor is complaining about a mismatch in braces or prans. How do you find your way out of these situations? :)

3 条评论

atsaloli超过 8 年前
I use vim showmatch. <a href="http:&#x2F;&#x2F;vim.wikia.com&#x2F;wiki&#x2F;Moving_to_matching_braces" rel="nofollow">http:&#x2F;&#x2F;vim.wikia.com&#x2F;wiki&#x2F;Moving_to_matching_braces</a>
评论 #12712810 未加载
mtmail超过 8 年前
The Sublime text editor underlines the opening and matching closing bracket that&#x27;s currently under the cursor. Easy to miss, I noticed it only after months of using the editor.
brudgers超过 8 年前
To a first approximation, all IDE&#x27;s and programmer friendly text editors have &#x27;parenthesis&#x27; matching modes&#x2F;features. Certainly any IDE&#x2F;editor that complains about mismatched &#x27;parenthesis&#x27; does.<p>I found turning on parenthesis matching a was a bit disorienting at first because deleting parenthesis worked differently from deleting other characters. Eventually I got used to it.<p>Good luck.