Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-02

Hiding Comments

14 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

theo

I know this is probably hard to implement but I sometimes would really like to have it. ;-)
I have some heavily commented code, be it for the following reasons.
- Comments explaining what the following code is doing, sometimes line by line.
- Comments which keep some "thoughts" of previous implementations in code (not for "shipping") but which might be helpful and be it only for not going that route again.
- Some todo stuff (I know about the todo feature).

I think it would be helpful to hide all comments at times, because while helpful, they make reading the actually working code a lot harder.

Does anybody know if this is implemented somewhere in other IDEs? Does anybody else think this would be a good feature? Does anybody have a suggestion how to implement this?

Don't beat me, it's just a question and I have no answer. ;-)

Thanks

Reply by email

Paul Nicholls
to theo

----- Original Message -----

Earlier message 31 lines
From: "theo" To: Sent: Tuesday, February 16, 2010 11:28 AM Subject: [Lazarus] Hiding Comments >I know this is probably hard to implement but I sometimes would really > like to have it. ;-) > I have some heavily commented code, be it for the following reasons. > - Comments explaining what the following code is doing, sometimes line > by line. > - Comments which keep some "thoughts" of previous implementations in > code (not for "shipping") but which might be helpful and be it only for > not going that route again. > - Some todo stuff (I know about the todo feature). > > I think it would be helpful to hide all comments at times, because while > helpful, they make reading the actually working code a lot harder. > > Does anybody know if this is implemented somewhere in other IDEs? > Does anybody else think this would be a good feature? > Does anybody have a suggestion how to implement this? > > Don't beat me, it's just a question and I have no answer. ;-) > > Thanks +10 cheers, Paul

Reply by email

Paul Nicholls
to theo

----- Original Message -----

Earlier message 16 lines
From: "theo" To: Sent: Tuesday, February 16, 2010 12:54 PM Subject: Re: [Lazarus] Hiding Comments > Well, then welcome on board (if nobody else said that before). > How is the weather like in Australia? ;-) > Thanks :) it is a lovely sunny 24 degrees here in Tasmania, Australia, very nice :) cheers, Paul

Reply by email

theo
to Paul Nicholls
it is a lovely sunny 24 degrees here in Tasmania, Australia, very nice :)

Humm, it's -10 (Celsius) here in central Switzerland. Swiss Intl. Air Lines offers three flights to Hobart tomorrow. Two via Hongkong-Sydney one via Bangkok-Sydney.
Which one to take?
;-)

Reply by email

Thierry Coq
to theo: I know this is probably hard to implement but I sometimes would really like to have it.…

Hello all,

I join theo in asking for such features, my emphasis is on having more structured "comments" embedded in the code. For example, storing the design model, requirements, or traceability to the design and requirements. Of course, this would be awkward to manage if a feature like the one theo asks is not available. Even better, if there were a system to manage the structure of the comments (and turn them on/off), maybe in some XML-like syntax...

For example, I would love to be able to mention the Big-O notation of the algorithms in a structured manner that can be recovered automatically, and can be optionally hidden in the code when not useful.

Best regards,
Thierry

theo wrote 30 lines
I know this is probably hard to implement but I sometimes would really like to have it. ;-) I have some heavily commented code, be it for the following reasons. - Comments explaining what the following code is doing, sometimes line by line. - Comments which keep some "thoughts" of previous implementations in code (not for "shipping") but which might be helpful and be it only for not going that route again. - Some todo stuff (I know about the todo feature). I think it would be helpful to hide all comments at times, because while helpful, they make reading the actually working code a lot harder. Does anybody know if this is implemented somewhere in other IDEs? Does anybody else think this would be a good feature? Does anybody have a suggestion how to implement this? Don't beat me, it's just a question and I have no answer. ;-) Thanks -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Graeme Geldenhuys
to theo: I know this is probably hard to implement but I sometimes would really like to have it.…

Hello Theo,

I think it would be helpful to hide all comments at times, because while helpful, they make reading the actually working code a lot harder.

That's why I prefer external documentation like is done with FPC and Lazarus projects - using XML files.

Alternatively, keep most of your comments above the method/function/procedure. If you want to hide them automatically, simply wrap them with {%region} so it enables code-folding.

eg:

{%region 'comments hidden by default' -fold}
{ This is my very long comment that goes on for many lines...} {%endregion}
procedure MyProc;
begin
...
end;

The '-fold' in the %region line will tell the IDE to code-fold than region by default. I use this for all code auto-generated and managed by fpGUI's UI Designer.

The last solution is to simply not comment your code! Make it the next developers problem. :-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to theo: I know this is probably hard to implement but I sometimes would really like to have it.…
theo wrote
I think it would be helpful to hide all comments at times, because while helpful, they make reading the actually working code a lot harder.

I just thought of another solution. Change your editor preferences and change the foreground and background color for comments to be the same as the editor background. All comments are now invisible. ;-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

theo
to Graeme Geldenhuys: That's why I prefer external documentation like is done with FPC and Lazarus projects -…

Thanks Graeme

That's why I prefer external documentation like is done with FPC and Lazarus projects - using XML files.

This is more for the "final documentation" of functions, but not so good for temporary comments,hints,todos and the like.

wrap them with {%region} so it enables code-folding.

Code folding still leaves a visible line, so this does not help for one-line comments and is not very handy.

change the foreground and background color for comments to be the

same as

the editor background. All comments are now invisible. ;-)

This is sort of what I'm doing now. My comments color ist almost white (on white bg.), so that they do not catch my eye.
This helps a little.

Regards
Theo

Reply by email

Flávio Etrusco
to theo: Thanks Graeme This is more for the "final documentation" of functions, but not so good…
> wrap them with {%region} so it enables code-folding. Code folding still leaves a visible line, so this does not help for one-line comments and is not very handy.

I'd like the feature too. Actually I'm quite surprised that Lazarus doesn't have the ability to automatically fold comments already, guess I'm not very attentive :-$
But this doesn't suffice, I can't really imagine how the feature should look like - unless you mean that the text is the problem, so an option to replace it with some symbol or icon is what you want.

Best regards,
Fl?vio

Reply by email

waldo kitty
to Graeme Geldenhuys: I just thought of another solution. Change your editor preferences and change the…
Graeme Geldenhuys wrote 8 lines
theo wrote: > > I think it would be helpful to hide all comments at times, because while > helpful, they make reading the actually working code a lot harder. I just thought of another solution. Change your editor preferences and change the foreground and background color for comments to be the same as the editor background. All comments are now invisible. ;-)

:LOL: but they do still take screen real estate ;)

Reply by email