RE: [JBoss-dev] Re: on the use of final

2001-11-28 Thread philipborlin


I want to hear your message on "visibility".

-Phil



   
  
"marc fleury"  
  
<[EMAIL PROTECTED]>To: "Luke Taylor"   
  
Sent by:   
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED]
"Jboss-Development@Lists. Sourceforge. Net"   
eforge.net 
<[EMAIL PROTECTED]> 
   cc: 
  
   Subject: RE: 
[JBoss-dev] Re: on the use   
11/28/2001 08:30 AMof final
  
   
  
   
  






|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Luke
|Taylor
|Sent: Wednesday, November 28, 2001 10:14 AM
|To: Jboss-Development@Lists. Sourceforge. Net
|Subject: Re: [JBoss-dev] Re: on the use of final
|
|
|Dain Sundstrom wrote:
|
| > There are like five hundred rules on that page. What is it specifically
| > flagging as a bad practice?  I am actually interested.
| >
|
|I had a look at the page too (try searching for the word "final" :-).
|But it doesn't really seem say more than the obvious "Helps compiler
|optimization and more clearly documents the use of classes" ... So it
|can be helpful for people reading the code to know that it has no
|subclases, but it's not really a big deal.
|
|Together also has some QA rules relating to the use of final. One is
|that *all* instantiated classes should be final. The others just seem to
|relate to constant attributes which seems fair enough.

sounds like bulls to me

one day I will send a message on "visibility" (public/protected/private),
basically it is useless, and other OO-weewee-touching people will argue
about for hours but I got real work to do :)

marcf

"The wallpaper pattern"
-- Some guys at DrKW --

|
|Luke.
|
|--
|  Luke Taylor.  Monkey Machine Ltd.
|  PGP Key ID: 0x57E9523Chttp://www.mkeym.com
|
|
|
|
|___
|Jboss-development mailing list
|[EMAIL PROTECTED]
|https://lists.sourceforge.net/lists/listinfo/jboss-development


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development





___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] Re: on the use of final

2001-11-28 Thread marc fleury

in this case more like specialk 

makes absolutely no sense...

marcf


|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Luke
|Taylor
|Sent: Wednesday, November 28, 2001 12:24 PM
|To: danch
|Cc: Jboss-Development@Lists. Sourceforge. Net
|Subject: Re: [JBoss-dev] Re: on the use of final
|
|
|danch wrote:
|
|> 
|> ...
|> 
|> Snort!
|> 
|
|
|Cocaine? Late night coding again ...
|
|
|
|-- 
|  Luke Taylor.  Monkey Machine Ltd.
|  PGP Key ID: 0x57E9523Chttp://www.mkeym.com
|
|
|
|
|___
|Jboss-development mailing list
|[EMAIL PROTECTED]
|https://lists.sourceforge.net/lists/listinfo/jboss-development

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Re: on the use of final

2001-11-28 Thread Luke Taylor

danch wrote:

> 
> ...
> 
> Snort!
> 


Cocaine? Late night coding again ...



-- 
  Luke Taylor.  Monkey Machine Ltd.
  PGP Key ID: 0x57E9523Chttp://www.mkeym.com




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Re: on the use of final

2001-11-28 Thread danch



Luke Taylor wrote:

> Dain Sundstrom wrote:
> 
>  > There are like five hundred rules on that page. What is it specifically
>  > flagging as a bad practice?  I am actually interested.
>  >
> 
> I had a look at the page too (try searching for the word "final" :-). 
> But it doesn't really seem say more than the obvious "Helps compiler 
> optimization and more clearly documents the use of classes" ... So it 
> can be helpful for people reading the code to know that it has no 
> subclases, but it's not really a big deal.
> 
> Together also has some QA rules relating to the use of final. One is 
> that *all* instantiated classes should be final. 


Snort!




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Re: on the use of final

2001-11-28 Thread David Jencks

On 2001.11.28 10:13:34 -0500 Luke Taylor wrote:
> Dain Sundstrom wrote:
> 
>  > There are like five hundred rules on that page. What is it
> specifically
>  > flagging as a bad practice?  I am actually interested.
>  >
> 
> I had a look at the page too (try searching for the word "final" :-). 
> But it doesn't really seem say more than the obvious "Helps compiler 
> optimization and more clearly documents the use of classes" ... So it 
> can be helpful for people reading the code to know that it has no 
> subclases, but it's not really a big deal.
> 
> Together also has some QA rules relating to the use of final. One is 
> that *all* instantiated classes should be final. The others just seem to 
> relate to constant attributes which seems fair enough.

Effective Java (Joshua Bloch) has pretty extensive discussion of why you'd
want to use final.  I'm still digesting it.

david jencks
> 
> Luke.
> 
> -- 
>   Luke Taylor.  Monkey Machine Ltd.
>   PGP Key ID: 0x57E9523Chttp://www.mkeym.com
> 
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] Re: on the use of final

2001-11-28 Thread marc fleury



|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Luke
|Taylor
|Sent: Wednesday, November 28, 2001 10:14 AM
|To: Jboss-Development@Lists. Sourceforge. Net
|Subject: Re: [JBoss-dev] Re: on the use of final
|
|
|Dain Sundstrom wrote:
|
| > There are like five hundred rules on that page. What is it specifically
| > flagging as a bad practice?  I am actually interested.
| >
|
|I had a look at the page too (try searching for the word "final" :-).
|But it doesn't really seem say more than the obvious "Helps compiler
|optimization and more clearly documents the use of classes" ... So it
|can be helpful for people reading the code to know that it has no
|subclases, but it's not really a big deal.
|
|Together also has some QA rules relating to the use of final. One is
|that *all* instantiated classes should be final. The others just seem to
|relate to constant attributes which seems fair enough.

sounds like bulls to me

one day I will send a message on "visibility" (public/protected/private),
basically it is useless, and other OO-weewee-touching people will argue
about for hours but I got real work to do :)

marcf

"The wallpaper pattern"
-- Some guys at DrKW --

|
|Luke.
|
|--
|  Luke Taylor.  Monkey Machine Ltd.
|  PGP Key ID: 0x57E9523Chttp://www.mkeym.com
|
|
|
|
|___
|Jboss-development mailing list
|[EMAIL PROTECTED]
|https://lists.sourceforge.net/lists/listinfo/jboss-development


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Re: on the use of final

2001-11-28 Thread Luke Taylor

Dain Sundstrom wrote:

 > There are like five hundred rules on that page. What is it specifically
 > flagging as a bad practice?  I am actually interested.
 >

I had a look at the page too (try searching for the word "final" :-). 
But it doesn't really seem say more than the obvious "Helps compiler 
optimization and more clearly documents the use of classes" ... So it 
can be helpful for people reading the code to know that it has no 
subclases, but it's not really a big deal.

Together also has some QA rules relating to the use of final. One is 
that *all* instantiated classes should be final. The others just seem to 
relate to constant attributes which seems fair enough.

Luke.

-- 
  Luke Taylor.  Monkey Machine Ltd.
  PGP Key ID: 0x57E9523Chttp://www.mkeym.com




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] Re: on the use of final

2001-11-27 Thread Dain Sundstrom

There are like five hundred rules on that page. What is it specifically
flagging as a bad practice?  I am actually interested.

-dain


> -Original Message-
> From: Weir, John [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 27, 2001 5:43 PM
> To: Jboss-Development@Lists. Sourceforge. Net
> Subject: RE: [JBoss-dev] Re: on the use of final
> 
> 
> We use JTest from parasoft for static analysis. It usually 
> flags up these
> sort of errors. The reasoning behind their rules can be found at:
> 
> http://www.parasoft.com/products/jtest/manuals/v4_1/r_index.ht
> m#1001102 -
> Scan to correct section
> 
> John
> -Original Message-
> From: Jason Dillon [mailto:[EMAIL PROTECTED]]
> Sent: 23 November 2001 20:32
> To: marc fleury
> Cc: Jboss-Development@Lists. Sourceforge. Net
> Subject: [JBoss-dev] Re: on the use of final
> 
> 
> > My question though is "is it worth it?" what are the 
> advantages of using
> > final as opposed to not using final and not worrying about 
> the mutability
> of
> > it?
> > 
> > speed gain?
> 
> Depends on where final is used.  For final as a method 
> attribute modifier 
> there is no speed increase, it is just an engineering tool to 
> prevent the 
> value from being modified.  It is common to use final for 
> constructors.  For
> 
> example:
> 
>class MyClass
>{
>   int foo;
>
>   MyClass(int foo) {
>  foo = foo;
>   }
>}
> 
> This is an error, but will compile and execute.  To avoid 
> this type of bug, 
> mark method attributes which should not change as final:
> 
>class MyClass  
>{ 
>   int foo;
>   
>   MyClass(final int foo) {
>  foo = foo; // COMPILE ERROR
>   }
>} 
> 
> Final on a method, could cause a speed increase, allowing the 
> compiler to 
> inline the method.  From what I remember, the HotSpot VM 
> folks at JavaOne 
> said that this will have little or no effect due to new 
> compiler techniques.
> 
>  * * *
> 
> Which usage of final are you refering too?
> 
> --jason
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] Re: on the use of final

2001-11-27 Thread Weir, John

We use JTest from parasoft for static analysis. It usually flags up these
sort of errors. The reasoning behind their rules can be found at:

http://www.parasoft.com/products/jtest/manuals/v4_1/r_index.htm#1001102 -
Scan to correct section

John
-Original Message-
From: Jason Dillon [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2001 20:32
To: marc fleury
Cc: Jboss-Development@Lists. Sourceforge. Net
Subject: [JBoss-dev] Re: on the use of final


> My question though is "is it worth it?" what are the advantages of using
> final as opposed to not using final and not worrying about the mutability
of
> it?
> 
> speed gain?

Depends on where final is used.  For final as a method attribute modifier 
there is no speed increase, it is just an engineering tool to prevent the 
value from being modified.  It is common to use final for constructors.  For

example:

   class MyClass
   {
  int foo;
   
  MyClass(int foo) {
 foo = foo;
  }
   }

This is an error, but will compile and execute.  To avoid this type of bug, 
mark method attributes which should not change as final:

   class MyClass  
   { 
  int foo;
  
  MyClass(final int foo) {
 foo = foo; // COMPILE ERROR
  }
   } 

Final on a method, could cause a speed increase, allowing the compiler to 
inline the method.  From what I remember, the HotSpot VM folks at JavaOne 
said that this will have little or no effect due to new compiler techniques.

 * * *

Which usage of final are you refering too?

--jason



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development