Java Type System

Putting the following down on paper (OK, pixels) helped me to understand how 
generics extend the Java type system.  Since I haven't seen any texts that 
look at things in quite this fashion, I thought I'd post it on the chance 
that it would help others as well.  Note that this only discusses object 
types, not primitives, since it's describes the ability to refer to an 
object of type A by a reference of type B, with B a supertype of A.  It also 
doesn't discuss conversions of the sort found in

    float f  = 2;

or

    Integer i = 12;

In both cases, the entity on the right-hand side is converted to an entity 
of a different type, quite different from what happens in

    Object o = "hello";

in which the left hand-side is made to refer to precisely the entity that is 
the right-hand side.  OK, here we go:

The assignment statement in Java looks like

    reference = expression;

This is legal whenever the type R of the reference is a supertype of the 
type E of the expression, where "supertype" is defined so that, for all 
types T, T is a supertype of itself.  (As mentioned above, we're going to 
ignore primitives and built-in conversion.)  Before generics, the rules for 
supertype were relatively simple:

    1. T is a supertype of T
    2. If T is a class other then Object, T's superclass is a supertype of T
    3. Object is a supertype of all interfaces and array types
    4. All interfaces that T implements or extends are supertypes of T
    5. If T is a supertype of U:
          T[] is a supertype of U[] (i.e. arrays are covariant)
    6. If T is a supertype of U and U is a supertype of V, then T is a 
supertype if V (i.e. "supertype" is transitive)

There rules are all pretty clear, even if you don't ordinarily think of them 
that way.

Generics complicate this somewhat, by adding these extra rules.

  If T is a supertype of U, and A is a supertype of B:
    1. A<T> is a supertype of B<T>
    2. A<T> is not a supertype of A<U> (i.e. generics are not covariant)
    3. T is a supertype of <? extends T>
    4. There is no type V for which <? extends T> is a supertype of V
    5. <? super T> is a supertype of T
    6. The only supertype of <? super T> is Object
    7. A<? extends T> is a supertype of A<? extends U>
    8. A<? super U> is a supertype of A<? super T>



0
Mike
3/17/2010 7:07:59 PM
comp.lang.java.programmer 52266 articles. 40 followers. Post Follow

30 Replies
193 Views

Similar Articles

[PageSpeed] 56
On Wed, 17 Mar 2010 12:07:59 -0700, "Mike Schilling"
<mscottschilling@hotmail.com> wrote, quoted or indirectly quoted
someone who said :

>t also 
>doesn't discuss conversions of the sort found in
>
>    float f  = 2;
>
>or
>
>    Integer i = 12;
 
For the first look under "widening", for the second look under
"autoboxing".
-- 
Roedy Green Canadian Mind Products
http://mindprod.com

Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, �How would I develop if it were my money?� I�m amazed how many theoretical arguments evaporate when faced with this question. 
~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.
0
Roedy
3/17/2010 10:36:31 PM
Roedy Green wrote:
> On Wed, 17 Mar 2010 12:07:59 -0700, "Mike Schilling"
> <mscottschilling@hotmail.com> wrote, quoted or indirectly quoted
> someone who said :
>
>> t also
>> doesn't discuss conversions of the sort found in
>>
>>    float f  = 2;
>>
>> or
>>
>>    Integer i = 12;
>
> For the first look under "widening", for the second look under
> "autoboxing".



Yes, Roedy, I know what thty are, but they're not relevant to what I was 
exploring. 


0
Mike
3/17/2010 10:55:53 PM
On 17-03-2010 18:55, Mike Schilling wrote:
> Roedy Green wrote:
>> On Wed, 17 Mar 2010 12:07:59 -0700, "Mike Schilling"
>> <mscottschilling@hotmail.com>  wrote, quoted or indirectly quoted
>> someone who said :
>>> t also
>>> doesn't discuss conversions of the sort found in
>>>
>>>     float f  = 2;
>>>
>>> or
>>>
>>>     Integer i = 12;
>>
>> For the first look under "widening", for the second look under
>> "autoboxing".
>
> Yes, Roedy, I know what thty are, but they're not relevant to what I was
> exploring.

Most likely Roedy (as usual) did not read the entire message that he
was replying to.

Arne
0
ISO
3/18/2010 12:09:06 AM
Arne Vajh�j <arne@vajhoej.dk> writes:
>Most likely Roedy (as usual) did not read the entire message
>that he was replying to.

  Mike posted some very helpful observations at the end of
  his post. But he started his post with distracting and
  boring preliminaries. Possibly Roady was not the only one
  who was not reading it to the end. Anyway, I thank Mike
  for sharing his insights!

0
ram
3/18/2010 1:43:11 AM
Stefan Ram wrote:
> Arne Vajh�j <arne@vajhoej.dk> writes:
>> Most likely Roedy (as usual) did not read the entire message
>> that he was replying to.
>
>  Mike posted some very helpful observations at the end of
>  his post. But he started his post with distracting and
>  boring preliminaries. Possibly Roady was not the only one
>  who was not reading it to the end. Anyway, I thank Mike
>  for sharing his insights!

You're welcome.  (I think.) 


0
Mike
3/18/2010 1:44:49 AM
Mike Schilling wrote:
> Putting the following down on paper (OK, pixels) helped me to understand how 
> generics extend the Java type system.  ...

Nicely done.

Abstracting one layer, Mike has pinned an aspect of Java that particularly 
excites me, its type expression system.

"Type-oriented programming" is next-gen object-oriented programming.  Taken 
together, Java interfaces and generics form a declarative syntax of assertions 
about type relationships.

Properly used, this syntax lets the programmer direct the compiler to enforce 
assertions that lock a program into correct behavior.  Typifying the benefit, 
we eliminate runtime type checks (or crashes from lack of enforcement), e.g., 
that a collection contain only 'Person' instances.

In cases where we need a runtime type check to cooperate with compile-time 
enforcement, we coerce a 'Class<T>' variable into the mix, usually a private 
final member.  A little judicious reflection off that instance (I use the name 
'this.clazz') with conventions like that 'T' not need a complex constructor, 
and you can do anything you need for type 'T'.  The compiler infers type 
correctness from the 'Class' instance.

   public <T> T find( Class<T> clazz, Object key );

or

   public <T, K> T find( Class<T> clazz, K key );

which lets you call

   Person person = find( Person.class, name );

If the generic were applied to the type, you store the class in the instance 
rather than the argument list, e.g.,

   public class PersonManager extends Manager<Person, String>
   {
     public PersonManager()
     {
       super( Person.class ); // stores in Manager#clazz
     }
     @Override
     public Person find( String name )
     {
       return getEm().find( getClazz(), name );
     } // actually, this duplicates the superclass code
       // sorta - superclass is generic
   }

Superclass 'Manager<T, K>' left as an exercise.  I think of 'getEm()' and 
'getClazz()' as protected final methods.

-- 
Lew
0
Lew
3/18/2010 4:29:29 AM
On Wed, 17 Mar 2010 15:55:53 -0700, "Mike Schilling"
<mscottschilling@hotmail.com> wrote, quoted or indirectly quoted
someone who said :

>Yes, Roedy, I know what thty are, but they're not relevant to what I was 
>exploring. 
>

You were complaining that generic docs do not cover autoboxing and
widening. I was pointing out why there was no reason to expect them
to.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com

Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, �How would I develop if it were my money?� I�m amazed how many theoretical arguments evaporate when faced with this question. 
~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.
0
Roedy
3/18/2010 7:55:46 AM
On 18 Mar 2010 01:43:11 GMT, ram@zedat.fu-berlin.de (Stefan Ram)
wrote, quoted or indirectly quoted someone who said :

>. Possibly Roady was not the only one
>  who was not reading it to the end

My comment still stands whether you read the whole post or not. 
-- 
Roedy Green Canadian Mind Products
http://mindprod.com

Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, �How would I develop if it were my money?� I�m amazed how many theoretical arguments evaporate when faced with this question. 
~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.
0
Roedy
3/18/2010 7:57:36 AM
According to Lew  <noone@lewscanon.com>:
> "Type-oriented programming" is next-gen object-oriented programming.
> Taken together, Java interfaces and generics form a declarative syntax
> of assertions about type relationships.
> 
> Properly used, this syntax lets the programmer direct the compiler to
> enforce assertions that lock a program into correct behavior.
> Typifying the benefit, we eliminate runtime type checks (or crashes
> from lack of enforcement), e.g., that a collection contain only
> 'Person' instances.

It may be noted that this is the road that C++ took, and it proved very
slippery. C++ tries to express assertions as types, and it mostly leads
to oversized and slow compilers, rather than the powrful compile-time
bug detection that was consistently promised but less consistently
achieved.

To some extent, Java was designed as an effort to do programming "not
like C++". In my view, "type-oriented programming" is not next-gen but
previous-gen, and generics are a step "back" (at least in time).
Generics were added because something had to be done about container
types (List, Map...) but in the grand view of programming languages
evolution, they represent a kind of failure.

I am not claiming that generics are ill-designed by themselves; hard and
smart work went into them, and they do what they were meant to do. I
claim that they are a revival of an old theme, and flow opposite to the
rest of the design of Java.


	--Thomas Pornin
0
Thomas
3/18/2010 11:36:43 AM
Thomas Pornin wrote:
> It may be noted that this is the road that C++ took, and it proved very
> slippery. C++ tries to express assertions as types, and it mostly leads
> to oversized and slow compilers, rather than the powrful compile-time
> bug detection that was consistently promised but less consistently
> achieved.

Java is rather the opposite - with generics, it expresses types as 
(compile-time) assertions.

I'm using "assertion" in the general sense here; this has nothing to do with 
the 'assert' keyword.

I do not see that generics has noticeably affected Java compiler size or 
speed, and it certainly has added powerful compile-time bug detection to Java.

-- 
Lew
0
Lew
3/18/2010 12:43:22 PM
According to Lew  <noone@lewscanon.com>:
> and it certainly has added powerful compile-time bug detection to Java.

I am not sure of that "bug" thing. Generics make life easier because
they avoids the need for a bunch of casts; they also are quite good at
documenting container types. But in practice it does not seem to detect
more bugs: the bugs it may detect are bugs that I was not doing in the
first place. It is _convenient_ that when I call a method which returns
a Collection<String> I know that the collection contains String
instances. But in pre-Java-5 code, I would have got a "Collection" and I
would have looked at the documentation to know what that Collection
contains. Generics may detect a bug only if, in that situation, I would
have boldly and wrongly assumed that the Collection contained something
else. This is not something which was actually happening at that time.

In brief, generics do not solve a bug-related problem that I had. They
do improve a documentation-related problem that I had -- namely with
code written by other people with poor documentation. They also make
code more readable due to the visual clutter implied by the extra casts.
Generics thus allow me to write code faster, because I waste less time
wading through external documentation and I can fit more useful code in
my eye-brain system. But bugs ? Nope.

Basically, after using Java and generics quite extensively, I simply do
not buy the marketing slogan "generics add powerful compile-time bug
detection". I also note that the same slogan has been used for C++ (with
regards to C) and I do not buy it either. In both situation it is a
"nice intent", the kind Hell is paved of.


	--Thomas Pornin
0
Thomas
3/18/2010 1:53:52 PM
Roedy Green wrote:
> On Wed, 17 Mar 2010 15:55:53 -0700, "Mike Schilling"
> <mscottschilling@hotmail.com> wrote, quoted or indirectly quoted
> someone who said :
>
>> Yes, Roedy, I know what thty are, but they're not relevant to what I
>> was exploring.
>>
>
> You were complaining that generic docs do not cover autoboxing and
> widening.

Where the hell did that come from? 


0
Mike
3/18/2010 3:32:51 PM
Thomas Pornin wrote:
> Basically, after using Java and generics quite extensively, I simply
> do not buy the marketing slogan "generics add powerful compile-time
> bug detection". I also note that the same slogan has been used for
> C++ (with regards to C) and I do not buy it either. In both situation
> it is a "nice intent", the kind Hell is paved of.

Function prototypes, invented in C++ and then retrofutted into C, prevent a 
large number of bugs caused by not getting the calling sequence of a 
function quite right. 


0
Mike
3/18/2010 3:35:29 PM
On 3/18/2010 11:32 AM, Mike Schilling wrote:
> Roedy Green wrote:
>> On Wed, 17 Mar 2010 15:55:53 -0700, "Mike Schilling"
>> <mscottschilling@hotmail.com>  wrote, quoted or indirectly quoted
>> someone who said :
>>
>>> Yes, Roedy, I know what thty are, but they're not relevant to what I
>>> was exploring.
>>>
>>
>> You were complaining that generic docs do not cover autoboxing and
>> widening.
>
> Where the hell did that come from?

     Don't feel bad that you don't see your complaints, Mike.
Neither can I.  Perhaps we have similar difficulties with
reading comprehension.

-- 
Eric Sosman
esosman@ieee-dot-org.invalid
0
Eric
3/18/2010 3:40:21 PM
On Thu, 18 Mar 2010 08:35:29 -0700, Mike Schilling wrote:

> Thomas Pornin wrote:
>> Basically, after using Java and generics quite extensively, I simply do
>> not buy the marketing slogan "generics add powerful compile-time bug
>> detection". I also note that the same slogan has been used for C++
>> (with regards to C) and I do not buy it either. In both situation it is
>> a "nice intent", the kind Hell is paved of.
>
                                           ^^  s/of/with/

....please. Like the UK nastiness,  "the england team", I find the 
Americanism of using 'of' instead of 'with' very irritating. Arrrr, I 
feel better with that off my chest.

> Function prototypes, invented in C++ and then retrofutted into C,
> prevent a large number of bugs caused by not getting the calling
> sequence of a function quite right.
>
So that's where it came from. I'd always assumed it was an ANSI C import 
from one of the Algols or Pascal. I still have a system with a K&R C 
compiler and really miss ANSI function prototypes every time I write 
something for it.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |
0
Martin
3/18/2010 6:01:47 PM
On Wed, 17 Mar 2010, Mike Schilling wrote:

> Stefan Ram wrote:
>> Arne Vajh?j <arne@vajhoej.dk> writes:
>>> Most likely Roedy (as usual) did not read the entire message
>>> that he was replying to.
>>
>>  Mike posted some very helpful observations at the end of
>>  his post. But he started his post with distracting and
>>  boring preliminaries. Possibly Roady was not the only one
>>  who was not reading it to the end. Anyway, I thank Mike
>>  for sharing his insights!
>
> You're welcome.  (I think.)

Yeah, too long for me, so didn't read it, but i'm looking forward to the 
movie. And only partly because i heard they cast Megan Fox as a bounded 
wildcard.

tom

-- 
I need a proper outlet for my tendency towards analytical thought. --
Geneva Melzack
0
Tom
3/18/2010 9:22:58 PM
On Thu, 18 Mar 2010, Thomas Pornin wrote:

> I am not claiming that generics are ill-designed by themselves; hard and
> smart work went into them, and they do what they were meant to do. I
> claim that they are a revival of an old theme, and flow opposite to the
> rest of the design of Java.

Interesting. Do you see Java falling into the gravity well of 
Smalltalk/Self, or something different?

tom

-- 
I need a proper outlet for my tendency towards analytical thought. --
Geneva Melzack
0
Tom
3/18/2010 9:24:35 PM
On Thu, 18 Mar 2010, Martin Gregorie wrote:

> On Thu, 18 Mar 2010 08:35:29 -0700, Mike Schilling wrote:
>
>> Thomas Pornin wrote:
>>> Basically, after using Java and generics quite extensively, I simply do
>>> not buy the marketing slogan "generics add powerful compile-time bug
>>> detection". I also note that the same slogan has been used for C++
>>> (with regards to C) and I do not buy it either. In both situation it is
>>> a "nice intent", the kind Hell is paved of.
>>
>                                           ^^  s/of/with/
>
> ...please. Like the UK nastiness,  "the england team", I find the
> Americanism of using 'of' instead of 'with' very irritating. Arrrr, I
> feel better with that off my chest.

I believe it is the road to hell that is so paved, rather than hell 
itself. Hell has parquet floors throughout.

tom

-- 
I need a proper outlet for my tendency towards analytical thought. --
Geneva Melzack
0
Tom
3/18/2010 9:26:58 PM
Thomas Pornin wrote:
>>> Basically, after using Java and generics quite extensively, I simply
>>> do not buy the marketing slogan "generics add powerful compile-time
>>> bug detection". I also note that the same slogan has been used for
>>> C++ (with regards to C) and I do not buy it either. In both situation
>>> it is a "nice intent", the kind Hell is paved of.
>

Martin Gregorie wrote:
>> ...please. Like the UK nastiness, =A0"the england team", I find the
>> Americanism of using 'of' instead of 'with' very irritating. Arrrr, I
>> feel better with that off my chest.
>

That's an Americanism?  I'm American, and I'm not familiar with it.

Tom Anderson wrote:
> I believe it is the road to hell that is so paved, rather than hell
> itself. Hell has parquet floors throughout.
>

If the road *to* Hell is paved with good intentions (not "intent"),
and one is traversing that road in the opposite direction, i.e., *away
from* Hell, is it not still paved with good intentions?

So the road out of Hell is paved with good intentions, yes?

The issue isn't the intentions, it's the direction in which one is
traveling atop them.

--
Lew

0
Lew
3/18/2010 10:05:47 PM
According to Lew  <lew@lewscanon.com>:
> That's an Americanism?  I'm American, and I'm not familiar with it.

I am not American, neither British, and English is not my mother
language, so my texts are subject to occasional (and creative) slipage.


	--Thomas Pornin
0
Thomas
3/18/2010 11:50:25 PM
On Thu, 18 Mar 2010 15:05:47 -0700, Lew wrote:

> Martin Gregorie wrote:
>>> ...please. Like the UK nastiness,  "the england team", I find the
>>> Americanism of using 'of' instead of 'with' very irritating. Arrrr, I
>>> feel better with that off my chest.
>>
>>
> That's an Americanism?  I'm American, and I'm not familiar with it.
>
I've always assumed it must be, since I've never seen it used by anybody 
other than an American. Its possible its written rather than spoken 
though I must admit that would surprise me.
 

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |
0
Martin
3/18/2010 11:55:14 PM
On 18-03-2010 03:57, Roedy Green wrote:
> On 18 Mar 2010 01:43:11 GMT, ram@zedat.fu-berlin.de (Stefan Ram)
> wrote, quoted or indirectly quoted someone who said :
>> . Possibly Roady was not the only one
>>   who was not reading it to the end
>
> My comment still stands whether you read the whole post or not.

Still stand as being irrelevant for the thread.

Arne
0
ISO
3/19/2010 12:48:19 AM
On 18-03-2010 11:32, Mike Schilling wrote:
> Roedy Green wrote:
>> On Wed, 17 Mar 2010 15:55:53 -0700, "Mike Schilling"
>> <mscottschilling@hotmail.com>  wrote, quoted or indirectly quoted
>> someone who said :
>>> Yes, Roedy, I know what thty are, but they're not relevant to what I
>>> was exploring.
>>
>> You were complaining that generic docs do not cover autoboxing and
>> widening.
>
> Where the hell did that come from?

Out of thin air.

But hey it managed to squeeze 3 Java concepts into one
sentence.

That may actually impress some people. Especially
if they do not know Java.

Arne
0
ISO
3/19/2010 12:50:44 AM
On Thu, 18 Mar 2010 18:01:47 +0000 (UTC), Martin Gregorie
<martin@address-in-sig.invalid> wrote:

>On Thu, 18 Mar 2010 08:35:29 -0700, Mike Schilling wrote:
>
>> Thomas Pornin wrote:
>>> Basically, after using Java and generics quite extensively, I simply do
>>> not buy the marketing slogan "generics add powerful compile-time bug
>>> detection". I also note that the same slogan has been used for C++
>>> (with regards to C) and I do not buy it either. In both situation it is
>>> a "nice intent", the kind Hell is paved of.
>>
>                                           ^^  s/of/with/
>
>...please. Like the UK nastiness,  "the england team", I find the 
>Americanism of using 'of' instead of 'with' very irritating. 

Such misconstructions are not really "Americanisms" in the sense that
they are unique to the American dialect of English.  They are, rather,
something I like to call "stupidisms" (trademark pending) and, IMO,
are more indicative of poor language education rather than of locale
(though certainly locale and education may have correspondence).

YMMV.

My pet peeve is using "since" for "because".  I don't care what the
new dictionaries say ... those two words are not synonyms but merely
have partially coincident meaning.

YM I don't care to hear (unless you agree 8).

>Arrrr, I feel better with that off my chest.

Ditto.
0
George
3/19/2010 2:04:38 AM
On 18-03-2010 22:04, George Neuner wrote:
> On Thu, 18 Mar 2010 18:01:47 +0000 (UTC), Martin Gregorie
> <martin@address-in-sig.invalid>  wrote:
>
>> On Thu, 18 Mar 2010 08:35:29 -0700, Mike Schilling wrote:
>>
>>> Thomas Pornin wrote:
>>>> Basically, after using Java and generics quite extensively, I simply do
>>>> not buy the marketing slogan "generics add powerful compile-time bug
>>>> detection". I also note that the same slogan has been used for C++
>>>> (with regards to C) and I do not buy it either. In both situation it is
>>>> a "nice intent", the kind Hell is paved of.
>>>
>>                                            ^^  s/of/with/
>>
>> ...please. Like the UK nastiness,  "the england team", I find the
>> Americanism of using 'of' instead of 'with' very irritating.
>
> Such misconstructions are not really "Americanisms" in the sense that
> they are unique to the American dialect of English.  They are, rather,
> something I like to call "stupidisms" (trademark pending) and, IMO,
> are more indicative of poor language education rather than of locale
> (though certainly locale and education may have correspondence).
>
> YMMV.

Can you pronounce "R�dgr�d med fl�de" correctly?

Arne
0
ISO
3/19/2010 2:23:05 AM
George Neuner <gneuner2@comcast.net> writes:
>something I like to call "stupidisms" (trademark pending) and, IMO,

  Am I the only one to whom this subject sounds stupid:

      �First class developer: who ?�

  ? (I am not a native speaker of English, so I am not sure.)
  Let me quote:

      �Besides a mathematical inclination, an exceptionally
      good mastery of one's native tongue is the most vital
      asset of a competent programmer.� 

    attributed to Djikstra, but I can not confirm the source

      �If your writing is semi-literate, ungrammatical, and
      riddled with misspellings, many hackers (including myself)
      will tend to ignore you. While sloppy writing does not
      invariably mean sloppy thinking, we've generally found the
      correlation to be strong -- and we have no use for sloppy
      thinkers. If you can't yet write competently, learn to.�

    Eric Raymond
    
http://www.catb.org/~esr/faqs/hacker-howto.html#skills4

      �I've found that some of the best developers of all are
      English majors. They'll often graduate with no programming
      experience at all, and certainly without a clue about the
      difference between DRAM and EPROM.

      But they can write. That's the art of conveying
      information concisely and clearly. Software development
      and writing are both the art of knowing what you're going
      to do, and then lucidly expressing your ideas.�

http://praisecurseandrecurse.blogspot.com/2007/03/english-majors-as-programmers.html

0
ram
3/19/2010 2:25:13 AM
On Fri, 19 Mar 2010, Stefan Ram wrote:

> George Neuner <gneuner2@comcast.net> writes:
>> something I like to call "stupidisms" (trademark pending) and, IMO,
>
>  Am I the only one to whom this subject sounds stupid:
>
>      ?First class developer: who ??
>
>  ? (I am not a native speaker of English, so I am not sure.)
>  Let me quote:
>
>      ?Besides a mathematical inclination, an exceptionally
>      good mastery of one's native tongue is the most vital
>      asset of a competent programmer.?
>
>    attributed to Djikstra, but I can not confirm the source
>
>      ?If your writing is semi-literate, ungrammatical, and
>      riddled with misspellings, many hackers (including myself)
>      will tend to ignore you. While sloppy writing does not
>      invariably mean sloppy thinking, we've generally found the
>      correlation to be strong -- and we have no use for sloppy
>      thinkers. If you can't yet write competently, learn to.?
>
>    Eric Raymond
>
> http://www.catb.org/~esr/faqs/hacker-howto.html#skills4
>
>      ?I've found that some of the best developers of all are
>      English majors. They'll often graduate with no programming
>      experience at all, and certainly without a clue about the
>      difference between DRAM and EPROM.
>
>      But they can write. That's the art of conveying
>      information concisely and clearly. Software development
>      and writing are both the art of knowing what you're going
>      to do, and then lucidly expressing your ideas.?
>
> http://praisecurseandrecurse.blogspot.com/2007/03/english-majors-as-programmers.html

Nice quotes, Stefan! A sentiment i rather agree with - i think the skills 
of writing good natural language and good code are more similar than 
people think. Perhaps we should be setting George Orwell's essays and 
Jacques Prevert's poetry as reading in programming courses?

tom

-- 
Feeling down? Talk to someone you hate and replace that low feeling with
pure rage!! -- Rhys Davies
0
Tom
3/19/2010 11:00:37 AM
On Thu, 18 Mar 2010, Lew wrote:

> Thomas Pornin wrote:
>>>> Basically, after using Java and generics quite extensively, I simply
>>>> do not buy the marketing slogan "generics add powerful compile-time
>>>> bug detection". I also note that the same slogan has been used for
>>>> C++ (with regards to C) and I do not buy it either. In both situation
>>>> it is a "nice intent", the kind Hell is paved of.
>
> Tom Anderson wrote:
>> I believe it is the road to hell that is so paved, rather than hell
>> itself. Hell has parquet floors throughout.
>
> If the road *to* Hell is paved with good intentions (not "intent"), and 
> one is traversing that road in the opposite direction, i.e., *away from* 
> Hell, is it not still paved with good intentions?

Might not be. If it's a dual carriageway, or there's a one-way system, so 
the route back is not the same as the route there, then the paving could 
be different in either direction. And based on my experience of places on 
Earth similar to hell, i strongly suspect the one-way system.

Hmm. Are there any cases where roads have different pavings on lanes 
running in different directions? You could imagine a that a steeply 
sloping road in a wet or snowy country might - it could have a grippier 
surface on the lane running uphill.

tom

-- 
Where yesterday's future is here today
0
Tom
3/19/2010 11:14:20 AM
On 19/03/2010 11:14, Tom Anderson wrote:
> On Thu, 18 Mar 2010, Lew wrote:
>
>> Thomas Pornin wrote:
>>>>> Basically, after using Java and generics quite extensively, I simply
>>>>> do not buy the marketing slogan "generics add powerful compile-time
>>>>> bug detection". I also note that the same slogan has been used for
>>>>> C++ (with regards to C) and I do not buy it either. In both situation
>>>>> it is a "nice intent", the kind Hell is paved of.
>>
>> Tom Anderson wrote:
>>> I believe it is the road to hell that is so paved, rather than hell
>>> itself. Hell has parquet floors throughout.
>>
>> If the road *to* Hell is paved with good intentions (not "intent"),
>> and one is traversing that road in the opposite direction, i.e., *away
>> from* Hell, is it not still paved with good intentions?
>
> Might not be. If it's a dual carriageway, or there's a one-way system,
> so the route back is not the same as the route there, then the paving
> could be different in either direction. And based on my experience of
> places on Earth similar to hell, i strongly suspect the one-way system.
>
> Hmm. Are there any cases where roads have different pavings on lanes
> running in different directions? You could imagine a that a steeply
> sloping road in a wet or snowy country might - it could have a grippier
> surface on the lane running uphill.
>

It must therefore be Hell's demons that apply the Shellgrip™ on the 
approaches (i.e. one side of the road) to the Hangar Lane gyratory†?

-- 
RGB
† http://en.wikipedia.org/wiki/Hanger_Lane_gyratory
0
RedGrittyBrick
3/19/2010 11:28:17 AM
Tom Anderson wrote:
> Hmm. Are there any cases where roads have different pavings on lanes
> running in different directions? You could imagine a that a steeply
> sloping road in a wet or snowy country might - it could have a
> grippier surface on the lane running uphill.

When I was young, I used to walk five miles to school, uphill in both 
directions. 


0
Mike
3/19/2010 2:37:38 PM
Reply:
Similar Artilces:

java
Hello All, What is the present state of opengl 'binding' to java (or vice versa). The picture emerging from the internet confuses me. Any comments gratefully received. Ivan "ivan danicic" <ivan@goaway.spam> wrote in message news:aWq8f.7097$iD.5529@fe2.news.blueyonder.co.uk... > Hello All, What is the present state of opengl 'binding' to java (or vice > versa). The picture emerging from the internet confuses me. Any comments > gratefully received. > Ivan > "jogl" is still active and probably one of the most complete. I've assumed ...

Re: Berkeley Madonna and System Dynamics
Hi Lou, Wikipedia defines System Dynamics as: System dynamics is one approach to modeling the dynamics of complex systems such as population, ecological and economic systems, which usually interact strongly with each other. Systems Dynamics was founded in the early 1960s by Jay W. Forrester of the MIT Sloan School of Management with the establishment of the MIT System Dynamics Group. At that time, he began applying what he had learned about systems during his work in electrical engineering to everyday kinds of systems. What makes using System Dynamics different fro...

memory needs of SQL based system
We are in the process of rewriting a major portion of our code to switch from record level RPG access methods to using SQL procedures and embedded SQL. Our 520 now has 4gb of memory. WIll we see performance issues arise as we implement the new SQL driven access methods and procedures? Any gotchas we need to be aware of so we don't unleash an embedded SQL that locks up the system? Would it be advisable up front to increase our RAM to say 16gb? A brave new world for us old record level access fogies..... When running in SQL intensive environment, rule of thumb is 8GB of main memory per...

Java Web Console
Hello, What security restrictions should be considered when accessing Solaris 10 Web Console using root account? I have no problem to log in using another user account, but my root password seems not to work.... Feb 19 15:24:15 dwsol Sun Java(TM) Web Console[704]: [ID 197375 daemon.warning] Authentication of user {0} failed. bash-3.00# /usr/sbin/smcwebserver status Sun Java(TM) Web Console is running bash-3.00# cacaoadm restart bash-3.00# /usr/sbin/smcwebserver restart Restarting Sun Java(TM) Web Console Version 3.0.2 ... The console is running bash-3.00# svcs -a |grep webconsole onli...

US-TX-Austin: System S/W Developers, C/C++, Linux, VoIP, 6-12mos. (45295257611)
US-TX-Austin: System S/W Developers, C/C++, Linux, VoIP, 6-12mos. (45295257611) ================================================================================ Position: System S/W Developers Reference: MKS00004 Location: Austin TX Duration: 6-12mos Skills: Skills 5+ years of software systems development 5+ years of C/C++ commercial product development 3+ years of development on the Linux platform. Have a broad skill set in development with specific skill set in voice, networking & c...

Java run-time error in starting Hudson
I followed the instructions to install Hudson at http://weblogs.java.net/blog/kohsuke/archive/2007/03/installing_huds.html Simply download hudson.war and run java -jar hudson.war But I get this run-time error: Running from: /cgbu/home0/cgbubldt/hudson/hudson.war [Winstone 2009/07/20 13:09:41] - Beginning extraction from war file [Winstone 2009/07/20 13:10:06] - No webapp classes folder found - / cgbu/home0/cgbubldt/.hudson/war/WEB-INF/classes 20-Jul-09 1:10:06 PM hudson.WebAppMain contextInitialized SEVERE: Failed to initialize Hudson java.lang.NoClassDefFoundError: hudson.model.Hudson ...

Calling IDL Objects from JAVA
Folks, We are working on a new web portal that uses JAVA code for most of its operations. We wish to add some graphical functionality to the web page, so we are using the JAVA bridge to call some already defined IDL objects that open a file, process the data, create a PNG file, and display it on the web page. All of this works reasonably well. (We have had some weird problems with the IDL JAVA Bridge Assistant Wizard, or whatever it is calling itself these days, but for the moment we have overcome these.) Our main problem is that our IDL objects use a LOT of keywords in their methods. Spec...

Java in Java
Is it possible to download a Java app (applet etc?) and run it inside a desktop Java app? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.theconsensus.org/ - A UK political party http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Quite likely, but you won't necessarily get the same security model, unless you were careful about it. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/&g...

Reduce with system of equations involving D
Hello, Here I'm using Reduce on a system of equations to find 'a' symbolically: { \[CapitalSigma]\[Tau] == D[Subscript[m, 1]*v*R + Subscript[m, 2]*v*R + \[CapitalIota]*v/R, t, NonConstants -> {v}], \[CapitalSigma]\[Tau] == Subscript[m, 1]*g*R, a == D[v, t, NonConstants -> v], Subscript[m, 1] > 0, Subscript[m, 2] > 0, g > 0, R > 0, \[CapitalIota] > 0 } Reduce[%, {a, D[v, t, NonConstants -> v], \[CapitalSigma]\[Tau]}] The answer is correct. However, I had to simplify the set of equations slightly. I'd like to say that: ...

US-NJ: Princeton-Jr. Java Web Developer
************************************************************** JobCircle.com - Careers, Content and Community for Technology professionals in the Northeastern United States! Jobcircle.com provides resume submission, classified searches, eLearning, hundreds of career development articles, tech news, and more to tens of thousands of Technology professionals in your area - visit us today at http://www.jobcircle.com! !!! Voted a TOP 50 Career Web Site in 2002 by CareerXRoads !!! ************************************************************** Job Title: Jr. Java Web Developer J...

Re: OT: Strict typing on large projects
> C is a weakly typed language because, with casts, you can make the > compiler treat any memory location as any type you'd care to. Actually, you don't even need casts to demonstrate weak typing in C. Consider: extern void f(); f(1.3); Combined with the following definition in a separate file ... void f(int d) { ... } Or in one line ... printf ("%d", 1.3); And not all casts are created equal. "(double)int_var" is fine, even in a strong/static typed language. "(double*) &int_var" is NOT fine. -- -- Jim Weirich / Compuware...

Java navigation bar
Anyone know a good site that'll teach you how to make a drop-down navigation bar? I assume it is javascript In article <20031015232805.29165.00000668@mb-m06.aol.com>, kkiely@aol.comnojunk enlightened us with... > Anyone know a good site that'll teach you how to make a drop-down navigation > bar? I assume it is javascript > Why re-invent the wheel? There's tons of free ones out there. Try http://www.dynamicdrive.com ------------------------------------------------- ~kaeli~ Jesus saves, Allah protects, and Cthulhu thinks you'd make a nice sandwich. http://www...

Inverting a non-minimum phase system function
Hello all, I'm a practicing engineer reviewing DSP. I ran across the following problem: Given a discrete time, stable, LTI, non-minimum-phase system, w/ system fcn: H(z) = ((1-az^-1)(1-a*z^-1))/((1-bz^-1)(1-b*^-1)). (Where * denotes complex conjugation and ^ denotes exponentiation). i.e. zeros at z = a,a*, poles at z = b,b*. We also are given that |b|>1, |a|>1. i.e. H(z) is non-causal and non-minimum-phase. We wish to find a fcn Hc(z) which is stable and gives a unity magnitude response when cascaded with H(z). i.e. G(z) = H(z)Hc(z) gives unity gain for all input frequ...

US-TX-Austin: Java Developer, Web Logic, Web servers, EJB, JSP, Linux; 2040 hrs. (45360214411)
US-TX-Austin: Java Developer, Web Logic, Web servers, EJB, JSP, Linux; 2040 hrs. (45360214411) ============================================================================================== Position: Java Developer Reference: ZYD00205 Location: Austin TX Duration: 2040 h Skills: Progressive information technology experience and responsibility. Knowledge of Internet application servers (especially Web Logic), Web servers, EJB, JSP, Linux, Oracle, OO analysis/design, and multiple programming languages. ...

Do-it-yourself hard drive rescue system
"Retrodata's platter extraction system is a 165-pound device that uses laser-guided positioning to help it accurately extract platters from any 3.5 inch hard drive with minimal user intervention. Such devices normally require highly skilled operators, but Retrodata's can be operated by a relative novice." The quote is from this article http://cwflyris.computerworld.com/t/2871354/68030659/101416/2/ "The System P. EX is slated for release next month, at an approximate cost of $6,950 per unit." I know we have a regular contributor to this NG from Retroda...

[OVMS-Alert] OSU HTTP Server System Info Disclosure Weaknesses
Does anyone here want to comment on this? A quick test with my server couldn't reproduce either problem, but maybe I'm missing something. Phillip Helbig---remove CLOTHES to reply wrote: > > Does anyone here want to comment on this? Perhaps you could point to wherever such a weakness is described/documented ? documented in a recent message to the openvms.org alerts list, in today's edition of the openvms.org newsletter and for those of you who for some reason do not subscribe to these, it is also documented at http://secunia.com/advisories/22016/ In article <451A...

loading file without typing the filename
Hi everybody, I want to load multiple files using the uigetfile function. The files are stored as a string in [filename,pathname] but i can't load them because i've to enter a string in the load command. Is there a way to do this without typing the name of the file (but something like M = load(filename(1,1))? this is what I got so far: [filename, pathname] = uigetfile('*.txt','Pick a file','MultiSelect', 'on'); %1: srflvtn, 2:emfx emfx_file = filename(1,1); srflvtn_file = filename(1,2); M = load(emfx_file); N = load(srflvtn_file); Thanks! Michel wr...

Practically Free Live 3 to 5 day Online Codecamps on Grails, Rails, jQuery, Spring, Java SE, Java EE, HTML5, Android
From July 23rd, 2013, JPassion.com is going to offer 3 to 5 days "live", "i= nstructor-led", "hands-on" style, "intensity guaranteed" codecamps (be read= y to code!) to all paying members of JPassion.com for free. Yes, for FREE. = Each of these codecamps would typically cost between $2000 to $4000. Now w= ith a paying membership of JPassion.com, which is $99 per year for now, you= can attend all of these live codecamps without paying a single extra dolla= r. Moving forward, we are planning to offer one or two codecamps per month.= Popular code...

Designing "Hard Science" Type Models of Perception, Cognition, and Memory
http://theoryandscience.icaap.org/content/vol004.002/03_shirley.html Interesting journal! ...

US-TX-San Antonio: Program Manager, Prior PM exp., HUD exp., Systems maint./deve (45298632410)
US-TX-San Antonio: Program Manager, Prior PM exp., HUD exp., Systems maint./deve (45298632410) ============================================================================================== Position: Program Manager Reference: SMC01367 Location: San Antonio TX Duration: Perm Skills: Prior PM experience required�preferably with HUD HUD experience required System maintenance and development required DAP experience highly desired Scope: The selected candidtate shall provide corrective and adap...

java.policy question 471540
First let me say that I've used Google and come up with numerous answers (too numerous!). I'm really looking for pointers more than the direct answers as direct answer will most likely leave me with more questions. I'm currently running Sun Java 1.5.0 and the initial work is on Firefox 1.0. Later I'll work on IE. I'm working on an applet which will eventually sit on a device where it will be served from. But for now I need to run the applet from another machine and, of course, it gets a security violation. To get around this I search the web and found that I can change the...

requirement for Java multi thread @sunnyvale, ca
hi Folks, Job Title: Java Multi-Threading Location : Sunnyvale, CA Duration: 12 months Need a hands-on developer with: * Strong server side Java skills * Fluent in developing multi-threaded apps * Experience developing applications with Cassandra with high read/write operations * Comfortable performance tuning app * Developed apps on Linux Strong JAVA experience building Multithreading / Scalable applications SEND RESUMES TO JWHITE@JBSAC.COM ...

help with locating an unnamed application on system
Hi I am running the latest version of mandriva with kde and there is an application running that once in a while pops up for 5 seconds with a message like "new messages on slasdot/google groups". The message is sort of yeallowish tooltip window just above the start bar. I have tried finding out what this program is so I can either close it configure it, but I have no clue. does anybody recognise this app? tom On 2006-08-26, Tom Fields wrote: > Hi > > I am running the latest version of mandriva with kde and there is an > application running that once in a while po...

TYCON POWER SYSTEMS TYCON-TP-SW5-NC | Looking to Sell | Launch 3 Telecom
Launch 3 Telecom is selling the following part: TYCON POWER SYSTEMS TYCON-TP-SW5-NC Request a Quote: http://www.launch3telecom.com/TyconPowerSystems/TYCONTPSW5NC.html www.Launch3telecom.com | 1-877-878-9134 Follow us on: Twitter: https://twitter.com/launch3telecom FaceBook: https://www.facebook.com/launch3telecom Blogspot: http://launch3telecom.blogspot.com WordPress: http://blog.launch3telecom.com YouTube: http://www.youtube.com/user/launch3telecom Pinterest: http://pinterest.com/launch3telecom Google Plus: https://plus.google.com/102713212642017290959/posts Linked...

PCMCIA (Type 1 + Type 2)
Hi there, I have an old laptop that I would like to use in a better way. Right now i have a type2 ethernet adapter and I connect to it by ssh, rarely i would use it live as it's very heavy! I started needing usb recently for all kinds of things and decided to buy a type2 4-port usb card... This was my first experience with pcmcia so I was very disapointed when i realised it was not possible to turn one up side down to have both fit at the same time in the two slots of my machine. Someone told me because they were type 2 i could buy a type 1 and have a type 1(eth) on the bottom and...