Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31088

Re: "null", polymorphism and TCO

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: "null", polymorphism and TCO
Date 2015-02-08 15:03 -0500
Organization A noiseless patient Spider
Message-ID <mb8fe8$a88$1@dont-email.me> (permalink)
References <null-20150208185452@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 2/8/2015 1:16 PM, Stefan Ram wrote:
>    A book said that one needed null to mark the end of a linked
>    list:
> [...]
>    Neither null nor java.util.Optional is needed when one
>    is using polymorphism, i.e., real OOP. We just need to say
>    that an entry with a next entry is a different type than
>    an entry without a next entry. No »null«, no »Optional«,
>    just polymorphism!
> [...]

     When I was a young lad and learning my first programming
language (FORTRAN II; "young" was long ago for me), I figured
out how to write a counted loop using a "computed GOTO" instead
of a "DO".  Thus I proved my own great cleverness.

     ISTM your idea is similarly clever -- and similarly useless.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

Re: "null", polymorphism and TCO Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-02-08 15:03 -0500

csiph-web