[DGD]Casting to int

Kris Van Hees aedil at alchar.org
Fri Jun 30 15:34:27 CEST 2000


On Fri, Jun 30, 2000 at 03:07:33PM +0200, Mikael Lind wrote:
> Quoting Felix A. Croes from 12:40, June 30, 2000:
> Java was designed to resemble C a lot, so that programmers would feel
> instantly at home with it. Hence it doesn't make sense to bring up C
> and Java as two programming languages where the respective designers
> independently chose truncation over rounding for float to int
> conversion.

Given that argument, it is hardly possible to discuss anything about programming
languages due to most of them being fashioned after one another.  Look at LPC
and the elements it has from C?  Fact is though that the basic choice to have
Java do the casting to int the same way as C was made for a reason, and causes
two quite common languages to work the same way.
> 
> I agree that array indices should start at 1. 0 has a low-level
> computer connection; the array index as an offset from the first
> element. 1 is more suited for mathematic and scientific connections,
> as well as human expressions - the first element is element number
> one.

It is amazing that human nature has such a problem with the concept of the
number 0, while at the same time using it in alot of areas.  Besides, I do
not know math textbooks in other countries, but I know for certain that in
Belgium we're counting from 0 in math areas like series and formulas.  YMMV
> 
> With new computer languages moving farther away from their
> computer-friendly ancestors and more towards human-friendly aspects,
> I think that 1 is better suited as the first index; certainly in a
> language like LPC.

I think this discussion is too fundamental for this list, and so I will not
present an argumentation, other than saying: I think that the evolution you
mention is a shame.

	Kris

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list