You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Kenneth Fogel <kf...@dawsoncollege.qc.ca> on 2022/01/26 16:33:18 UTC

That Darn License Header

I am one of those who would prefer an empty license comment block at the beginning of a file. I have noticed that the header has changed and now links directly to two files. Unfortunately both files are unintelligible to me. Imagine how confused my students, in an Intro course I am giving right now, will think of these files. This was how I found the Help bug as I wanted to look up how to just eliminate these comments. Instructions on how to squash this block will be appreciated.

Ken


Re: That Darn License Header

Posted by Laszlo Kishalmi <la...@gmail.com>.
On 1/26/22 08:57, antonio wrote:
> Hi there,
>
> "Tools/Template Manager" can be of help, I think. You can always 
> create a new license, even an empty one. See 
> https://i.postimg.cc/3wbngMzb/licenses.png
>
> I think learning about the differences between a copyright and a 
> license, and a short introduction to the different open source 
> licenses available, is an important lesson for any student nowadays.
>
> This may help them protect their own work (and others) and ensure they 
> do not end in prison in the future :-).

+1 on that.

Also we could introduce an empty Global License template. Also can add 
the License selection step to the project wizards (wherever it can be 
applied)

>
> Cheers,
> Antonio
>
>
>
> On 26/01/2022 17:33, Kenneth Fogel wrote:
>> I am one of those who would prefer an empty license comment block at 
>> the beginning of a file. I have noticed that the header has changed 
>> and now links directly to two files. Unfortunately both files are 
>> unintelligible to me. Imagine how confused my students, in an Intro 
>> course I am giving right now, will think of these files. This was how 
>> I found the Help bug as I wanted to look up how to just eliminate 
>> these comments. Instructions on how to squash this block will be 
>> appreciated.
>>
>> Ken
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by antonio <an...@vieiro.net>.
Hi there,

"Tools/Template Manager" can be of help, I think. You can always create 
a new license, even an empty one. See 
https://i.postimg.cc/3wbngMzb/licenses.png

I think learning about the differences between a copyright and a 
license, and a short introduction to the different open source licenses 
available, is an important lesson for any student nowadays.

This may help them protect their own work (and others) and ensure they 
do not end in prison in the future :-).

Cheers,
Antonio



On 26/01/2022 17:33, Kenneth Fogel wrote:
> I am one of those who would prefer an empty license comment block at the beginning of a file. I have noticed that the header has changed and now links directly to two files. Unfortunately both files are unintelligible to me. Imagine how confused my students, in an Intro course I am giving right now, will think of these files. This was how I found the Help bug as I wanted to look up how to just eliminate these comments. Instructions on how to squash this block will be appreciated.
> 
> Ken
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by David Green <dg...@gmail.com>.
My students put together this

https://github.com/dgreen/NetBeansTemplateConfig

To set up the templates for my course.  It contains files for the templates
so you can change as desired.

I have students download the project and just run it. The GUI may need a
bit of work but the template setting logic seems to work for both MacOS and
Windows.  At least a concept approach to deal with the issue.

Dave

On Wed, Jan 26, 2022 at 11:33 AM Kenneth Fogel <kf...@dawsoncollege.qc.ca>
wrote:

> I am one of those who would prefer an empty license comment block at the
> beginning of a file. I have noticed that the header has changed and now
> links directly to two files. Unfortunately both files are unintelligible to
> me. Imagine how confused my students, in an Intro course I am giving right
> now, will think of these files. This was how I found the Help bug as I
> wanted to look up how to just eliminate these comments. Instructions on how
> to squash this block will be appreciated.
>
> Ken
>
> --
Sent from a mobile device. Please excuse any typos.

Re: Code Templates & lambdas

Posted by Jaroslav Tulach <ja...@gmail.com>.
Dne neděle 30. ledna 2022 12:32:22 CET, Michael Bien napsal(a):
> On 30.01.22 04:34, Jaroslav Tulach wrote:
> >>>> It's funny how that change has made it both far easier to change and
> >>>> yet somehow far more confusing for people.
> > 
> > ;-)
> > 
> >> ... Check
> >> https://github.com/apache/netbeans/pull/2960 and maybe suggest an
> >> improved text in a follow up PR?
> > 
> > Right.
> > 
> > I happily review any PR related to the #2960 improvement.
> > -jt
> 
> is it possible to hide some templates from the user?
> 
> I tried to implement auto completion for lambda expressions here:

Hello Michalel,
this part was written by Dušan Bálek. CCing.
-jt


> 
> https://github.com/apache/netbeans/pull/3458
> 
> The problem is that the inserted code is a template (which doesn't do
> anything interesting anyway) and it doesn't really make sense to let the
> user edit lambda templates (esp not for expressions). The completion
> logic has to mark the inserted code with ${..} so that the user can jump
> with tab between selected sections after completion. If someone would
> edit the template this all would break quickly.
> 
> -mbien





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Code Templates & lambdas

Posted by Michael Bien <mb...@gmail.com>.
On 30.01.22 04:34, Jaroslav Tulach wrote:
>>>> It's funny how that change has made it both far easier to change and
>>>> yet somehow far more confusing for people.
> ;-)
>
>
>> ... Check
>> https://github.com/apache/netbeans/pull/2960 and maybe suggest an
>> improved text in a follow up PR?
> Right.
>
> I happily review any PR related to the #2960 improvement.
> -jt
>
>
is it possible to hide some templates from the user?

I tried to implement auto completion for lambda expressions here:

https://github.com/apache/netbeans/pull/3458

The problem is that the inserted code is a template (which doesn't do 
anything interesting anyway) and it doesn't really make sense to let the 
user edit lambda templates (esp not for expressions). The completion 
logic has to mark the inserted code with ${..} so that the user can jump 
with tab between selected sections after completion. If someone would 
edit the template this all would break quickly.

-mbien



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by Jaroslav Tulach <ja...@gmail.com>.
> > > It's funny how that change has made it both far easier to change and
> > > yet somehow far more confusing for people.

;-)


> ... Check
> https://github.com/apache/netbeans/pull/2960 and maybe suggest an
> improved text in a follow up PR?

Right.

I happily review any PR related to the #2960 improvement.
-jt




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by Neil C Smith <ne...@apache.org>.
On Wed, 26 Jan 2022 at 22:35, Scott Palmer <sw...@gmail.com> wrote:
> The text in that PR says:
>
>  Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
>  Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
>
> Yes, that could be confusing.
>
> Is it a “template” or a “license”?
> Why are there two different links to do the same thing?

One is a licence, one is a template!  They are two different links to
two different things.  If you think that text can be improved, provide
a PR with updates ..

> Why does it say “click” if according to Michael) a ctrl-click is required?

Anything that requires clicking like that in the editor requires ctrl,
right?  Now, that is a useful UI trick to inform new users about.

> Interesting side note… I just noticed a UI oddity.  Generally when a menu item causes a new dialog to appear (i.e. the action requires further input from the user), the menu item text ends with an ellipsis “…’.  E.,g “Save” as no ellipsis, but “Save As…” does.  Shouldn’t  the Tools -> Templates menu item also follow this pattern?  I.e. not “Templates” but “Templates…” ?

Neither is it Plugins... or Options...

It should only be modal dialogs with an ellipsis I think.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by Scott Palmer <sw...@gmail.com>.

> On Jan 26, 2022, at 2:07 PM, Neil C Smith <ne...@apache.org> wrote:
> 
> On Wed, 26 Jan 2022 at 18:59, Scott Palmer <sw...@gmail.com> wrote:
>>> On Jan 26, 2022, at 12:19 PM, Neil C Smith <ne...@apache.org> wrote:
>>> 
>>> On Wed, 26 Jan 2022 at 16:54, Michael Bien <mb...@gmail.com> wrote:
>>>> ctrl+click the hyperlink, empty the template, save.
>>> 
>>> It's funny how that change has made it both far easier to change and
>>> yet somehow far more confusing for people.
>> 
>> If all that is needed is to tell them "ctrl+click the hyperlink, change the template
>> (or clear it completely if you don’t want one), save”  then just put that text in the
>> initial value for the default template as well. ... There is no way I would have found
>> where to change it without some google searches.
> 
> That is almost exactly what it was changed to, and why!  Check
> https://github.com/apache/netbeans/pull/2960 and maybe suggest an
> improved text in a follow up PR?

The text in that PR says:

 Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template 


Yes, that could be confusing.

Is it a “template” or a “license”?
Why are there two different links to do the same thing?
Why does it say “click” if according to Michael) a ctrl-click is required?
Does it require a command-click on a Mac?

To a new user that isn’t a template or a license - it’s a comment.

How about:

  This comment is added automatically to the top of new source files.  It comes from the default license template.
  You should change the template to something more suitable, which can be having no license comment at all.
  To change this default license template ctrl-click (command-click on macOS) the following link:
  nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
  For template editing help refer to https://netbeans.apache.org/some/parth/to/template/help


I always change mine to insert a copyright statement with the current year… it is not as straight-forward as one might expect. The ${date?date?string("yyyy”)} part is not something that is easily discoverable.

<#if licenseFirst??>
${licenseFirst}
</#if>
${licensePrefix}Copyright (C) ${date?date?string("yyyy")} Me
<#if licenseLast??>
${licenseLast}
</#if>

The templates can be quite powerful, but all that macro stuff can be confusing for inexperienced programmers (e.g. students), so having a link to some documentation or a template tutorial in the default template would be helpful, I think.

Interesting side note… I just noticed a UI oddity.  Generally when a menu item causes a new dialog to appear (i.e. the action requires further input from the user), the menu item text ends with an ellipsis “…’.  E.,g “Save” as no ellipsis, but “Save As…” does.  Shouldn’t  the Tools -> Templates menu item also follow this pattern?  I.e. not “Templates” but “Templates…” ?

Scott



Re: That Darn License Header

Posted by Neil C Smith <ne...@apache.org>.
On Wed, 26 Jan 2022 at 18:59, Scott Palmer <sw...@gmail.com> wrote:
> > On Jan 26, 2022, at 12:19 PM, Neil C Smith <ne...@apache.org> wrote:
> >
> > On Wed, 26 Jan 2022 at 16:54, Michael Bien <mb...@gmail.com> wrote:
> >> ctrl+click the hyperlink, empty the template, save.
> >
> > It's funny how that change has made it both far easier to change and
> > yet somehow far more confusing for people.
>
> If all that is needed is to tell them "ctrl+click the hyperlink, change the template
> (or clear it completely if you don’t want one), save”  then just put that text in the
> initial value for the default template as well. ... There is no way I would have found
> where to change it without some google searches.

That is almost exactly what it was changed to, and why!  Check
https://github.com/apache/netbeans/pull/2960 and maybe suggest an
improved text in a follow up PR?

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by Scott Palmer <sw...@gmail.com>.

> On Jan 26, 2022, at 12:19 PM, Neil C Smith <ne...@apache.org> wrote:
> 
> On Wed, 26 Jan 2022 at 16:54, Michael Bien <mb...@gmail.com> wrote:
>> ctrl+click the hyperlink, empty the template, save.
> 
> It's funny how that change has made it both far easier to change and
> yet somehow far more confusing for people.

If all that is needed is to tell them "ctrl+click the hyperlink, change the template (or clear it completely if you don’t want one), save”  then just put that text in the initial value for the default template as well.

The language in the default license should clearly explain what it is and how to change it.

When I first encountered it I had no idea that comment was supposed to be a “License”.  There is no way I would have found where to change it without some google searches.

I use the default license to insert a copyright disclaimer.  To me a copyright notice and a “license” are different things.  I would rather call the template a “Default file comment”

Regards,

Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by Neil C Smith <ne...@apache.org>.
On Wed, 26 Jan 2022 at 16:54, Michael Bien <mb...@gmail.com> wrote:
> ctrl+click the hyperlink, empty the template, save.

It's funny how that change has made it both far easier to change and
yet somehow far more confusing for people.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: That Darn License Header

Posted by Michael Bien <mb...@gmail.com>.
ctrl+click the hyperlink, empty the template, save.

-mbien

On 26.01.22 17:33, Kenneth Fogel wrote:
> I am one of those who would prefer an empty license comment block at the beginning of a file. I have noticed that the header has changed and now links directly to two files. Unfortunately both files are unintelligible to me. Imagine how confused my students, in an Intro course I am giving right now, will think of these files. This was how I found the Help bug as I wanted to look up how to just eliminate these comments. Instructions on how to squash this block will be appreciated.
>
> Ken
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists