Re: Issue of the week

new topic     » goto parent     » topic index » view thread      » older message » newer message

I wrote:
>>I think that it SHOULD return the number of years since and including
>>year 1, but it's a bit too late to change that . . . Programs
>>wouldn't be backwards compatible.

Ralf replied:
>Since when cant Euphoria handle negative integers ?
>However, the most common used scope for years is from 1900 - 2150
>(total of 250) The value ex.exe gives you fits in a bit, for the next
>so-many years. It you want a bigger scope, just write out more bytes.
>But for now, the smallest scope is used.
>By the time we reach > 2150, we needed to worry about diskspace as
>much as now, and can easily use 2 or more bytes. Without breaking any
>existing code.

Well, let me clarify on this:

Let's say you write a program, using two digit numbers (because you
didn't read the REFMAN.DOC close enough). Then, in the year 2000, when
your program is used, the dates suddenly become 100. Of course, the
author could easily fix that by adding 100.

But if Euphoria used the full year, it would always use 4 digit years.
The way it is now, the programmer has to always add 1900 when he/she
displays the date for the program to be Y2K compliant. (Otherwise, it's
suddenly 100, and maybe he only had room for 2 digits in the program, so
now it's all unaligned because it's using 3 spaces now.)

Also, think about this: Once the year 2000 comes around, any program
written will either have to subtract 100 (To use 2 digit years (00, 01,
etc. But then it wouldn't be Y3K compliant... ;) ) or add 1900 for 4
digit years.

Now, wouldn't it be nicer if Euphoria always returned 4 digits? It
wouldn't use up any more memory (an integer uses the same amount of
space, be it 2 digits or 4), and the programmer wouldn't have to always
add 1900 to the dates. (If displaying, of course, if using calculations,
everything would seem normal.) But, Euphoria doesn't, and can't, because
it's too late. Otherwise, programs that are Y2K compliant (add 1900) will
suddenly show year 3900 in the year 2000.

Sorry about the long message. What can I say, I'm a programmer, and I try
to think out every possible bug in my message (even though some get
through ;) (It's either too simple (last message) or too in-depth, (this
one) your choice. :)


___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu