RE: More abuse of coding styles...

2002-01-11 Thread GOMEZ Henri

>> I agree - using the compiler to detect errors is such a 
>stupid idea. "Real
>> programmers" dont need that.
>
>Real programmers don't use compilers...
>

java is compiled whereas JavaScript is interpreted.

May be we should relax your affirmation ;)

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-10 Thread Paulo Gaspar

This thread goes so loong with all of you
showing yours that I can't resist showing mine:


public void setSomething(Object i_something)
{
m_something = i_something;
}


Or even...

public void setSomething(Object i_something)
{
Object something;  // a local something

something = fixThat(i_something);

if (isCool(something))
{
m_something = i_something;
}
else
{
throw new IllegalArgumentException("What a bad thing we have
here!!!");
}
}


Prefix paranoia huh?

But I never mix class members with parameters or with local
vars due to similar spellings and misspellings and so.

Have fun,
Paulo Gaspar


> -Original Message-
> From: Berin Loritsch [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 10, 2002 11:26 PM
> To: Jakarta General List
> Subject: Re: More abuse of coding styles...
>
>
> Sam Ruby wrote:
>
> > Stephane Bailliez wrote:
> >
> >>I can understand why:
> >>
> >>public void setSomething(Object something){
> >>   something = something;
> >>}
> >>
> >
> > Another solution is
> >
> > public void setSomething(Object something) {
> >  this.something = something;
> > }
>
>
> Just beware of this bug:
>
> public void setSomething(Object somthing) { // something misspelled
>  this.something = something;
> }


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: More abuse of coding styles...

2002-01-10 Thread Conor MacNeill

> From: Berin Loritsch [mailto:[EMAIL PROTECTED]]
>
>
> Just beware of this bug:
>
> public void setSomething(Object somthing) { // something misspelled
>  this.something = something;
> }
>

Don't you use a spell checker on your code?

Actually this problem is one reason why it is better to use single letter
variable names. You can't spell them incorrectly.

:-) :-) :-)

Anyone seen the groundhog yet?

Conor



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Berin Loritsch

Sam Ruby wrote:

> Stephane Bailliez wrote:
> 
>>I can understand why:
>>
>>public void setSomething(Object something){
>>   something = something;
>>}
>>
> 
> Another solution is
> 
> public void setSomething(Object something) {
>  this.something = something;
> }


Just beware of this bug:

public void setSomething(Object somthing) { // something misspelled
 this.something = something;
}





-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
 - Benjamin Franklin


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-10 Thread Sam Ruby

Stephane Bailliez wrote:
>
> I can understand why:
>
> public void setSomething(Object something){
>something = something;
> }

Another solution is

public void setSomething(Object something) {
 this.something = something;
}

- Sam Ruby


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Daniel Rall

Tim Vernum <[EMAIL PROTECTED]> writes:

>> > public void setSomethingComplicated(Object sometingComplicateed){ 
>> >   this.somethingComplicated = somethingComplicated;
>> > }
>> 
>> There's only possibility of problem there when you don't copy and
>> paste your variable names.
>
> I find (subjectively) that if you are a reasonable typer, then copy
> and paste is a lot slower than just re-typing the variable name.
> Especially in vi(m).

Being a heavy commandline user, I type at a fairly rapid rate.
Nevertheless, I find copying and pasting with XEmacs much faster (and
safer, as pointed out above) than typing.  Additionally, the reduction
in keystrokes in good for the wrists.  :)

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Peter Donald

On Thu, 10 Jan 2002 22:16, Geir Magnusson Jr. wrote:
> On 1/10/02 6:11 AM, "Stephane Bailliez" <[EMAIL PROTECTED]> wrote:
> >> -Original Message-
> >> From: Geir Magnusson Jr. [mailto:[EMAIL PROTECTED]]
> >
> > [...]
> >
> >> Real programmers don't use compilers...
> >
> > It looks like there were needs for some punching balls to start 2002 :-)
> > In 10 days there are more messages in jakarta-general than in the last 2
> > months.
>
> We got a lot accomplished though :)

like always :)

-- 
Cheers,

Pete


"Liberty means responsibility. That is 
  why most men dread it." - Locke



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Geir Magnusson Jr.

On 1/10/02 6:11 AM, "Stephane Bailliez" <[EMAIL PROTECTED]> wrote:

>> -Original Message-
>> From: Geir Magnusson Jr. [mailto:[EMAIL PROTECTED]]
> [...]
>> Real programmers don't use compilers...
> 
> It looks like there were needs for some punching balls to start 2002 :-)
> In 10 days there are more messages in jakarta-general than in the last 2
> months. 
> 

We got a lot accomplished though :)

-- 
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Be a giant.  Take giant steps.  Do giant things...


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-10 Thread Stephane Bailliez

> -Original Message-
> From: Geir Magnusson Jr. [mailto:[EMAIL PROTECTED]]
[...]
> Real programmers don't use compilers...

It looks like there were needs for some punching balls to start 2002 :-)
In 10 days there are more messages in jakarta-general than in the last 2
months. 

Stephane

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Peter Donald

On Thu, 10 Jan 2002 21:59, Geir Magnusson Jr. wrote:
> On 1/10/02 2:54 AM, "Peter Donald" <[EMAIL PROTECTED]> wrote:
> > On Thu, 10 Jan 2002 14:07, Daniel Rall wrote:
> >> Ceki Glc <[EMAIL PROTECTED]> writes:
> >>> People who repeatedly forget to type "this" represent a minority and
> >>> should perhaps look to exercise a different profession.
> >>
> >> Agreed.
> >
> > I agree - using the compiler to detect errors is such a stupid idea.
> > "Real programmers" dont need that.
>
> Real programmers don't use compilers...

too true ;)

-- 
Cheers,

Pete

--
   "Don't play dumb with me. 
I happen to be an expert at that" 
   - Maxwell Smart
--

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Geir Magnusson Jr.

On 1/10/02 2:54 AM, "Peter Donald" <[EMAIL PROTECTED]> wrote:

> On Thu, 10 Jan 2002 14:07, Daniel Rall wrote:
>> Ceki Glc <[EMAIL PROTECTED]> writes:
>>> People who repeatedly forget to type "this" represent a minority and
>>> should perhaps look to exercise a different profession.
>> 
>> Agreed.
> 
> I agree - using the compiler to detect errors is such a stupid idea. "Real
> programmers" dont need that.

Real programmers don't use compilers...

-- 
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
"Now what do we do?"


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Peter Donald

On Thu, 10 Jan 2002 14:07, Daniel Rall wrote:
> Ceki Glc <[EMAIL PROTECTED]> writes:
> > People who repeatedly forget to type "this" represent a minority and
> > should perhaps look to exercise a different profession.
>
> Agreed.

I agree - using the compiler to detect errors is such a stupid idea. "Real 
programmers" dont need that. 

-- 
Cheers,

Pete

*--*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."  |
|   -Abraham Lincoln   |
*--*


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-10 Thread Ceki Gulcu


Micael,

I guess my remarks on typing "this" do sound arrogant.
Point well taken. Regards, Ceki

--- Micael Padraig Og mac Grene
<[EMAIL PROTECTED]> wrote:
> At 07:07 PM 1/9/02 -0800, you wrote:
> >Ceki Gülcü <[EMAIL PROTECTED]> writes:
> >
> > > People who repeatedly forget to type "this"
> represent a minority and
> > > should perhaps look to exercise a different
> profession.
> >
> >Agreed.
> >
> > > The problem with
> > >
> > > public void setSomething(Object something){
> > >   this.something = something;
> > > }
> > >
> > > is
> > >
> > > public void setSomethingComplicated(Object
> sometingComplicateed){
> > >   this.somethingComplicated =
> somethingComplicated;
> > > }
> >
> >There's only possibility of problem there when you
> don't copy and
> >paste your variable names.
> 
> 
> On the one hand, arrogance is never helpful, if you
> mean to be helpful.  If 
> you want to show off how smart you are, on the other
> hand, it is a great 
> tool.  The difference is whether you want to talk
> about yourself or the 
> subject-matter.
> 
> - micael
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-09 Thread Micael Padraig Og mac Grene

At 07:07 PM 1/9/02 -0800, you wrote:
>Ceki Gülcü <[EMAIL PROTECTED]> writes:
>
> > People who repeatedly forget to type "this" represent a minority and
> > should perhaps look to exercise a different profession.
>
>Agreed.
>
> > The problem with
> >
> > public void setSomething(Object something){
> >   this.something = something;
> > }
> >
> > is
> >
> > public void setSomethingComplicated(Object sometingComplicateed){
> >   this.somethingComplicated = somethingComplicated;
> > }
>
>There's only possibility of problem there when you don't copy and
>paste your variable names.


On the one hand, arrogance is never helpful, if you mean to be helpful.  If 
you want to show off how smart you are, on the other hand, it is a great 
tool.  The difference is whether you want to talk about yourself or the 
subject-matter.

- micael


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-09 Thread Tim Vernum


> > public void setSomethingComplicated(Object sometingComplicateed){ 
> >   this.somethingComplicated = somethingComplicated;
> > }
> 
> There's only possibility of problem there when you don't copy and
> paste your variable names.

I find (subjectively) that if you are a reasonable typer, then copy
and paste is a lot slower than just re-typing the variable name.
Especially in vi(m).


NOTICE
This e-mail and any attachments are confidential and may contain copyright material of 
Macquarie Bank or third parties. If you are not the intended recipient of this email 
you should not read, print, re-transmit, store or act in reliance on this e-mail or 
any attachments, and should destroy all copies of them. Macquarie Bank does not 
guarantee the integrity of any emails or any attached files. The views or opinions 
expressed are the author's own and may not reflect the views or opinions of Macquarie 
Bank. 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-09 Thread Daniel Rall

Ceki Gülcü <[EMAIL PROTECTED]> writes:

> People who repeatedly forget to type "this" represent a minority and
> should perhaps look to exercise a different profession.

Agreed.

> The problem with
>
> public void setSomething(Object something){ 
>   this.something = something; 
> }
>
> is 
>
> public void setSomethingComplicated(Object sometingComplicateed){ 
>   this.somethingComplicated = somethingComplicated;
> }

There's only possibility of problem there when you don't copy and
paste your variable names.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-09 Thread Daniel Rall

Stephane Bailliez <[EMAIL PROTECTED]> writes:

> I'm the lucky user of Intellij IDEA which has a code layout feature that
> allows to reformat the whole code in a snap w/ specific code style,
> reorganize imports and remove useless one. I'm using this extensively and
> this is damn cool.

Shockingly enough (!), XEmacs does this too.  ;-)

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-09 Thread Daniel Rall

"Craig R. McClanahan" <[EMAIL PROTECTED]> writes:

> On Fri, 4 Jan 2002, Erik Hatcher wrote:
>
>> Date: Fri, 4 Jan 2002 19:27:52 -0500
>> From: Erik Hatcher <[EMAIL PROTECTED]>
>> Reply-To: Jakarta General List <[EMAIL PROTECTED]>
>> To: Jakarta General List <[EMAIL PROTECTED]>
>> Subject: Re: More abuse of coding styles...
>>
>> Rule #1 from The Elements of Java Style is:
>>
>> Adhere to the style of the original
>>
>
> IIRC, we actually had this rule explicitly in the JServ code conventions
> ... looks like it didn't make the transition into the Jakarta docs though.

I am willing to make the xdocs change.  Anyone opposed?

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: More abuse of coding styles...

2002-01-06 Thread Peter Donald

On Sun, 6 Jan 2002 15:22, Steve Downey wrote:
> > -Original Message-
> > From: Peter Donald [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, January 05, 2002 9:53 PM
> > To: Jakarta General List
> > Subject: Re: More abuse of coding styles...
> >
> > On Sun, 6 Jan 2002 11:26, Steve Downey wrote:
> > > Your javac has a configuration setting for the class names of inner
> > > classes? Although the inner classes use a $ embedded,
> >
> > rather than as a lead
> >
> > > character. It's a similar issue.
> >
> > And whats that got to do with the price of fish? $ is not valid in
> > identifiers in java language (but fine in .class file format).
>
> $ is a perfectly fine character in a java identifier. Even as the initial
> character. That's why it's specifically mentioned in the sun coding style
> guide. It's legal, but not meant for use by all.
> IOW:
> class $ {
>   public int $() {
> int $ = 5;
> return $;
>   }
>
>   static public void main(String args[]) {
> $ dollar = new $();
> System.out.println(dollar.$());
>   }
> }
>
> is legal. Ugly as hell. But legal.

hmm ... didn't know that ... wonder why when I decompiled some stuff with $'s 
in it it wouldn't recompile ...

> > Sure it is - it makes it acceptable for them to write poor code.
>
> In what way does it make it acceptable for them to write poor code? For
> example, the JSP spec reserves _jsp, jsp, _jspx and jspx for identifiers
> used in the classes generated by the page compiler. What other way do you
> propose to guarantee that the compiler won't generate names that conflict
> with ones I declare in a page?

you think global variables are good aswell? Theres plenty of mechanisms to 
avoid namespace collisions - none of which require any magic variable names 
be injected into a global namespace.

-- 
Cheers,

Pete

---
|  I thought there was a knob on the TV to turn up the intelligence.  |
|  There's a knob called "brightness", but it doesn't work.   |
---

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: More abuse of coding styles...

2002-01-05 Thread Geir Magnusson Jr.

On 1/5/02 11:22 PM, "Steve Downey" <[EMAIL PROTECTED]> wrote:
> 
> In what way does it make it acceptable for them to write poor code? For
> example, the JSP spec reserves _jsp, jsp, _jspx and jspx for identifiers
> used in the classes generated by the page compiler. What other way do you
> propose to guarantee that the compiler won't generate names that conflict
> with ones I declare in a page?
> 
> 

As a SWAG, I would think you could parse out the ones you declare, keep a
list, and ensure you don't generate anything that conflicts?

-- 
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-05 Thread Steve Downey

> -Original Message-
> From: Peter Donald [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 05, 2002 9:53 PM
> To: Jakarta General List
> Subject: Re: More abuse of coding styles...
> 
> 
> On Sun, 6 Jan 2002 11:26, Steve Downey wrote:
> > Your javac has a configuration setting for the class names of inner
> > classes? Although the inner classes use a $ embedded, 
> rather than as a lead
> > character. It's a similar issue.
> 
> And whats that got to do with the price of fish? $ is not valid in 
> identifiers in java language (but fine in .class file format).
> 

$ is a perfectly fine character in a java identifier. Even as the initial
character. That's why it's specifically mentioned in the sun coding style
guide. It's legal, but not meant for use by all. 
IOW:
class $ {
  public int $() {
int $ = 5;
return $;
  }

  static public void main(String args[]) {
$ dollar = new $();
System.out.println(dollar.$());
  }
}

is legal. Ugly as hell. But legal.

> > The recommendation in C that _ is reserved for the 
> implementor is not a
> > linker issue, but more of a namespace scoping issue.
> 
> errr  go have a look at the evolution of c/linkers and 
> the pains some 
> people went through re different linker/header file combos.

Been there, done that, have burn marks. The identifier name space starting
with _ is reserved for implementors to provide such things as library
functions with external linkage, used by the rest of the library, without
running into conflicts with user declarations. The compiler is even entitled
to emit calls to these functions, or reference these variables, without your
direction. So if you name variables or functions things like _alloc, or
_err, and your program crashes and burns, you've got no one to blame but
yourself.

> 
> > There isn't a good way
> > of marking a function as to be used by the implementor or 
> the compiler, in
> > such a way that a programmer can not conflict with it. Java 
> has private
> > which accomplishes that.
> 
> private is an access marker - it does not define any 
> metatype. Java has a 
> crap metadata infrastructure - thats one of the things that 
> C# did far better 
> than java. Its a feature people have been asking for since 
> 1.0 days but sun 
> keeps dropping the ball or implementing workarounds.
> 
> > But reserving some characters for the implementors is not 
> really a bad
> > thing.
> 
> Sure it is - it makes it acceptable for them to write poor code.
> 

In what way does it make it acceptable for them to write poor code? For
example, the JSP spec reserves _jsp, jsp, _jspx and jspx for identifiers
used in the classes generated by the page compiler. What other way do you
propose to guarantee that the compiler won't generate names that conflict
with ones I declare in a page?


-SMD
<><><><><><><><><><><><><><><><><><><><><>This electronic mail transmission
may contain confidential information and is intended only for the person(s)
named.  Any use, copying or disclosure by any other person is strictly
prohibited.  If you have received this transmission in error, please notify
the sender via e-mail. <><><><><><><><><><><><><><><><><><><><><>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: More abuse of coding styles...

2002-01-05 Thread Peter Donald

On Sun, 6 Jan 2002 11:26, Steve Downey wrote:
> Your javac has a configuration setting for the class names of inner
> classes? Although the inner classes use a $ embedded, rather than as a lead
> character. It's a similar issue.

And whats that got to do with the price of fish? $ is not valid in 
identifiers in java language (but fine in .class file format).

> The recommendation in C that _ is reserved for the implementor is not a
> linker issue, but more of a namespace scoping issue.

errr  go have a look at the evolution of c/linkers and the pains some 
people went through re different linker/header file combos.

> There isn't a good way
> of marking a function as to be used by the implementor or the compiler, in
> such a way that a programmer can not conflict with it. Java has private
> which accomplishes that.

private is an access marker - it does not define any metatype. Java has a 
crap metadata infrastructure - thats one of the things that C# did far better 
than java. Its a feature people have been asking for since 1.0 days but sun 
keeps dropping the ball or implementing workarounds.

> But reserving some characters for the implementors is not really a bad
> thing.

Sure it is - it makes it acceptable for them to write poor code.

-- 
Cheers,

Pete

"The perfect way is only difficult for those who pick and choose.  Do not
like, do not dislike; all will then be clear.  Make a hairbreadth
difference and heaven and earth are set apart; if you want the truth to
stand clear before you, never be for or against." - Bruce Lee

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-05 Thread Steve Downey

Your javac has a configuration setting for the class names of inner classes?
Although the inner classes use a $ embedded, rather than as a lead
character. It's a similar issue.

The recommendation in C that _ is reserved for the implementor is not a
linker issue, but more of a namespace scoping issue. There isn't a good way
of marking a function as to be used by the implementor or the compiler, in
such a way that a programmer can not conflict with it. Java has private
which accomplishes that. 

But reserving some characters for the implementors is not really a bad
thing.

> -Original Message-
> From: Peter Donald [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 04, 2002 8:15 PM
> To: Jakarta General List
> Subject: Re: More abuse of coding styles...
> 
> 
> On Sat, 5 Jan 2002 03:19, Steve Downey wrote:
> > > 
> <http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367>
> > >
> > > | "Variable names should not start with underscore _ or 
> dollar sign $
> > > | characters, even though both are allowed."
> > >
> > > The _instanceVariable and also the __staticVariable idea
> > > makes real good
> > > sense to me nowadays. Do you have any arguments against it?
> > > (btw; this is
> > > a genuine question!)..
> >
> > Because those characters are used by implementors and code 
> generators.
> 
> all java code generators I use have configurable settings.
> 
> > They
> > are legal, but not intended to be used by programmers.
> 
> Not relevent for java. In C this may be so but that mainly 
> had to do with how 
> the linker mangled names. And this was more separated out 
> between system-user 
> code
> 
> -- 
> Cheers,
> 
> Pete
> 
> 
> Sorry, I forgot to take my medication today.
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
<><><><><><><><><><><><><><><><><><><><><>This electronic mail transmission
may contain confidential information and is intended only for the person(s)
named.  Any use, copying or disclosure by any other person is strictly
prohibited.  If you have received this transmission in error, please notify
the sender via e-mail. <><><><><><><><><><><><><><><><><><><><><>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: More abuse of coding styles...

2002-01-04 Thread Ted Husted

Any time we want switch from Sun's conventions to the Elements of Java
Style, my +1 is cocked and ready. 

"Craig R. McClanahan" wrote:
> 
> On Fri, 4 Jan 2002, Erik Hatcher wrote:
> 
> > Date: Fri, 4 Jan 2002 19:27:52 -0500
> > From: Erik Hatcher <[EMAIL PROTECTED]>
> > Reply-To: Jakarta General List <[EMAIL PROTECTED]>
> > To: Jakarta General List <[EMAIL PROTECTED]>
> > Subject: Re: More abuse of coding styles...
> >
> > Rule #1 from The Elements of Java Style is:
> >
> > Adhere to the style of the original
> >
> 
> IIRC, we actually had this rule explicitly in the JServ code conventions
> ... looks like it didn't make the transition into the Jakarta docs though.
> 
> Craig

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: More abuse of coding styles...

2002-01-04 Thread Craig R. McClanahan



On Fri, 4 Jan 2002, Erik Hatcher wrote:

> Date: Fri, 4 Jan 2002 19:27:52 -0500
> From: Erik Hatcher <[EMAIL PROTECTED]>
> Reply-To: Jakarta General List <[EMAIL PROTECTED]>
> To: Jakarta General List <[EMAIL PROTECTED]>
> Subject: Re: More abuse of coding styles...
>
> Rule #1 from The Elements of Java Style is:
>
> Adhere to the style of the original
>

IIRC, we actually had this rule explicitly in the JServ code conventions
... looks like it didn't make the transition into the Jakarta docs though.

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: More abuse of coding styles...

2002-01-04 Thread Peter Donald

On Sat, 5 Jan 2002 03:19, Steve Downey wrote:
> > 
> >
> > | "Variable names should not start with underscore _ or dollar sign $
> > | characters, even though both are allowed."
> >
> > The _instanceVariable and also the __staticVariable idea
> > makes real good
> > sense to me nowadays. Do you have any arguments against it?
> > (btw; this is
> > a genuine question!)..
>
> Because those characters are used by implementors and code generators.

all java code generators I use have configurable settings.

> They
> are legal, but not intended to be used by programmers.

Not relevent for java. In C this may be so but that mainly had to do with how 
the linker mangled names. And this was more separated out between system-user 
code

-- 
Cheers,

Pete


Sorry, I forgot to take my medication today.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Erik Hatcher

Rule #1 from The Elements of Java Style is:

Adhere to the style of the original


- Original Message -
From: "robert burrell donkin" <[EMAIL PROTECTED]>
To: "Jakarta General List" <[EMAIL PROTECTED]>
Cc: "Jakarta Commons Developers List" <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 12:49 PM
Subject: Re: More abuse of coding styles...


> i'd just like to point out that i didn't write that bit of code (but
> neither did i correct it).
>
> personally speaking, i'm not going to risk having patches vetoed because i
> try to correct the original author's coding style.
>
> any committer who has the time and energy to fight is very welcome to
> correct the many deviations from the standards that you'll find in the
> commons (and in the other projects as well, no doubt).
> - robert
>
> On Friday, January 4, 2002, at 01:54 AM, Jon Scott Stevens wrote:
>
> > It is amazing to me...with all the discussion about coding styles and
> > following them, we still have people committing code that doesn't follow
> > what rules we do have...
> >
> > on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> >
> > Re: cvs commit: jakarta-
> > commons/logging/src/java/org/apache/commons/logging
> > SimpleLog.java
> >
> >> +if(_showtime) {
> >
> > <http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367>
> >
> > "Variable names should not start with underscore _ or dollar sign $
> > characters, even though both are allowed."
> >
> > <http://jakarta.apache.org/site/source.html>
> >
> > "All Java Language source code in the repository must be written in
> > conformance to the "Code Conventions for the Java Programming Language
as
> > published by Sun."
> >
> > -jon
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: More abuse of coding styles...

2002-01-04 Thread Ceki Gülcü

At 10:35 04.01.2002 -0800, you wrote:
>on 1/4/02 3:28 AM, "Ceki Gülcü" <[EMAIL PROTECTED]> wrote:
>
>> All Java Language source code in the repository must be written in
>> conformance to the "Code Conventions for the Java Programming Language
>> as published by Sun." However, some projects may decide to override
>> these defaults and use their own defined conventions. For example, the
>> Turbine project has its own defined conventions which are similar to
>> the Sun standards but specify slightly different conventions.
>> 
>> Which really reads: we have conventions but you are free to ignore
>> them -- what people have flocked to do gleefully..
>> 
>> Cheers, Ceki
>
>Keyword above: 'defined'

Fine distinction. Keyword: fine (pun intended).


--
Ceki Gülcü - http://qos.ch



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Jon Scott Stevens

on 1/4/02 8:05 AM, "Bob Jamison" <[EMAIL PROTECTED]> wrote:

> jakarta.apache.org != Sun

That isn't the comparison that we are making here.

-jon


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Jon Scott Stevens

on 1/4/02 3:28 AM, "Ceki Gülcü" <[EMAIL PROTECTED]> wrote:

> All Java Language source code in the repository must be written in
> conformance to the "Code Conventions for the Java Programming Language
> as published by Sun." However, some projects may decide to override
> these defaults and use their own defined conventions. For example, the
> Turbine project has its own defined conventions which are similar to
> the Sun standards but specify slightly different conventions.
> 
> Which really reads: we have conventions but you are free to ignore
> them -- what people have flocked to do gleefully..
> 
> Cheers, Ceki

Keyword above: 'defined'

-jon


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Re: More abuse of coding styles...

2002-01-04 Thread Edson Alves Pereira

  Why not you create a page that show the code style that you want?

  I think that:

  if ( showtime )
  {
...
  }

  Is a valid statement and besides there are a lot of projects from Jakarta, 
SourceForge and Companies around the world that use this. Turbine has a page that show 
it´s code style.

robert burrell donkin <[EMAIL PROTECTED]> wrote:

>i'd just like to point out that i didn't write that bit of code (but 
>neither did i correct it).
>
>personally speaking, i'm not going to risk having patches vetoed because i 
>try to correct the original author's coding style.
>
>any committer who has the time and energy to fight is very welcome to 
>correct the many deviations from the standards that you'll find in the 
>commons (and in the other projects as well, no doubt).
>- robert
>
>On Friday, January 4, 2002, at 01:54 AM, Jon Scott Stevens wrote:
>
>> It is amazing to me...with all the discussion about coding styles and
>> following them, we still have people committing code that doesn't follow
>> what rules we do have...
>>
>> on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>>
>> Re: cvs commit: jakarta-
>> commons/logging/src/java/org/apache/commons/logging
>> SimpleLog.java
>>
>>> +if(_showtime) {
>>
>> 
>>
>> "Variable names should not start with underscore _ or dollar sign $
>> characters, even though both are allowed."
>>
>> 
>>
>> "All Java Language source code in the repository must be written in
>> conformance to the "Code Conventions for the Java Programming Language as
>> published by Sun."
>>
>> -jon
>>
>>
>> --
>> To unsubscribe, e-mail:   
>> For additional commands, e-mail: 
>>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
-- 
///
Better well done than well said.
 --//--
To follow the path:
look to the master,
follow the master,
walk with the master,
see through the master,
become the master.

Modern Zen poem
///



__
Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread robert burrell donkin

i'd just like to point out that i didn't write that bit of code (but 
neither did i correct it).

personally speaking, i'm not going to risk having patches vetoed because i 
try to correct the original author's coding style.

any committer who has the time and energy to fight is very welcome to 
correct the many deviations from the standards that you'll find in the 
commons (and in the other projects as well, no doubt).
- robert

On Friday, January 4, 2002, at 01:54 AM, Jon Scott Stevens wrote:

> It is amazing to me...with all the discussion about coding styles and
> following them, we still have people committing code that doesn't follow
> what rules we do have...
>
> on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> Re: cvs commit: jakarta-
> commons/logging/src/java/org/apache/commons/logging
> SimpleLog.java
>
>> +if(_showtime) {
>
> 
>
> "Variable names should not start with underscore _ or dollar sign $
> characters, even though both are allowed."
>
> 
>
> "All Java Language source code in the repository must be written in
> conformance to the "Code Conventions for the Java Programming Language as
> published by Sun."
>
> -jon
>
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-04 Thread Gerhard Froehlich

Hi,



>> if (something) {
>> 
>> }
>> 
>> 
>> ;)
>> 
>
>Tsk tsk. The RIGHT WAY is really
>if (something)
>   {
>   statements();
>   }

Waah, no way dude!!!
http://python.sourceforge.net/peps/pep-0007.html
The C style is the only way. Don't forget, that
C is the mother of all programming languages!
;)

  Gerhard
 
--
Black holes were created when God divided by zero.
--


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-04 Thread Steve Downey



> |
> | 
> 
> |
> | "Variable names should not start with underscore _ or dollar sign $
> | characters, even though both are allowed."
> 
> The _instanceVariable and also the __staticVariable idea 
> makes real good
> sense to me nowadays. Do you have any arguments against it? 
> (btw; this is
> a genuine question!)..
> 

Because those characters are used by implementors and code generators. They
are legal, but not intended to be used by programmers. 

> And while talking about code conventions; people writing like this:
> 
> if (something)
> {
> 
> }
> 
> should be shot right there on the spot, in the act of typing it.
> 
> The ONLY way to write blocks is like this:
> 
> if (something) {
> 
> }
> 
> 
> ;)
> 

Tsk tsk. The RIGHT WAY is really
if (something)
{
statements();
}


<><><><><><><><><><><><><><><><><><><><><>This electronic mail transmission
may contain confidential information and is intended only for the person(s)
named.  Any use, copying or disclosure by any other person is strictly
prohibited.  If you have received this transmission in error, please notify
the sender via e-mail. <><><><><><><><><><><><><><><><><><><><><>

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Bob Jamison

Jon Scott Stevens wrote:

>
>
>"All Java Language source code in the repository must be written in
>conformance to the "Code Conventions for the Java Programming Language as
>published by Sun."
>
>-jon
>


"Sun"  ?   ;-)

I thought it was agreed a long time ago that

jakarta.apache.org != Sun

and that

xml.apache.org != IBM

Every time I have seen a discussion about coding styles, it is never
with an altruistic bent.  No one ever says "I should change my coding
style to be more like yours."   No, it is always "You should change
your style to be more like mine."

If someone writes clean, elegant code, it doesn't really matter
if it's K&R style or Whitesmith's style.  If we had Michaelangelo
working here,  I really don't think that we would care if he were
using marble or alabaster,  the result would be magnificent enough.










--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Berin Loritsch

Endre Stølsvik wrote:

> On Thu, 3 Jan 2002, Jon Scott Stevens wrote:
> 
> The _instanceVariable and also the __staticVariable idea makes real good
> sense to me nowadays. Do you have any arguments against it? (btw; this is
> a genuine question!)..


Honestly, I don't like the underscore notation.  If there is any deviation
from that, it would be simple scope modifiers like m_memberVariable.

I have adopted the practice of explicitly scoping all my veriables.  It is
better supported by IDEs with autocompletion, so for me it even reduces
typing.  Also, I try not to ever use a parameter that is the same as a
member variable.


> 
> And while talking about code conventions; people writing like this:
> 
> if (something)
> {
> 
> }


As long as the deviation is *documented*.  If you supercede the Sun
conventions, you must document exactly how it is done.  Examples of
this are in both the Struts and the Avalon projects.  Both clearly
identify coding practices that supercede Sun's conventions.

This also means that *all* Commons code must adopt the coding convention.

Honestly, the aditional space forced by the brace on the following line
_does_ increase legibility.


> 
> should be shot right there on the spot, in the act of typing it.
> 
> The ONLY way to write blocks is like this:
> 
> if (something) {
> 
> }
> 
> 
> ;)
> 
> 



-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
 - Benjamin Franklin


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Arnaud Vandyck

Jon Scott Stevens <[EMAIL PROTECTED]> wrote:

> It is amazing to me...with all the discussion about coding styles and
> following them, we still have people committing code that doesn't follow
> what rules we do have...
> 
> on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> 
> Re: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging
> SimpleLog.java
> 
> > +if(_showtime) {
> 
> 
> 
> "Variable names should not start with underscore _ or dollar sign $
> characters, even though both are allowed."

Sun Certified Programmer for Java2 Platform:

Question:

5. Which is a valid identifier? 

o false
o default
o _object
o a-class

funny! :))  allowed, not recommended, but  a part of  the questions at
the exam :)

-- Arnaud, STE-Formations Informatiques, fapse, ULg, .BE

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-04 Thread Stephane Bailliez

> -Original Message-
> From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
[...]
> People who repeatedly forget to type "this" represent a minority and
> should perhaps look to exercise a different profession. The problem

You are right, but I think you know perfectly what kind of horrors you can
find in most code out there and there is still shortage of 'developpers'.

Let's face it the code quality in Jakarta is extremely high compared with
what I have seen in the industry, the most horrible I have seen in my
limited experience being in the Defense and/or aeronautical industry. I was
beginning my career at this time and could not believe someone could come up
with sleep() to synchronize work between threads and complain that the OS
was buggy since it was 'working' differently on different computers...

> with
[..]
> public void setSomethingComplicated(Object sometingComplicateed){ 
>   this.somethingComplicated = somethingComplicated;
> }

right.. I forgot the best one...I have been hit by this as well..

Stephane

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Ted Husted

I agree with Jon in that when people agree to become a Committer to a
subproject they agree to follow the rules of that subproject, the
Jakarta project, and the Apache Software Foundation.

As it stands, each subproject is entitled to document their own coding
conventions. When none are specified, then the default Jakarta
guidelines apply. 

I believe that PMC members are obligated to remind people of the rules.
It is up to the Committers to a subproject to see that the code is
changed, but it is our job to point out the transgression. (In the same
way that GUMP points out other technical problems.) Of course, other
members of the community are also invited to help us watch our
collective backs. 

Personally, I believe that everyone here is a consummate professional,
or wants to be, and following the coding conventions of your codebase is
a hallmark of professionalism. When I screw up, I certainly want someone
to point it out to me, as Jon has started to do. A word to wise should
be sufficient.

As Sam mentioned, it is unlikely that the PMC or ASF is going to shut
down a codebase for not following their conventions. But we should
exercise our obligation to nag people until the commits come into
compliance or the conventions for the subproject are amended. 

AFAIK, a change to a subproject coding conventions would be a Product
Change.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Building Java web applications with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Jon Scott Stevens wrote:
> 
> It is amazing to me...with all the discussion about coding styles and
> following them, we still have people committing code that doesn't follow
> what rules we do have...
> 
> on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> 
> Re: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging
> SimpleLog.java
> 
> > +if(_showtime) {
> 
> 
> 
> "Variable names should not start with underscore _ or dollar sign $
> characters, even though both are allowed."
> 
> 
> 
> "All Java Language source code in the repository must be written in
> conformance to the "Code Conventions for the Java Programming Language as
> published by Sun."
> 
> -jon
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Ted Husted

As a point of order:

The use of "this" is recommended by the Elements of Java Style, which is
cited in the Commons charter. 

Though, I have myself been victimized by the trap Ceki mentions.

-Ted.


Ceki Gülcü wrote:
> People who repeatedly forget to type "this" represent a minority and
> should perhaps look to exercise a different profession. The problem
> with
> 
> public void setSomething(Object something){
>   this.something = something;
> }
> 
> is
> 
> public void setSomethingComplicated(Object sometingComplicateed){
>   this.somethingComplicated = somethingComplicated;
> }
> 
> --

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Ceki Gülcü


Hey Jon,

It is not amazing. It is normal. The paragraph that you quoted says:

  All Java Language source code in the repository must be written in
  conformance to the "Code Conventions for the Java Programming Language
  as published by Sun." However, some projects may decide to override
  these defaults and use their own defined conventions. For example, the
  Turbine project has its own defined conventions which are similar to
  the Sun standards but specify slightly different conventions.

Which really reads: we have conventions but you are free to ignore
them -- what people have flocked to do gleefully..

Cheers, Ceki

At 17:54 03.01.2002 -0800, you wrote:
>It is amazing to me...with all the discussion about coding styles and
>following them, we still have people committing code that doesn't follow
>what rules we do have...
>
>on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>Re: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging
>SimpleLog.java
>
>> +if(_showtime) {
>
>
>
>"Variable names should not start with underscore _ or dollar sign $
>characters, even though both are allowed."
>
>
>
>"All Java Language source code in the repository must be written in
>conformance to the "Code Conventions for the Java Programming Language as
>published by Sun."
>
>-jon
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 

--
Ceki Gülcü - http://qos.ch



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-04 Thread Ceki Gülcü

At 10:44 04.01.2002 +, you wrote:
>> -Original Message-
>> From: Kief Morris [mailto:[EMAIL PROTECTED]]
>
>> >It is one of my major source of error when not using the '_'  and I
>> >have seen the error several times along with variable naming
>> >gymnastics to avoid the this. people would use aSomething or
>   ^
>
>> >theSomething or whatever. That look crappy in the Javadoc.
>
>> The "standard" way to handle this is of course:
>[...]
>
>See above. People will often forget to type 'this.' for the same reason they
>forget to put braces around a single line statement: lazyness.
>
>I think we all do this from time to time...human nature you know...
>
>Stephane


People who repeatedly forget to type "this" represent a minority and
should perhaps look to exercise a different profession. The problem
with

public void setSomething(Object something){ 
  this.something = something; 
}

is 

public void setSomethingComplicated(Object sometingComplicateed){ 
  this.somethingComplicated = somethingComplicated;
}


--
Ceki Gülcü - http://qos.ch


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Geir Magnusson Jr.

On 1/4/02 5:26 AM, "Kief Morris" <[EMAIL PROTECTED]> wrote:

> Stephane Bailliez typed the following on 09:42 AM 1/4/2002 +
>>> We had that discussion once on Commons, and many people liked the
>>> underscore convention.
>> 
>> I can understand why:
>> 
>> public void setSomething(Object something){
>> something = something;
>> }
>> 
>> It is one of my major source of error when not using the '_' and I have seen
>> the error several times along with variable naming gymnastics to avoid the
>> this. people would use aSomething or theSomething or whatever. That look
>> crappy in the Javadoc.
> 
> The "standard" way to handle this is of course:
> 
> public void setSomething(Object something){
> this.something = something;
> }
> 
> Kief
> 

Of course, you can spend hours looking for the following typo :

 public void setSomething( Object somthing )
 {
   this.something = something;
 }


"Look kids, Big Ben.  Can't change 'something'"


-- 
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Be a giant.  Take giant steps.  Do giant things...


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Geir Magnusson Jr.

On 1/4/02 3:48 AM, "Endre Stølsvik" <[EMAIL PROTECTED]> wrote:

> On Thu, 3 Jan 2002, Jon Scott Stevens wrote:
> 
> | It is amazing to me...with all the discussion about coding styles and
> | following them, we still have people committing code that doesn't follow
> | what rules we do have...
> |
> | on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> |
> | Re: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging
> | SimpleLog.java
> |
> | > +if(_showtime) {
> |
> | 
> |
> | "Variable names should not start with underscore _ or dollar sign $
> | characters, even though both are allowed."
> 
> The _instanceVariable and also the __staticVariable idea makes real good
> sense to me nowadays. Do you have any arguments against it? (btw; this is
> a genuine question!)..

I used to do that all the time in C++ developent, although I put it at the
end

   membervar_

It really helps, I think.

> 
> And while talking about code conventions; people writing like this:
> 
> if (something)
> {
> 
> }
> 
> should be shot right there on the spot, in the act of typing it.
> 
> The ONLY way to write blocks is like this:
> 
> if (something) {
> 
> }
> 
> 
> ;)


You left out my 'favorite'

  if ( something ) { }

:)

-- 
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
"Now what do we do?"


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-04 Thread Stephane Bailliez

> -Original Message-
> From: Kief Morris [mailto:[EMAIL PROTECTED]]

> >It is one of my major source of error when not using the '_'  and I
> >have seen the error several times along with variable naming
> >gymnastics to avoid the this. people would use aSomething or
   ^

> >theSomething or whatever. That look crappy in the Javadoc.

> The "standard" way to handle this is of course:
[...]

See above. People will often forget to type 'this.' for the same reason they
forget to put braces around a single line statement: lazyness.

I think we all do this from time to time...human nature you know...

Stephane

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-04 Thread Kief Morris

Stephane Bailliez typed the following on 09:42 AM 1/4/2002 +
>> We had that discussion once on Commons, and many people liked the
>> underscore convention.
>
>I can understand why:
>
>public void setSomething(Object something){
>   something = something;
>}
>
>It is one of my major source of error when not using the '_' and I have seen
>the error several times along with variable naming gymnastics to avoid the
>this. people would use aSomething or theSomething or whatever. That look
>crappy in the Javadoc.

The "standard" way to handle this is of course:

public void setSomething(Object something){
this.something = something;
}

Kief


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: More abuse of coding styles...

2002-01-04 Thread Stephane Bailliez

> -Original Message-
> From: Jeff Turner [mailto:[EMAIL PROTECTED]]

[...]
> We had that discussion once on Commons, and many people liked the
> underscore convention.

I can understand why:

public void setSomething(Object something){
something = something;
}

It is one of my major source of error when not using the '_' and I have seen
the error several times along with variable naming gymnastics to avoid the
this. people would use aSomething or theSomething or whatever. That look
crappy in the Javadoc.

is in the same group as the no-brace:

 if (condition)   <...180 col...>  uWillNeverFindMe();
doSomething(); 

or
 if (condition)
doSomething();
doSomethingToConfuseMe();

But whatever the pain is: I'm following the code conventions established
here.

"When in Rome do as the Romans do."

I'm the lucky user of Intellij IDEA which has a code layout feature that
allows to reformat the whole code in a snap w/ specific code style,
reorganize imports and remove useless one. I'm using this extensively and
this is damn cool.

Stephane

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-04 Thread Endre Stølsvik

On Thu, 3 Jan 2002, Jon Scott Stevens wrote:

| It is amazing to me...with all the discussion about coding styles and
| following them, we still have people committing code that doesn't follow
| what rules we do have...
|
| on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
|
| Re: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging
| SimpleLog.java
|
| > +if(_showtime) {
|
| 
|
| "Variable names should not start with underscore _ or dollar sign $
| characters, even though both are allowed."

The _instanceVariable and also the __staticVariable idea makes real good
sense to me nowadays. Do you have any arguments against it? (btw; this is
a genuine question!)..

And while talking about code conventions; people writing like this:

if (something)
{

}

should be shot right there on the spot, in the act of typing it.

The ONLY way to write blocks is like this:

if (something) {

}


;)

-- 
Mvh,
Endre


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: More abuse of coding styles...

2002-01-03 Thread Jeff Turner

On Thu, Jan 03, 2002 at 05:54:20PM -0800, Jon Scott Stevens wrote:
> It is amazing to me...with all the discussion about coding styles and
> following them, we still have people committing code that doesn't follow
> what rules we do have...
> 
> on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> 
> Re: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging
> SimpleLog.java
> 
> > +if(_showtime) {

We had that discussion once on Commons, and many people liked the
underscore convention.

> 
> 
> "Variable names should not start with underscore _ or dollar sign $
> characters, even though both are allowed."
> 
> 
> 
> "All Java Language source code in the repository must be written in
> conformance to the "Code Conventions for the Java Programming Language as
> published by Sun."

Maybe that's what needs changing.. I'd suggest:

"All Java source code _should_ follow the existing conventions
established by that project's committers. Projects are strongly
encouraged to follow the "Code Conventions for the Java Programming
Language" as published by Sun."

Perhaps adding:

"Projects whose coding conventions deviate from the Sun standard must
document the changes, with justifications."

Simply because justifications are always fun to read :)


--Jeff

> -jon
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




More abuse of coding styles...

2002-01-03 Thread Jon Scott Stevens

It is amazing to me...with all the discussion about coding styles and
following them, we still have people committing code that doesn't follow
what rules we do have...

on 1/3/02 11:00 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

Re: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging
SimpleLog.java

> +if(_showtime) {



"Variable names should not start with underscore _ or dollar sign $
characters, even though both are allowed."



"All Java Language source code in the repository must be written in
conformance to the "Code Conventions for the Java Programming Language as
published by Sun."

-jon


--
To unsubscribe, e-mail:   
For additional commands, e-mail: