Re: split() and String []

From: Jeff Schwab (jeffplus_at_comcast.net)
Date: 04/03/04


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.



Relevant Pages

  • Re: IDSA GUIDELINES ATTEMPT TO NARROW THE DEFINITION OF LYME DISEASE AND PROMOTE A LEGAL STANDARD OF
    ... There is far too much to know--how many Lyme journal articles- ... for a patient's care. ... The legal standard is, in a sense, a minimalist standard...the duty ... And the Lyme Standard of Care is exactly what the IDSA guidelines are ...
    (sci.med.diseases.lyme)
  • Proof that Cholesterol Guidelines A Gift For Merck, Pfizer
    ... > Doctors are setting guidelines moron. ... These are the standard of care ... to pharmaceutical companies, many of which manufacture statin drugs. ...
    (sci.med.nutrition)
  • Re: Cholesterol Guidelines A Gift For Merck, Pfizer
    ... >> Doctors are setting guidelines moron. ... These are the standard of care ... Pharmaceutical and food industry companies ...
    (sci.med.nutrition)
  • Re: Low Carb - what are the numbers?
    ... Most of the diet books have 200 or less, a 100 g would be close to most. ... There is no standard measure of "low" to distinguish it from what could be ... "Low" is relative usually to standard guidelines and/or observed practices ... calories from carbs, ...
    (sci.med.nutrition)
  • Re: beatles
    ... obey international law. ... The Constitution makes international treaties (which includes conventions) the law of the land. ... Also, whatever about the US's refusal to ratify the International Criminal Court Convention, the US itself proved that those who commit certain crimes during time of war are internationally culpable of crimes against humanity and subject to imprisonment at the very least: the Nuremberg and Tokyo War Trials. ... That standard can be said to be the minimum standard of conduct allowed and failure to adhere to that standard can, in certain cases, be used as evidence of the commission of a crime against humanity. ...
    (rec.arts.books)