Learning hexadecimal.

Hello, I am a fairly new programer, and I am wondering. How important do you think it is to learn hexadecimal?

Depends on what you are programming. Something like scriv would be highly involved with non-printable so understanding HEX would be important. Socked programing would also benefit from HEX as many protocols will dbug out into hex.

Keep in mind that HEX is not like a language with syntax, grammar and the like. It is simply a number methodology (base 16). There isn’t much to learn other than the numerical sequence and how to convert from one base to another (most of us bit heads go to base 10 then convert out).

For the record the the numbering sequence is 0 1 2 3 4 5 6 7 8 9 A B C D E F.

Well, I can safely say that I don’t know hex. :slight_smile: I can turn a number into base 16 if I want, sure, but I’ve never had need to. The only time I’ve ever needed to worry about hexadecimal with Scrivener was when I wanted to add the ability for RTF files to save image data - because they require it as hex data. But fortunately somebody else had provided code for that somewhere. So, it really depends on what you want to do, but I certainly have never had need of it in programming Scrivener, for which I use Cocoa, a high-level programming language (the standard on OS X).

Which is the part that most folks forget. There are 101 functions to convert from hex to dec to bin to oct in any number of ways. depending on the language this may not required explicit recasting of the data from format to format (look at printf for an easy example).

The only time I ever need to use hex is when looking at IP header or ethernet configs. Sun insists on packing netmasks as hex, Mac addresses are al hex, and most TCp/IP sniffers encode in hex to save display space. Let it suffice to say that 99% of the time I STILL use perl -e “print dec(AF)” to figure things out.

So don’t worry about “thinking” in hex as much as understanding why you need to know about it and how to get from hex to dec to bin and back.

The important thing to know about Hex is that it’s simply a shorthand way of writing binary notation. Before you spend time figuring anything out, simply ask yourself:

‘Do I need to read and interpret pure binary numbers?’

If the answer is ‘no’, then forget Hex. For the few places you’ll need to use it, you’ll be able to interpret it another way, or simply be looking for a particular hex integer.

This isn’t to say it isn’t valuable, of course, just of limited value to high level (e.g. Application) programming. I’m about to learn how to program simple micro-controllers so I can hack up an insane, cursing Furby as a new years gift for someone. I imagine Hex notation is going to come in very handy there :smiley: