Comment anchor

Reading a blog (as one does) and I came accross http://blogs.wdevs.com/marcclifton/archive/2005/12/23/11653.aspx
where Marc Clifton suggests a 'comment anchor' system which I think sounds
like a great idea and maybe something R# could do.

The basic idea is that a comment on the end of a line should be 'tabbed'
out to say column 120 (configurable of course) - maybe by noticing "]]>//"
so that any edits to the line would keep all of the comments left- justified
over on the right without having to add/remove extra tabs!

Hows-about-it

Ronnie


6 comments
Comment actions Permalink

Reading a blog (as one does) and I came accross
http://blogs.wdevs.com/marcclifton/archive/2005/12/23/11653.aspx where
Marc Clifton suggests a 'comment anchor' system which I think sounds
like a great idea and maybe something R# could do.

Does anybody use such a comment system in real life? When you use comments
you expect that somebody will read them together with the code. Hence, I
would expect they are placed right before the commented code (on the previous
line) or as close to the code as possible (starting right after the code
on the same line). Aligning comments somewhere on the right sounds like one
who reads the code is expected to read only code or only comments. I think
such comments are for xml-doc sections. What is the intended use of such
comments?

Thanks,
Andrey Simanovsky


0
Comment actions Permalink

Ronnie,

It reminds me the COBOL files, where everything was aligned to proper
position, and moreover, the alignment was significant to the text semantics
;)

I don't think it's a good idea.

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Hello Sergey,

In Cobol the alignment was significant for the code syntax, not to its semantics.
That is, improperly
aligned code didn't compile.

Given that many Cobol programs are still in use now, it seems that not all
its features were so ridiculous.
Who knows how many C# code will run 40 years later?

Not that I like the suggestion though :)

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Ronnie,

It reminds me the COBOL files, where everything was aligned to proper
position, and moreover, the alignment was significant to the text
semantics ;)

I don't think it's a good idea.



0
Comment actions Permalink

Hello Andrey,

You must have been talking to a colleague of mine - he just suggested the
same (apparently it's a microsoft standard!)

But I find that when you have a run of fields that need a little comment
I don't want to separate them out with a comment between them - it confuses
one as to whether the comment is about the thing above or below - so you
need an extra blank line which means we've spread the whole thing out vertical
instead of using the gulf of space on the right!

Hey, what about if the position of the left hand edge of the columns moved
depending upon the right-edge of the editor window!!!

Ronnie


>> Reading a blog (as one does) and I came accross
>> http://blogs.wdevs.com/marcclifton/archive/2005/12/23/11653.aspx
>> where Marc Clifton suggests a 'comment anchor' system which I think
>> sounds like a great idea and maybe something R# could do.
>>

Does anybody use such a comment system in real life? When you use
comments you expect that somebody will read them together with the
code. Hence, I would expect they are placed right before the commented
code (on the previous line) or as close to the code as possible
(starting right after the code on the same line). Aligning comments
somewhere on the right sounds like one who reads the code is expected
to read only code or only comments. I think such comments are for
xml-doc sections. What is the intended use of such comments?

Thanks,
Andrey Simanovsky



0
Comment actions Permalink

Hello Dmitry,

Sounds like I am going to be out-voted. I concede!

Ronnie

Hello Sergey,

In Cobol the alignment was significant for the code syntax, not to its
semantics.
That is, improperly
aligned code didn't compile.
Given that many Cobol programs are still in use now, it seems that not
all its features were so ridiculous. Who knows how many C# code will
run 40 years later?

Not that I like the suggestion though :)

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> Ronnie,
>>
>> It reminds me the COBOL files, where everything was aligned to proper
>> position, and moreover, the alignment was significant to the text
>> semantics ;)
>>
>> I don't think it's a good idea.
>>


0
Comment actions Permalink

Hello Ronnie,

Although I don't find the comment anchor important for my use, I find a similar
need for aligning code. I use columnar alignment when I am assigning the
values of several fields, especially in a Clone method. For example:

public object Clone()
{
MyObject clone = new MyObject();

clone.FirstName = FirstName;
clone.LastName = LastName;
clone.ContactNumber = ContactNumber;
....

return clone;
}

When performing Format Code with R#, all of the tabs are removed. Perhaps
there is a better practice than using whitespace for improving code readablilty,
and I am open to that. However, I do think aligning code (or comments) by
column is a nice-to-have feature.

Ed

Reading a blog (as one does) and I came accross
http://blogs.wdevs.com/marcclifton/archive/2005/12/23/11653.aspx where
Marc Clifton suggests a 'comment anchor' system which I think sounds
like a great idea and maybe something R# could do.

The basic idea is that a comment on the end of a line should be
'tabbed' out to say column 120 (configurable of course) - maybe by
noticing "<tab>//" so that any edits to the line would keep all of the
comments left- justified over on the right without having to
add/remove extra tabs!

Hows-about-it

Ronnie



0

Please sign in to leave a comment.