Page 1 of 1
hexadecimals
Posted: Sat Feb 14, 2004 1:49 pm
by Adek336
hi. As I've see in various posts, we, programmers prefer the 0xdeadbeef notation instead of 0deadbeefh. I like it more as well, but why is it so??
Both forms seem very similar. Or, perhaps you prefer the other notation?
Cheers,
Adrian
Re:hexadecimals
Posted: Sun Feb 15, 2004 12:34 pm
by Curufir
Probably something to do with reading from left to right. The 0xN notation lets you know that the next thing you read is a hexadecimal number, whereas with the Nh notation you read the number first, then find out it's a hexadecimal afterwards.
I suppose it would be kind of like having:
Instead of:
I know which one I prefer.
Or of course people might just like it better ;D.
Re:hexadecimals
Posted: Sun Feb 15, 2004 12:42 pm
by Adek336
I think also the Nh notation was once popular under DOS and all the real mode stuff, for example all my books about bios interrupts use it. Something like indenting style perhaps ;D
Re:hexadecimals
Posted: Sun Feb 15, 2004 8:40 pm
by Schol-R-LEA
I cannot speak for others, but I generally use the C style notation out of consistency: it is the notation used by C, and most of the languages influenced by it (C++, Java, Perl, etc.). It simply takes less mental effort to use one style consistently wherever possible.
Re:hexadecimals
Posted: Thu Feb 19, 2004 5:06 am
by srg
I suppose it would be kind of like having:
Instead of:
Declaring variables in Pascal is
foo, bar :Integer;
But Hexadecimal notation in Pascal is
$N
Also VB has
Dim foo As Integer
Dim bar As Integer
and
&HN