Re: split() and String []
From: Jeff Schwab (jeffplus_at_comcast.net)
Date: 04/03/04
- Next message: Yoyoma_2: "Re: split() and String []"
- Previous message: Ryan Stewart: "Re: split() and String []"
- In reply to: Ryan Stewart: "Re: split() and String []"
- Next in thread: Yoyoma_2: "Re: split() and String []"
- Reply: Yoyoma_2: "Re: split() and String []"
- Reply: Ryan Stewart: "Re: split() and String []"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 03 Apr 2004 09:04:19 -0500
Ryan Stewart wrote:
> "Jeff Schwab" <jeffplus@comcast.net> wrote in message
> news:Xs2dnUnfqvVLhvPdRVn-sA@comcast.com...
>
>>Yoyoma_2 wrote:
>>
>>>In your original code you had a variable name like "String MyString[]=".
>>>Java standard requires that variable and function names start with lower
>>>case. Its a good habit to pick up. An external programmer can drop
>>>into your code and know that MyString isn't a class that you are making
>>>static calls to. Also it makes the code a lot prettyer.
>>>
>>>Just a suggestion.
>>
>>
>>What standard? Do you mean Sun's guidelines? They're not a standard,
>>and nobody has to follow them. (That said, I agree with you completely
>>that variables should begin with lower-case letters.)
>>
>
> http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
Those are conventions. The title of the document is Code Conventions.
Not standards.
> They are a standard, but you're right. Nobody has to follow them, just like
> nobody has to drive their car in the correct lane or obey traffic signals.
I like your analogy. Suppose that you are from the US, and are thus
used to driving on the right [direction, not correctness] side of the
road. Now, suppose you are with someone in the UK, and you notice that
they are driving on the left. Do you suggest they switch to the other
side, since they are not complying with the Standard? Of course not.
To do so would not fit local custom, and would be silly and
irresponsible. Moreover, you would be steering them into on-coming traffic.
> Granted those are laws rather than standards, but nobody's ever gotten
> killed by practicing improper coding techniques (unfortunately?).
The OP's capitalization isn't "improper," it just doesn't follow your
preferred conventions.
> If you
> don't support following code standards, you must not have ever had to
> develop code in cooperation with other people.
In the presence of guidelines, I follow them as closely as possible,
unless there is a darned good reason to do otherwise; for example, I
tend to use whitespace to align semantically related items. I've used a
number of different sets of coding guidelines over the years, and most
of them conflict with each other. My problem isn't with coding
guidelines, though; it's with telling somebody who never agreed to
follow a particular convention that he's being "non-standard," possibly
for complying with his own company's entirely different guidelines. The
term "standard" has a meaning different from "convention" or
"guideline." Plenty of tools exist to reformat code automatically, but
there's no magic wand you can wave to fix violations of an actual standard.
- Next message: Yoyoma_2: "Re: split() and String []"
- Previous message: Ryan Stewart: "Re: split() and String []"
- In reply to: Ryan Stewart: "Re: split() and String []"
- Next in thread: Yoyoma_2: "Re: split() and String []"
- Reply: Yoyoma_2: "Re: split() and String []"
- Reply: Ryan Stewart: "Re: split() and String []"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|