Russel,
> > Conceptually they are likely to represent different kinds of data. One
> is a
> > numeric value and the other is likely to be a pattern of bits (ok, the hex
> > value
> > may be an address value being represented in hex for convenience).
>Certainly, people are more often than not taught that hex is for
>addresses and bit-patterns and decimal is for proper numbers and it is
>true that if you indoctinate people for long enough they begin to
>believe the factoids they are told to be the truth. Thus any amount of
>experimentation or argumentation is going to have to deal with the issue
>that this is a truth determined by forced usage rather than anything
>deeper in the cognitive issues.
Forced usage? There are cases where decimal or hex is the natural
representation and there are the gray areas. People will vary in their
preferences on which way to jump in the gray cases.
Guidelines might push people in a certain direction (if only because
they get fed up of having to explain to their boss why some tool keeps
flagging some construct where they decided to jump in the opposite
direction). By its nature guideline wording is best when concise. This
means that the general cases get handled well and the edge cases
tag along (right, wrong, or indifferently).
> > Arrays are normally used to represent a sequence of the same kind of data.
> > So mixing decimal and hex is suspect.
>
>Why?
Was a 0x missed off by mistake, do readers of the source see a 0x where
none exists (and deduce the incorrect value)?
> > The situation can be more complex for structures. In this case individual
> > members can have different uses:
> >
> > struct {
> > int some_value;
> > int some_bits;
> > int another value;
> > } information[ 3 ] = { { 23, 0x4f, 43},
> > { 0, 0xea, 8},
> > { 1, 0x00, 2}};
> >
> >
> > The list of numeric values are not paired with each other, but the members
> > of the struct. So mixing decimal and hex in this context makes sense.
>
>I wonder if you are trying to impose a deeper meaning to the
>representation where there is in fact none other than learned usage.
I don't understand your point here.
> > x = y * 0x4e;
> >
> > and
> >
> > a = b | 73;
> >
> > 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? Very suspect.
>
>I really don't see an issue here. I can imagine the above expressions
>being natural and often used or, conversely, being obfuscation. Without
>the context of ther rest of the program and the programmer's design
>notes, I do not think there is any conclusion that we can usefully draw.
There are certainly cases where strong arguments can be made for the
above usage. But in general anybody seeing this code would note the
unusual combinations and want to investigate further. Guidelines are
irksome for people who have to write out of the ordinary code.
>It is certainly the case that the majority of the people who are briefly
>educated in IT in a misguided effort to solve the putative IT skills
>shortage have probably not heard of non-decimal bases such as
>hexadecimal or base256. The question is whether we are dealing with
>properly educated professionals or the well intentioned amateurs.
Neither, we are dealing with the poorly educated, probably of averaging
ability, professional (well they do get paid).
Are there any real amateurs out there these days? Why would somebody
program for nothing when he/she could probably bluff their way into a
position where they were paid to program?
>Are we trying to support new learners or understand the depths of the
>seasoned professional? This is an important issue since the two are
>very different domains.
I was consulting at a bank in the city a few months ago. A few rows
down from me in the development group was a person writing some
Java. She had an introductory Java book open next to her terminal
and would think nothing of shouting questions to somebody in the
next row (I don't think she knew much about programming, let alone
Java). What amazed me was the fact that she was not fired within a
day or two, for incompetence. Computing is an industry where the
requirement to continually learn new things means those without
ability can hide their failings.
> I would suggest that the handful of people who can are actually more
>important that the many who can't. Without understanding expertise
>there is little that can be done for the learners.
In some development groups I have known it was an open question whether
firing the 10% 'cleverest' programmers or the 10% most incompetent
programmers would have made the biggest difference.
Software development and maintenance is usually a group activity.
Yes, talented people can write understandable source. But it takes
longer and requires iterations of development, they invariably start off
with the more complicated version first. Given the pressure to get to
market there is rarely time to iterate.
My own position is that Mr/Mrs/Miz average is the person who needs
to be studied. A position I have followed in my guidelines (and expect to
get a lot of stick over).
derek
--
Derek M Jones tel: +44 (0) 1252
520 667
Knowledge Software Ltd mailto:[EMAIL PROTECTED]
Applications Standards Conformance Testing http://www.knosof.co.uk
- 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]