Comment out a line or leave it uncommented

Generally, if we comment out the lines containing certain settings in the configuration files of the commands, they will not be executed, and if we leave them uncommented, they will be executed. However, we see that certain lines containing the default settings are commented out. There is some contradiction here. How does the given command run with the default settings if the relevant lines of the configuration file are uncommented?

It depends on the program in question but many applications apply the default settings programatically unless you override them in the config file. In these cases, it is common practice to add the defaults to the config file and leave them commented out.

When you are referencing a config file, the lines are often not executed but are simply being read. Even if they are being executed as with a script, they are often only overriding the defaults so if they are commented or omitted, the defaults are still applied.

3 Likes

This is understandable, I think the default settings are also commented out as a reminder to the user. However, if we write a line containing modified settings uncommented under such a line containing default settings, is it also possible that it will not be executed?

if it is uncommted it will get read

No, the settings in the config file should always override the defaults.

Commented lines are usually ignored. It doesn’t matter if the comment is a default setting or something else. Anything that is commented out, is ignored.

Then I think that the threads about this all over the internet could be the result of misunderstandings or bad translations of the term commented out, because this could also mean removing the # sign from the beginning of such a line. In the first case, it would perhaps be more correct and understandable to use the expression leave commented for such setting lines, in the second case, uncommented is more understandable.
Of course, I don’t want to study linguistics.

No contradiction.
Many apps show the default values as commented out. That can also be considered as documenting the details. As others already said, commented stuff is not used, but the app does have the default values already in the app.

1 Like

“Commented out” should never mean removing the # sign. It should always refer to adding the # or whatever indicates a comment in that particular file.

1 Like

Term “commenting out” can be a language problem as well.
Most computing terms come from the English language, and other languages may have different inherent structures how such “sayings” should be interpreted.

I agree that in my language term “commenting out” sounds slightly awkward, but it is a commonly used term in computing.
It means something like " leaving something out of the equation by adding a comment mark" which essentially removes the marked line.

All this came to mind only from the reflector-simple.conf file.
In fact, if we uncomment the commented out lines containing the default settings, no changes will occur, because then the default settings are overwritten with the same settings.

Yeah, some EOS apps do not comment out the default values.
In this respect you are right, they should consistently follow the same principles.

1 Like

Yes, I dared to write about this because there is no uniform practice in this matter. Unfortunately, it is a professional disadvantage for me that I look for logic in everything. :slight_smile:

There are no contradictions here. Those lines are merely a manifestation of the function of comments—to communicate intent to readers of code.

In this case, the comments are there to let the readers know what the default settings are and sometimes to let the user know what settings/options are available for configuration.

Because those settings are already built into the program. The comment is only there to let the reader of the configuration file know what the default value(s) of that particular setting is(are). Even if a user does choose to uncomment the setting, it won’t be a problem. From the application’s point of view, it will just be like setting the same value twice. Consider this code snippet:

int y = 99;
y = 99;

No compiler/interpreter will ever find fault in this kind of code. Setting the same value twice usually won’t result in errors.

@zoli62

One could easily understand the ‘etymology’ of that phrasal verb when one compares it with other phrasal verbs that are commonly in use.

  1. take (verb) + out = remove something from a container/source ; changing an object’s spatial location in such a way that it goes from physically being inside another object to being physically outside of it
  2. black + out = to go from a state of being conscious to the state of being unconscious; to exit or leave the state of consciousness;
  3. wipe + out = to eliminate an object or a set of objects from existence; to take something from a state of existence to a state of non-existence

You can see a pattern here. In all three cases, there is a verb (take/wipe) that removes an object from a particular state, an act that can be conceptualized by the word “out” (because “out” conceptualize the notion of “leaving”).

The phrasal verb “comment out,” therefore, refers to the act of creating comments in the source code that brings a line of code from a state of being recognized by the program to a state of not being recognized by the program.

When you “comment out” a line of code, you are essentially using a comment to remove that line of code from the set of all lines to be executed by the compiler/program/interpreter. Therefore, the phrase makes sense.

1 Like

Seems your getting a lesson anyway. :rofl:

3 Likes

@ricklinux

LOL. I am by no means a linguist. The semantics of “comment out” does seem fairly obvious to me, so I thought I’d give the OP my two cents.

It’s kind of funny because you are using some sophisticated verbiage that made me laugh. :slightly_smiling_face:

Edit: The commented or uncommented or commented out terms may be difficult for some to understand. Especially if the user is not a native English speaker in my opinion. Sometimes i have to do a double take when i read it to make sure i understand. Also you have arch wiki that uses # to signify use of sudo and some people might see it and not understand.

It was deliberate. :joy:

For me, instead of commenting out, the following would be more understandable and sophisticated: mark the beginning of the program lines in question, which should not be executed, with the comment sign (e.g. # for bash)

1 Like

Even you find it difficult to understand what the poet was thinking when reading something? (sorry writer) :slight_smile: By the way, do you live in an English- or French-speaking area? After my mother tongue, I learned German from an early age, and only then did English follow. After German, I thought that English was much easier, which is the case in many cases. But it turns out that this is not always the case.