注释掉的反义词

发布于 2024-07-24 10:56:09 字数 124 浏览 7 评论 0原文

当一段代码被注释时,我们就说它被“注释掉”了。 但是当它没有被注释掉时,那是什么?

未注释的并不完全相同。 积极的? 它绝对没有被注释掉。

引用取消注释代码的行为的最佳方式是什么?

When a piece of code is commented we say just that, it's "commented out".
But when it's not commented out, what is that?

Uncommented isn't quite the same. Active?
It's definitely not commented in.

What's the best way to refer to the act of de-commenting out code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(16

暖心男生 2024-07-31 10:56:09

未注释是最常见的词。

Uncommented is the most common word for that.

南…巷孤猫 2024-07-31 10:56:09

我将未“注释掉”的代码简单地称为“代码”

I call code which isn't "commented out" simply "code"

素手挽清风 2024-07-31 10:56:09

Visual Studio 有一个名为“注释掉所选行”的功能。

相反的功能称为“取消注释所选行”。 我使用“未注释”一词。

Visual Studio has a function called "Comment out the selected lines".

The opposite function is called "Uncomment the selected lines". I use the term "uncommented."

却一份温柔 2024-07-31 10:56:09

几种可能性:

  • 实时代码
  • 遗留代码

A couple possibilities:

  • Live code
  • Legacy code
木格 2024-07-31 10:56:09

我希望它是“未注释的”。


我对过去被注释掉但现在不再被注释掉的代码使用“revived”或“restored”。 我对要编译或执行的代码使用“实时”或“未注释”。

I wish it were "uncommented in."


I use "revived" or "restored" for code that used to be commented out, but no longer is. I use "live" or "uncommented" for code that's intended to be compiled or executed.

守护在此方 2024-07-31 10:56:09

如果它过去曾经被注释掉,那么通过取消注释它将变成

  • 已取消注释

(如果你愿意,你可以推荐它,但我不会推荐。)

如果它从未被注释掉,它只是

  • 代码

现在对我来说,这些是实时代码可以具有的几种不同的(*)状态。 (或者可能只是尤达英语。)


*:隐式潜在元- [在此处添加您的拉丁语术语:P]。

If it was once commented out in the past, then by uncommenting it it will become

  • Decommented.

(You can recomment it if you want but I won't recommand that..)

If it was never ever commented out, it's just

  • code.

These are, to me now, the several different (*) states a Live code can have. (Or maybe it's just yoda english.)


*: implicit potential meta- [add your latin-born term here :P].

疯狂的代价 2024-07-31 10:56:09

它只是一段未注释、未禁用、未删除、未停用、未使用、未弃用、未过时、未重写、未存档的代码。

或者,通俗地说,就是代码。

It's just a piece of un-out-commented, un-disabled, un-erased, un-inactivated, un-unused, un-deprecated, un-obsolete, un-rewritten, un-archived code.

Or, in layman's terms, code.

司马昭之心 2024-07-31 10:56:09

想想一份社论文件。 这有点像在问“未删除的文字叫什么?” 只是,写作。

Think of an editorial document. Its kind of like saying "what is the un-deleted writing called?" Just, the writing.

美煞众生 2024-07-31 10:56:09

尽管“未注释代码”被广泛用于指代“实时”代码,但它是一个含糊不清的术语。
它可以引用曾经被注释掉但已被编辑以允许其运行的代码,或者它可以引用没有描述性注释的代码。

Although it is widely used to refer to 'live' code, 'Uncommented code' is an ambiguous term.
It could refer to code that was once commented out, but has been edited to allow it to be run, or it could refer to code that has no descriptive comments.

盛夏已如深秋| 2024-07-31 10:56:09

我称注释掉的代码...糟糕的代码。 如果要注释掉,则将其全部扔在一起。 您的版本控制系统应该跟踪您之前工作的各种状态。 与其注释掉它让其他人弄清楚为什么后来注释掉它似乎不是一个好的编码实践!

I call commented out code...poor code. If it is to be commented out then just toss it all together. Your version control system should keep track of the various states of your previous work. Rather than commenting it out for others to figure out why it was commented out later doesn't seem to be a good coding practice!

这样的小城市 2024-07-31 10:56:09

看到这个问题有多少不同的答案,您应该做一些事情。

  1. 选择一个术语并坚持使用。

    一致性是最重要的。 如果它不是最好的也没关系,如果在遥远的将来出现更明显的术语,您可以更改您的选择。

  2. 向您的队友明确描述该术语。

    不要只是说“这意味着未注释,或者无论你怎么称呼它。” 不要只是说“这与评论相反”。 告诉他们这意味着之前被注释掉的代码,现在已经删除了注释语法。 告诉他们此代码现在处于活动状态并将在调用时执行。 永远不要仅仅因为您的团队在您使用该术语时点头,就认为您的团队足够聪明,可以“明白”。

作为主观答案,我使用术语“未注释”。 对于这种行为来说,这是一个不好的名字,但至少它是比较直观的。 对于使用 # 字符进行注释的语言来说,它击败了像 unhashed 这样的废话。

Seeing how many disparate answers exist for this question, there are a few things you should do.

  1. Pick a term and stick with it.

    Consistency is most important. It's okay if it's not the best one ever, and you can change your choice if a more obvious term appears in the distant future.

  2. Explicitly describe that term to your teammates.

    Don't just say, "it means uncommented, or whatever you call it." Don't just say, "it's the opposite of commented." Tell them that it means code that was previously commented out, and has now had its commenting syntax removed. Tell them that this code is now active and will execute when called. Never assume that your team is smart enough to "just get it" just because they nod when you use the term.

As a subjective answer, I use the term uncommented. It's a bad name for the behavior, but at least it's mildly intuitive. It beats nonsense like unhashed for languages that use the # character for comments.

煮茶煮酒煮时光 2024-07-31 10:56:09

老实说,我确实说“发表评论”。 用诸如“好吧,它可以与注释掉的该行一起使用,所以让我们将其注释回来并重新运行测试”。 “取消注释”会更正确,但听起来更笨拙。 不过,我不会在正式写作中使用这种表达方式,只是在与我的搭档交谈时使用。

I honestly do say "commented in". In phrases like "well, it works with that line commented out, so let's comment it back in and re-run the test". "Uncomment" would be more correct, but sounds clunkier. I wouldn't use that expression in formal writing, though, just when talking to my pair.

一个人的旅程 2024-07-31 10:56:09

在调试会话期间,我经常注释和取消注释代码行。

从纯粹的语义(是的,迂腐的)角度来看,短语描述的是动作,而不是代码。

“注释掉”是一个动词,描述将语句转换为注释以将其从语言解析器执行的代码中删除的操作。

代码经历了相反的操作,即接受注释并将其转换为语句以将其包含在语言解析器所操作的代码中,这将是“声明中”。 但这当然是荒谬的。

也就是说,我同意安德鲁的观点,即在短暂的调试会话之外,在提交之前,如果不使用代码,则应将其删除,并且不应留在注释中以混淆事物。

During a debugging session, I often comment and uncomment lines of code.

From a purely semantic (and yes, anally pedantic) perspective, it's the action that's described by the phrase, not the code.

"Commented Out" is a verb describing the action whereby a statement was turned into a comment to remove it from the code that's acted upon by the language's parser.

Code having been subjected to the opposite action, that of taking a comment and turning it into a statement to include it in the code that the language's parser acts upon, would be "Statemented In". But of course that's ridiculous.

That said, I agree with Andrew that outside of a transient debugging session, before it's committed, code should be removed if it's not used and not left around in comments to confuse things.

临风闻羌笛 2024-07-31 10:56:09

问题在于术语“注释掉”。 这是对大多数语言的注释功能的滥用。 在 C/C++ 中,您应该使用预处理器有条件地编译您的代码,可能如下所示:

#if 0
...
... here is the code that is not in the build
..
#endif

...
... here is the code that is in the build
...

我记得我曾经工作过的地方的编码标准使用了“#ifdef NOT_DEF”和一些其他符号来代替“#if” 0”以向“注释掉”块添加一些语义。

该方案下使用的术语是“包含”和“排除”代码,尽管在一般谈论“代码”时通常假定“包含”。

当然,并非所有现代语言都具有这样的预处理功能,因此您又回到了滥用注释功能的情况。

The problem is with the term "commented out". It's an abuse of the comment feature of most languages. In C/C++ you should use the preprocessor to conditionally compile your code, perhaps like the following:

#if 0
...
... here is the code that is not in the build
..
#endif

...
... here is the code that is in the build
...

I recall a coding standard in a place I used to work at used "#ifdef NOT_DEF" and a few other symbols in place of "#if 0" to add some semantics to the "commented out" block.

The terms used under this scheme were "included" and "excluded" code, though "included" was usually assumed when talking generally about "the code".

Of course, not all modern languages have such a preprocessing feature, so you're back to abusing the comment feature.

浮生面具三千个 2024-07-31 10:56:09

我最终选择了注释代码注释下的代码和普通代码不在注释下的代码。 操作是从注释下获取代码从注释下取出

I ended up going with commented code being code under comment and normal code being code not under comment. The action being take code from under comment or bring out from under comment.

标点 2024-07-31 10:56:09

我们称之为“unremd”。 你不会在字典中找到它,但它与 REM(d) 相反,最重要的是音节更少......

We call it 'unremd'. You won't find it in the dictionary but it is the opposite of REM(d) and most importantly has fewer syllables...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文