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
hexadecimals
Re:hexadecimals
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.
I suppose it would be kind of like having:
Code: Select all
foo, bar int;
Code: Select all
int foo, bar;
Or of course people might just like it better ;D.
Re:hexadecimals
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
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
Declaring variables in Pascal isI suppose it would be kind of like having:Instead of:Code: Select all
foo, bar int;
Code: Select all
int foo, bar;
foo, bar :Integer;
But Hexadecimal notation in Pascal is
$N
Also VB has
Dim foo As Integer
Dim bar As Integer
and
&HN