C
Chris Uppal
Mike said:That's my understanding too, that generics result in the creation of new
first-class type objects at runtime.
Yummy!
-- chris
Mike said:That's my understanding too, that generics result in the creation of new
first-class type objects at runtime.
David said:Enums were truly needed. They eliminated a class of (what I consider to
be) type-related errors that in my experience was very common: using the
wrong constant in the wrong context. Like substituting
LAYOUT.LEFT_JUSTIFIED for LAYOUT.WEST in a layout manager.
C# allows you to use the SAME syntax for fields and nyladic (zero
arguments) methods. This allows you to abstract the implementation of
the field so that fields can be re-implemented as methods without
breaking existing code.
Thomas said:Robert C. Martin, mostly a denizen of comp.object, has pointed out several
times that there are some things that are /over/ engineered. I don't know
his position on generics, but the example that he has lately discussed is
that a "Just Create One" is superior to a true singleton. I am seeing
shades of this line of thinking (right or wrong) in this thread.
Thomas said:I'm not convinced that the word "strong" belongs with the words "dynamic
typing".
Thomas G. Marshall said:I'm not convinced that the word "strong" belongs with the words "dynamic
typing".
Thomas G. Marshall said:If that's what you were worried about then enums were not "truly needed" at
all. The examples you gave are examples of poorly designed type-UN-safe
enums.
Consider this type-SAFE pseudo-enum instead:
David Blickstein wrote:
....[rip]...
C# allows you to use the SAME syntax for fields and nyladic (zero
arguments) methods. This allows you to abstract the implementation
of the field so that fields can be re-implemented as methods without
breaking existing code.
Can't be done without JVM changes. (And, IMO, would be a very bad
idea to do at all.)
The cases are certainly comparable (if you grant my position on
generics). The extra superstructure (in some interpretations of
Singleton) merely prevents you from creating extra instances although
there is rarely a genuine need to prevent this, and it may even lead
to inflexibility in the code.
Ha! I see through you -- you are attempting to stir a dynamic/static
debate (again!). Well, I'm not biting!
["Thomas G. Marshall"
Regardless as to whether it's a good idea or not, I often wonder
what many here have wondered. To what degree did sun bite
themselves in the ass by rushing the initial versions out the door
in 1995?
look at it this way: the evolution process has been a lot less painful
than that of C++ or even Python.
-Bjørn
Thomas said:Regardless as to whether it's a good idea or not, I often wonder what many
here have wondered. To what degree did sun bite themselves in the ass by
rushing the initial versions out the door in 1995?
Thomas said:It's as if the rules that have been taught to students (singletons,
no-goto, structural programming) have all moved from being the means to
an end, to the end itself. And we ought to fight against that, at least
IMO.
Thomas said:Actually, no. I've been trying to /not/ go down that route. In this
particular case though, there is a huge disagreement about what "strong"
typing really means, and if there's a way to discuss that /without/
making a DTL/STL argument, then I'm for it.
I suppose that boils down to asking whether they'd have produced
something better if they'd had more time. At one level it's clear
that they would
have -- there are some messy details that obviously would have been
fixed if there had been time for another major iteration before
release (e.g. some of the weirdnesses in the JVM bytecode
definition). OTOH, I'm not convinced that they had the combination
of talent, experience, and insight to have realised how damaging some
of the design features were, even if they'd had another couple of
years to think about it. (The whole "static" mess being just one
example.)
-- chris
If that's what you were worried about then enums were not "truly needed" at
all.
So my pondering is less "is it their fault for rushing" and more "to what
degree would /anything/ have been 'better' had they waited".
I agree with you, but only in the "possible" sense of "needed", not
in the "desirable" sense. In that sense of the word, your claim is
already proven by the fact that the new enumerations are (in my
understanding) just a little syntactic sugar provided by the javac
compiler.
The problem with the example you gave (IMHO) is in what I call the
"exposition". The advantage of enumerations (and for each and a
bunch of the othernew features) is that they provide a syntax to
DIRECTLY express a basic operation, and thus expose the operation
more directly.
Thomas G. Marshall
A related question is "if they had waited, would anyone have ended up
taking note of their product at all?"
If it was rushed, there was probably a reason and it might have been a
good one
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.