Comment terminology

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Comment terminology

Post by Ollie Saunders »

Haven't been here for ages. Hi everyone! I've got a terminology question:

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.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Comment terminology

Post by alex.barylski »

Non-commented lines of code are commonly refered to as SLOC (source lines of code).

Comments and white space are not source code...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Comment terminology

Post by Weirdan »

I'd say executable/non-executable lines. Unreachable code (usually referred to as dead code) is effectively commented as well
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Comment terminology

Post by Christopher »

Ollie Saunders wrote: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?
Uh ... maybe I am missing something, but isn't code that is not commented out called ... code.
(#10850)
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: Comment terminology

Post by kaisellgren »

arborint wrote:
Ollie Saunders wrote: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?
Uh ... maybe I am missing something, but isn't code that is not commented out called ... code.
I think he thought that

Code: Select all

// $commented_code = true;
is code, too, but in a "commented out" form and that he is asking for the "non-commented out" term, which is not "code", because they both are code.

I'm not sure if I agree with such terms, but it seems that's what he meant.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Comment terminology

Post by Ollie Saunders »

I defined a new term to get around the problem.

Commented-out-code is now code-under-comment.
Comments removed that were formally commenting out code is now code-not-under-comment.
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: Comment terminology

Post by kaisellgren »

So, basically you are asking for a term that explains a block of arbitrary data which being uncommented is valid code?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Comment terminology

Post by Ollie Saunders »

That's not how I intended to be interpreted. At this stage I'm not asking anything and what I'm talking about is moving from

Code: Select all

//code();
to

Code: Select all

code();
I wanted names for both these things. But I've done it now so we're done here. Go back to your lives.
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: Comment terminology

Post by kaisellgren »

If you come up with a more formal definition of code-not-under-comment I'd like to know, too.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Comment terminology

Post by Ollie Saunders »

A friend of mine suggested "statemented in".
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Comment terminology

Post by alex.barylski »

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Comment terminology

Post by Christopher »

Again I say, this is a comment (or commented out code):

Code: Select all

//code();
And this is just code:

Code: Select all

code();
There is a saying that there is no name for someone who does not collect stamps. ;)
(#10850)
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: Comment terminology

Post by omniuni »

I may be off-base, but I believe "commented code" is simply a "comment" where non-commented code, is simply "code". That's what I use, anyway. Source Code, or Source Lines of Code are simply more specific ways of saying "Code" and "Commented Code" is just a specific way of saying "Content"... maybe even a specific way of saying "A comment of something that used to be or could be working code", but again, if it's not commented, and executes or is interpreted by a parser in any way, server side or client side, I believe, functionally, it is simply "Code".

:?
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: Comment terminology

Post by kaisellgren »

Actually, I've been wondering that if I have this:

Code: Select all

$var = 'something'
is that code? Note, it does not work (; missing), but does that make it still code? If so, then I would definitely agree with
omniuni wrote:if it's not commented, and executes or is interpreted by a parser in any way, server side or client side, I believe, functionally, it is simply "Code".
Otherwise there could be a more precise term.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: Comment terminology

Post by omniuni »

Yeah, I'd still call it code. "Bad Code" or "Wrong Code" or "Erroneous Code" yes, but still, it's code because it will be parsed and then it will DO something. In this case throw an error. If you add the semicolon, it will reserve a bit of memory and store a value.
Post Reply