Recent

Author Topic: What's the point with these auto generated comments {TForm1}  (Read 18638 times)

balazsszekely

  • Guest
Re: What's the point with these auto generated comments {TForm1}
« Reply #15 on: August 18, 2016, 09:39:48 pm »
Quote
Very sad news for me. That is part of long tradition. Pure logic is the ruin of the spirit.
For historical reasons it should be optional(Editor Options/General/Misc).

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4468
  • I like bugs.
Re: What's the point with these auto generated comments {TForm1}
« Reply #16 on: August 18, 2016, 10:19:59 pm »
Very sad news for me. That is part of long tradition. Pure logic is the ruin of the spirit.
I knew somebody will want them back. So far you are the only one. :)
Anyway, I guess it must be made optional. Could somebody create a patch please.
I personally am happy to get rid of those comments for good. I always delete them from my own code at once. When I see them in other people's code, I also want to delete them because they are absolute zero-information. I don't see any "spirit" in them.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

guest58172

  • Guest
Re: What's the point with these auto generated comments {TForm1}
« Reply #17 on: August 18, 2016, 10:34:13 pm »
Cool, nice to see that an apparently casual topic leads to action.

Silvio Clécio

  • Guest
Re: What's the point with these auto generated comments {TForm1}
« Reply #18 on: August 25, 2016, 11:45:23 pm »
WDYT about to declare this way?:

  TForm1 = class(TForm)
  end;

IMHO declared scopes without any comment or code doesn't sound good.  :)

Silvio Clécio

  • Guest
Re: What's the point with these auto generated comments {TForm1}
« Reply #19 on: August 25, 2016, 11:52:16 pm »
I removed the comments in r52832. They were in many places.

Very sad news for me. That is part of long tradition. Pure logic is the ruin of the spirit.

Fully agreed. By pure logic it should be:

type
  TForm1 = class(TForm)
  end;

By tradition it should remain as is, or some option (disabled by default) for who wants to remove it.
« Last Edit: August 26, 2016, 12:12:33 am by silvioprog »

Silvio Clécio

  • Guest
Re: What's the point with these auto generated comments {TForm1}
« Reply #20 on: August 25, 2016, 11:59:38 pm »
For historical reasons it should be optional(Editor Options/General/Misc) "IME handled by System".

Sorry my ignorance, but, what means "IME handled by system"? :-[
« Last Edit: August 26, 2016, 12:07:05 am by silvioprog »

Silvio Clécio

  • Guest
Re: What's the point with these auto generated comments {TForm1}
« Reply #21 on: August 26, 2016, 12:03:25 am »
I wrote a note also in Lazarus mailing list (which was rejected, must find out why).

Hm... I can't see any related message at Lazarus mailing list, so I issued it at http://lists.lazarus-ide.org/pipermail/lazarus/2016-August/229358.html. :(
« Last Edit: August 26, 2016, 12:13:19 am by silvioprog »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4468
  • I like bugs.
Re: What's the point with these auto generated comments {TForm1}
« Reply #22 on: August 26, 2016, 08:26:58 am »
Fully agreed. By pure logic it should be:

type
  TForm1 = class(TForm)
  end;

No it should not.
"private" and "public" are useful blocks. Most form classes need them.
Then people would ask (rightfully) why they must add those specifiers themselves.
Now the automatic form class definition is quite perfect. It has all the needed parts but no stupid comments that must be deleted always.

Quote
By tradition it should remain as is

Tradition? Somebody at Borland added those comments at early 1990's without thinking much of it. Why such a tradition should be kept?
Do you want to keep bugs and clumsy UI designs for the same reason, tradition?
No, our goal is to improve things.

Quote
or some option (disabled by default) for who wants to remove it.

A patch for the option is welcome. It can be like "Add useless comments after visibility specifiers of a class". Yes, it must be disabled by default.

Quote
IMHO declared scopes without any comment or code doesn't sound good.

To me it sounds good. The comments carried absolutely no information and had to be removed manually. Always!
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

hnb

  • Sr. Member
  • ****
  • Posts: 270
Re: What's the point with these auto generated comments {TForm1}
« Reply #23 on: August 26, 2016, 09:44:54 am »
I knew somebody will want them back. So far you are the only one. :)
... and that is also expressed in newpascal release notes ;) (see "Latest Release" news).
Checkout NewPascal initiative and donate beer - ready to use tuned FPC compiler + Lazarus for mORMot project

best regards,
Maciej Izak

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: What's the point with these auto generated comments {TForm1}
« Reply #24 on: August 26, 2016, 10:15:21 am »
I knew somebody will want them back. So far you are the only one. :)
... and that is also expressed in newpascal release notes ;) (see "Latest Release" news).

I remember a presentation from the Delphi 1 team in early 1995 (may be even very late 1994, but close to but before official release) where features like form/component naming and default comments were demonstrated.
Assuming my NDA is expired I remember part of the demo was - after the initial project1|form1|menu1|memo1|panel1|button1 -  meaningful naming and meaningful comments.
The demonstrator (Chuck?) started expanding the default comments
{ TForm1 is the main form class for the application that contains the controls to implement the main logic} or something like that..
So here you go. That's the background. I was there. I also remember it was intended somehow for navigation, but never used in production.

I still think that it is a useful feature since its intended use. So I am definitely in the don't remove, you just didn't understand what to do with it.
It is consistent in the design of the RAD model used. You can quickly type in a meaningful comment and it saves a few brackets to type. (Ok, two..but)

So Maciej: it is a BAD idea to remove it. It discourages commenting your code....
« Last Edit: August 26, 2016, 02:31:09 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Silvio Clécio

  • Guest
Re: What's the point with these auto generated comments {TForm1}
« Reply #25 on: August 26, 2016, 04:36:12 pm »
...
A patch for the option is welcome. It can be like "Add useless comments after visibility specifiers of a class". Yes, it must be disabled by default.

Sorry, but an "Add useless comments after visibility specifiers of a class" option and disabled by default make no sense for me.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4468
  • I like bugs.
Re: What's the point with these auto generated comments {TForm1}
« Reply #26 on: August 26, 2016, 04:56:51 pm »
Sorry, but an "Add useless comments after visibility specifiers of a class" option and disabled by default make no sense for me.

The whole template should be configurable. Then people can add any comments they like.
I have many things to do and this one does not reach the top of my ToDo list. Maybe somebody else can help with this one.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: What's the point with these auto generated comments {TForm1}
« Reply #27 on: August 26, 2016, 05:07:35 pm »
The whole template should be configurable. Then people can add any comments they like.
Indeed. Here Lazarus can learn something from MSEide. In MSEide all new units, forms, programs, console apps and your own templates can be defined and edited simply by editing the template files in your defined template directory. MSEide comes with some standard templates to give you an idea of what to do and what macros can be used.

Then again, wasn't there already a Template ide add-on for Lazarus developed some years ago. I think Michael van Canneyt implemented it. But maybe that add-on was only for whole projects, not just for new units, forms etc. Either way, that should be a good starting point.

Yup, I had a quick look and found the add-on I'm talking about:
   <laz>/components/projecttemplates/projtemplates.lpk
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: What's the point with these auto generated comments {TForm1}
« Reply #28 on: August 26, 2016, 05:08:05 pm »
Sorry, but an "Add useless comments after visibility specifiers of a class" option and disabled by default make no sense for me.

The whole template should be configurable. Then people can add any comments they like.
I have many things to do and this one does not reach the top of my ToDo list. Maybe somebody else can help with this one.

As per my previous reply: there is a reason they are there.
The original meaning was that users  could easily expand the default comment into something more applicable, just like naming the default components with a more applicable name.
Note that can also be demonstrated if you e.g. change the name of the form. The comment changes too even leaving existing comments alone. In Delphi. Provided the component/class/specifier remains the first in place.
« Last Edit: August 26, 2016, 05:11:32 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: What's the point with these auto generated comments {TForm1}
« Reply #29 on: August 26, 2016, 05:15:04 pm »
Please tell us the story.

I tend to delete them but they're generated again and again; I always wandered why and today I dare asking.  :-[

I gave you some piece of history if that is what you mean by a story....  8-) These are actually useful and more powerful than you think - as implemented in Delphi, that is.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018