how often do you come across dealing with hex and binary in your programming work? |
Hex - very frequently. Binary less often, but that's partly because translation between hex and binary is pretty straightforward, and hex is easier to deal with, a string of 1s and 0s can be easily mis-read or mis-typed.
To do any serious programming in C or C++, you will need to use a debugger to examine the contents of your variables as the program is executing. Almost immediately, you will be exposed to hexadecimal data. Addresses, such as the contents of a pointer are usually expressed in hex.
If you think that's too heavy-duty, there are lots of more everyday examples. Take this random URL,
http://en.wikipedia.org/wiki/Earthshaker_%28album%29
notice the
%28 and
%29 characters - they are hex encoding of a character.
Or say you have a file containing text like this:
"hello" “world”
.
You see there are three different symbols used to represent the double quote mark. The easiest way to recognise which is which is to look at the hex values,
Similarly, distinguishing between various whitespace or non-printable characters may be easier in hex.
Trying to avoid the use of hex is a bit like trying to avoid the use of if-then-else, it's pretty much fundamental to programming. You may not use it every day, but when you
do use it, then it gets used a lot.