Re: what is the initial value of arrays of object



Andreas Leitgeb wrote:
Lew <noone@xxxxxxxxxxxxx> wrote:
The language features are the language features. They do what they do. ...
... They're not to be liked or disliked but used (or not used) as you
will.

Ok, lets see a few "features" of Java:

- capital I and lowercase l are different identifiers

In all programming languages, typographic similarities between identifiers exist in certain fonts, and single-letter variable names are discouraged in most of them. There are times when they make sense.

- the Vector class (legacy, but still there, and even
facelifted(made generic) for 1.5), ditto Enumerator

That's a feature of the API, not the language.

- postfix "long"-literals with a lowercase "l"

Again, typographic similarities are not a feature of the language but of the font used to express its source. If you used a different font, you wouldn't worry about that. The fault is not with Java here, but with the font.

- changes in indentation "without reason". Unlike Python, Java does allow that.

Unlike Python, if I understand what you're saying about Python, you have the freedom to use indentation to augment readability without fear of polluting the semantics of your code. That's a good thing. Why do you list it as a bad thing?

Ok, you wouldn't use these "features" yourself, but see

I most certainly would use the feature (no quote marks) of semantic-free indentation.

yourself as having to work together with people who do
use them. Would you silently accept it ?

I don't have a problem with initializer blocks nor statement blocks.

Probably not. You'd try to explain to them the disadvantages
and convince them of alternatives, the same way you do it with
people showing samples of their code here in this newsgroup
and asking questions that aren't even related to these "features".

Again, putting "feature" in quotes like that is not evidence.

Initializer and statement blocks are a feature of the language. I do not discourage their use - I encourage their appropriate use. There are times when they enhance readability or program semantics. Like other features, I do not recommend their indiscriminate use.

For example, statement blocks give a convenient way to limit the scope of a temporary variable.

But just like 42l could be mistaken for 421, a statement-block
asks for a look to the preceding context, looking for some statement
that goes with that block, just to see *if there is* one (btw., just
the same way as a sudden change of indentation-depth would).

The confusion of "l" for "1" is typographically inherent. The confusion of statement blocks with ones that have, say, a condition is not. Unlike typographic confusion, confusion over statement blocks is in the insufficiently-trained mind of the programmer.

Certainly as a code reviewer or maintainer you must be familiar
with these tools.

Yes, for sure, and as such it is almost one's duty to recognize and discourage the use of such "features".

Again with the quotes. It is my duty to encourage the use of statement and initializer blocks.

PS: Yes, I find standalone braced blocks just as bad as all the
other samples I gave, except for the Vector class, which I find all ok, myself, but of which I know that you dislike it.

I disagree with you about brace blocks and indentation. Vector is not a Java feature, and typographic confusion is not a training issue, whereas brace block confusion is. It is relatively hard to fix the font on your screen. It is relatively easy to fix ignorance.

--
Lew
.



Relevant Pages

  • Re: How to find out build configuration of my currently used Ghostscript executable?
    ... I could conclude "My Ghostscript does support Level 2 PostScript, ... In general pre-built versions of Ghostscript on host operating systems, ... FreeType bridge code instead of the internal font renderer, ... TrueType fonts from disk is not a defined feature of the PostScript ...
    (comp.lang.postscript)
  • Re: Where is the word count tool?
    ... used to in 2003 and it tells you where to find the same feature in 2007. ... What font are you using and what view are you working in. ... Word then doesn't see 'words' just characters, ... live word count /should/ show the number of words in the selected portion ...
    (microsoft.public.word.docmanagement)
  • Re: How to find out build configuration of my currently used Ghostscript executable?
    ... I could conclude "My Ghostscript does support Level 2 PostScript, ... In general pre-built versions of Ghostscript on host operating systems, ... FreeType bridge code instead of the internal font renderer, ... TrueType fonts from disk is not a defined feature of the PostScript ...
    (comp.lang.postscript)
  • showing checkboxes and using mail merge
    ... (E.g. Sue Smith; rather than First Name: ... Smith) I know there is a feature under ... It was suggested that I change the font of the part I ... check the boxes where applicable. ...
    (microsoft.public.word.mailmerge.fields)