Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

Remedial Interface Design (was Re: Why Make Perl Y2038 safe in Y2008.)

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


schwern at pobox

Feb 1, 2008, 9:58 PM

Post #1 of 5 (226 views)
Permalink
Remedial Interface Design (was Re: Why Make Perl Y2038 safe in Y2008.)

Mark Mielke wrote:
> Michael's test didn't fail. It was his interpretation that was
> incorrect. It is invalid to expect that there exists a 32-bit
> epoch number for every possible DateTime instance.

I would like to take this opportunity to teach a little remedial interface design.

Normal people are taught that one number is about the same as any other
number. You don't do different maths with 12 as with 4139198. A + B doesn't
suddenly break if B gets too big. In design terms this is the "user model".
It's made up of the user's previous experiences and what the interface
suggests is going on.

Perl gives no indication that there's something different about certain
numbers. 5 vs 5_000_000 vs 5_000_000_000 all look the same and are treated
the same by the language. This is the "interface model".

Internally, otoh, 5 and 5_000_000_000 are treated differently. This is how
things really work. It is called the "device model". The user is generally
not aware of the device model, they don't know how it really works. All they
see is the interface.

We're not users, we are the designers. We know how the guts work. We know
about epoch times and 32 bit integers and all that stuff. We can see inside
the black box. We are aware of the device model. We can draw all sorts of
correct conclusions about how things are going to work based on how it really
does work. This is called the "design model".

Here's the important thing: The user is totally uninfluenced by the device or
design models. We can say the user is wrong until we're blue in the face, it
won't change their expectations one bit. There are two things which influence
the user's ideas and expectations about how it should work.

1) The interface model.
2) The user's past experiences.

That's it.

If you want to think about it in terms of information flow...

Designer <-> Device -> Interface -> User

The designer creates the device but the device also influences the designer's
thinking.

The device has an interface. Some of that interface is deliberately designed,
a lot of it is incidental.

All the user sees is the interface.

There is no reason that an end user or Perl programmer would ever expect that
2**31 might be the biggest number or that 2038 would be the end of time.
There's nothing in the user's prior experience or suggested by the interface
to suggest these limits. So the user is *logically* and *justifiably* going
to be amazed when they put in 2040 as a year and things go wrong. Nothing
they know of says otherwise.

Normal people do not and should not have to think in terms of 32 bit vs 64 bit
vs epoch time vs whatever. They shouldn't have to worry about magic limits
*unless we give some indication otherwise*. For example, in C you have to
explicitly spell this all out to the programming language. The interface
makes the user aware of the problem.

We, the designers, know how time and numbers really work in computers. Thus
it makes sense that 2038 is some sort of barrier or that it's a bad idea to
expect to have an epoch time above 2 billion. But we know this because we're
the designers. We know how it works. This does not help the users. And we
can't go around "correcting" all of them.

We can say "of course it shouldn't work past 2038" all we want, and make all
the arguments we like about how everything is working perfectly as expected,
but that will have zero influence on the users. Users will continue to expect
that 2040 should work just like any other year or that 5 billion should work
fine like any other number and will be flabbergasted and frustrated when they
don't.

We might want to say "well, the user is wrong" or "users should learn more
about how computers really work" or "it's all working as documented" but what
we're really saying is "users should learn to accept Perl's limitations".

There's only so much of that a user will take before they go find something
that works.


--
"I went to college, which is a lot like being in the Army, except when stupid
people yell at me for stupid things, I can hit them."
-- Jonathan Schwarz


mark at mark

Feb 2, 2008, 6:42 AM

Post #2 of 5 (206 views)
Permalink
Re: Remedial Interface Design (was Re: Why Make Perl Y2038 safe in Y2008.) [In reply to]

Michael G Schwern wrote:
> Normal people are taught that one number is about the same as any
> other number. You don't do different maths with 12 as with 4139198.
> A + B doesn't suddenly break if B gets too big. In design terms this
> is the "user model". It's made up of the user's previous experiences
> and what the interface suggests is going on.

Normal people are wrong. Also, I don't think you are correct. Normal
people know that integers are not real numbers, and normal people who
have read the Perl documentation know that integers and real numbers are
stored differently in Perl, and have different limits. Normal people who
have read the Perl documentation know that outside of these limits,
something like BigInt must be used.

At this point, you are not talking about time. You are asking why Perl
numbers have limitations and why they are not automatically upgraded
completely invisible to the user, comparable to each other
transparently, presentable, and manipulatable transparently. Why is this?

One answer is that many Perl is a high level language, but evolved from
the requirements that it be fast, and that it be usable for low level
tasks. Perl provides bit-wise operators, and basic arithmetic operators,
which many people (perhaps not normal people like you) expect to work
more like their C integer counter-parts.

This is not "remedial interface design". This is a conflict in
requirements. You want the system to be smart enough to do exactly what
you mean - I want the system to be smart enough to do exactly what I
mean - Perl cannot do both. Larry Wall's thinking started out more like
my expectations not yours, so my expectations are met, and yours are
not. If you want to blame somebody - blame Larry. I think this would be
silly though. Larry fulfilled Larry's requirements, and Larry fulfilled
mine. I thank him.

> There is no reason that an end user or Perl programmer would ever
> expect that 2**31 might be the biggest number or that 2038 would be
> the end of time. There's nothing in the user's prior experience or
> suggested by the interface to suggest these limits. So the user is
> *logically* and *justifiably* going to be amazed when they put in 2040
> as a year and things go wrong. Nothing they know of says otherwise.

Nothing went wrong, except that the epoch method didn't return an NV.
DateTime is perfectly happy manipulating dates outside the 1970 - 2038
range. You ignored this and pointed out the single method that returned
something odd. If you really have a problem with this - ask the author
of DateTime to cast to an NV before doing arithmetic on the results.

>
> Normal people do not and should not have to think in terms of 32 bit
> vs 64 bit vs epoch time vs whatever. They shouldn't have to worry
> about magic limits *unless we give some indication otherwise*. For
> example, in C you have to explicitly spell this all out to the
> programming language. The interface makes the user aware of the problem.

You want Perl to auto-promote to NV or BigInt. Argue for that. This has
nothing to do with time.

>
> We, the designers, know how time and numbers really work in
> computers. Thus it makes sense that 2038 is some sort of barrier or
> that it's a bad idea to expect to have an epoch time above 2 billion.
> But we know this because we're the designers. We know how it works.
> This does not help the users. And we can't go around "correcting" all
> of them.
>
> We can say "of course it shouldn't work past 2038" all we want, and
> make all the arguments we like about how everything is working
> perfectly as expected, but that will have zero influence on the
> users. Users will continue to expect that 2040 should work just like
> any other year or that 5 billion should work fine like any other
> number and will be flabbergasted and frustrated when they don't.
>
> We might want to say "well, the user is wrong" or "users should learn
> more about how computers really work" or "it's all working as
> documented" but what we're really saying is "users should learn to
> accept Perl's limitations".
>
> There's only so much of that a user will take before they go find
> something that works.

Tell them to use DateTime and to not use epoch offsets if they don't
understand the limitations.

Cheers,
mark

--
Mark Mielke <mark[at]mielke.cc>


nospam-abuse at bloodgate

Feb 2, 2008, 7:25 AM

Post #3 of 5 (206 views)
Permalink
Re: Remedial Interface Design (was Re: Why Make Perl Y2038 safe in Y2008.) [In reply to]

On Saturday 02 February 2008 15:42:34 Mark Mielke wrote:
> Michael G Schwern wrote:
> > Normal people are taught that one number is about the same as any
> > other number. You don't do different maths with 12 as with
> > 4139198. A + B doesn't suddenly break if B gets too big. In design
> > terms this is the "user model". It's made up of the user's previous
> > experiences and what the interface suggests is going on.
>
> Normal people are wrong. Also, I don't think you are correct. Normal
> people know that integers are not real numbers, and normal people who
> have read the Perl documentation know that integers and real numbers
> are stored differently in Perl, and have different limits. Normal
> people who have read the Perl documentation know that outside of
> these limits, something like BigInt must be used.
>
> At this point, you are not talking about time. You are asking why
> Perl numbers have limitations and why they are not automatically
> upgraded completely invisible to the user, comparable to each other
> transparently, presentable, and manipulatable transparently. Why is
> this?

Because nobody had time yet to fix it. But the correct fix is to
auto-upgrade numbers so they never run "out of space". The fix is _NOT_
to tell users to suck up and live with arbitrariy limitations, esp. if
it means their calculations get wrong.

Users like me take "correct" over "fast", any day :)

All the best,

Tels

--
Signed on Sat Feb 2 16:24:20 2008 with key 0x93B84C15.
View my photo gallery: http://bloodgate.com/photos
PGP key on http://bloodgate.com/tels.asc or per email.

"A witty saying proves nothing."

-- Voltaire


andy at petdance

Feb 2, 2008, 8:04 AM

Post #4 of 5 (204 views)
Permalink
Re: Remedial Interface Design (was Re: Why Make Perl Y2038 safe in Y2008.) [In reply to]

On Feb 2, 2008, at 8:42 AM, Mark Mielke wrote:

> Normal people are wrong.


I think that pretty much sums it up right there, Mark.

I suggest that the folks wanting to move forward with making Perl
Y2038 compliant just go ahead and do it, rather than arguing its
value. To all but a handful (one?), its value is self-evident. Far
better to just make it happen rather than argue its merits against
"Normal people are wrong."

xoa

--
Andy Lester => andy[at]petdance.com => www.petdance.com => AIM:petdance


mark at mark

Feb 2, 2008, 3:37 PM

Post #5 of 5 (203 views)
Permalink
Re: Remedial Interface Design (was Re: Why Make Perl Y2038 safe in Y2008.) [In reply to]

Andy Lester wrote:
> On Feb 2, 2008, at 8:42 AM, Mark Mielke wrote:
>> Normal people are wrong.
>
> I think that pretty much sums it up right there, Mark.

No, it doesn't. Normal people do all sorts of silly things. If you want
a language for which you do not have to read the documentation, and you
are incapable of hanging yourself, other languages exist. Perl has never
been one of these languages. Perl is not simple, it is not consistent,
and it is not a such a high level that internal details about your
operating system are not exposed.

> I suggest that the folks wanting to move forward with making Perl
> Y2038 compliant just go ahead and do it, rather than arguing its
> value. To all but a handful (one?), its value is self-evident. Far
> better to just make it happen rather than argue its merits against
> "Normal people are wrong."

I suggest the folks that want to move forward - understand the problem
before assuming that it needs a resolution.

Cheers,
mark

--
Mark Mielke <mark[at]mielke.cc>

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.