Derek M Jones wrote on 16/4/01 4:51 pm:
> I know what I would like to say about this usage. But having a stated
> aim of basing guidelines on experimental results I am stuck between
> a rock and a hard place.
Derek,
I haven't contributed because I don't any direct evidence on these points,
and I leave it to real experts to supply intuitions and anecdotal evidence.
But since you can't find what you need, I think you might relax the
requirements on the data you're looking for a little bit. There might not be
evidence that bears directly on decimal/hex, but all is not lost. There's
evidence that it's easier to handle material (notably strings) when the
conceptual differences are reflected by differences in the presentation, so
that conceptual parsing can be replaced by perceptual parsing; and that kind
of evidence would surely include the examples you've given.
The only paper that comes immediately to mind is a very old one I was
involved with, but there are bound to be many more. In ours, we were looking
at the problem of why regular expressions are so hard. It's an odd paper but
might be worth looking out if you have time to spare:
Payne, S.J., Sime, M.E. and Green, T.R.G. (1984) Perceptual structure
cueing in a simple command language. International Journal of Man-Machine
Studies, 21, 19-29
The implication would be that if you need to mix data types in expressions,
the reader will find it easier if each data type is cued at the surface
level in some way. Basic used to have a special symbol for strings and
another kind of cue for integers (I think that was mentioned earlier in this
thread) and that would be a typical example.
The cue used to indicate a hex number, '0x', is pretty unintuitive!
Of course, even knowing that one is hex and one is decimal won't avoid all
problems; their conceptual similarities will create potential confusions,
and I daresay that there are cognitive processing problems.
But experts are likely to use standard shorthands in certain situations. So,
wrt your question,
> Why would anybody use a hex literal in the context of a multiple, or a
> decimal literal in the context of a bit-wise OR operator?
one answer might be that the hex is there because it indicates a particular
bit-processing effect, and (by being hex) cues the equally-well-informed
reader that the intention is to do bit-processing rather than normal
arithmetic. In the same way, certain decimal literals might well be used for
compactness (eg 255 and other powers of 2 minus 1), and again relying on the
reader to be well-informed enough to appreciate the significance.
As a cognitive psychologist I hesitate to tell computer scientists what to
do. At least, I don't, but I try to. So if that expert thinks it's worth
taking the risk of confusing some readers, that's his/her judgement.
> would claim that very few programmers
> ever have that sort of exposure to hex.
You're surely right. But if our expert is writing for a very select group
...
So I think there are a few principles that, although all pretty obvious,
can be defended by appeal to the literature, which is what you wanted.
Something like: don't go mixing them unnecessarily; use surface cues if you
do mix; but it might be OK to mix for special purposes, when the readership
can be expected to understand those purposes, and especially when the
numbers themselves carry a special significance (like 255).
Best I can do for now (unless you want to fund some research)
Cheers
Thomas
----
T. R. G. Green also at:
preferred postal address: Computer-Based Learning Unit
Oriel House, 27 Allerton Park, University of Leeds
Leeds LS7 4ND, U.K. Leeds LS2 9JT, U.K.
0113-226-6687 (tel)
0113-226-2751 (fax)
http://www.ndirect.co.uk/~thomas.green
- Automatic footer for [EMAIL PROTECTED] ----------------------------------
To unsubscribe from this list, mail [EMAIL PROTECTED] unsubscribe discuss
To join the announcements list, mail [EMAIL PROTECTED] subscribe announce
To receive a help file, mail [EMAIL PROTECTED] help
This list is archived at http://www.mail-archive.com/discuss%40ppig.org/
If you have any problems or questions, please mail [EMAIL PROTECTED]