Author |
Topic  |
|
seahorse
Senior Member
   
USA
1075 Posts |
Posted - 08 October 2003 : 01:17:13
|
Hi All,
What is the point to hexidecima and octal integers?
I'm currently reading a book on Javascript and there's a section explaining variables. One thing it goes into is hexidecimal and octal integers. I can't wrap me head around it and I'm not inclined to try.
Does anyone actually use this stuff in day to day web development or is this some throwback to the "good old days" of programming?
|
Ken =============== Worldwide Partner Group Microsoft |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 08 October 2003 : 10:46:07
|
Hex is definitely used regularly by programmers. Octal is used less often, but if you have linux server and chmod 755 somefile you just used an octal number.
The reason hex and octal are commonly used in code is because they are human-understandable representations of binary numbers. 0xc4 is much easier on the eyes than 11000100. And since digital computers still exclusively use binary math hex and octal will be used for a long time.
In a lot of places even for a user hex can be more understandable than decimal imho. Color values are one example, rgb colors represented as 3 pairs of hex numbers is much easier on the mind than the decimal equivalent (for an example of the decimal equivalent look at the color properties in a Microsoft Access form control). If you have a hex color value of #dcdcdc it's easy to understand the first dc is the red value, the 2nd is the green value, and the last is the blue value.
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
D3mon
Senior Member
   
United Kingdom
1685 Posts |
Posted - 08 October 2003 : 10:59:10
|
I use Hex values for web colors all the time.
In CSS, colors are usually defined in 3 Hex. values - Red, Blue and Green each one representing a number from 0-254. The benefit of using Hex here is that the resulting definition is only six characters instead of 9:
White = (max)Red, (max)Green and (max)Blue
To represent that in Decimal would be: 254 254 254 in Hex: ff ff ff
Oddly enough, I find it more difficult to work with RGB color values than Hex now - e.g. it is much easier to tell if a color is websafe in Hex than in RGB.
|
 Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod "In war, the victorious strategist only seeks battle after the victory has been won" |
 |
|
seahorse
Senior Member
   
USA
1075 Posts |
Posted - 08 October 2003 : 22:09:22
|
I've always used a color picker. Is there any other place for hex numbers in everyday web development aside from colors? I knew that FFFFFF was white, but never really cared if it was hex or not. I just memorized it.
Assuming I ever build up the necessary skills, I don't think I'd ever develop anything more complex than Snitz. Would I ever need hex for that?
I guess I look at it from a different perspective. I'm basically an ASP hobbist. If I can use a tool, like a color picker, to free myself from any "non-essential" learning and get the job done, I'll do that. If that's lazy coding, then I'm a lazy coder. 
|
Ken =============== Worldwide Partner Group Microsoft |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 08 October 2003 : 23:44:58
|
You won't need to know hex or octal for most asp coding. However, if you want to have an understanding of computers and how they work you should make the effort to understand these different number bases and how to use numbers in a base other than base 10. It's enlightening, and you'll enjoy dayve's (and others who use it) sigs: "there are 10 kinds of people. Those who understand binary and those who don't" 
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
D3mon
Senior Member
   
United Kingdom
1685 Posts |
|
Nikkol
Forum Moderator
    
USA
6907 Posts |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
|
D3mon
Senior Member
   
United Kingdom
1685 Posts |
|
silent_frosty
Junior Member
 
USA
178 Posts |
Posted - 21 October 2003 : 11:19:59
|
Whoo Hoo, now I can count in binary, thanks D3mon. Lol, I agree with Brad, #4 is great! |
Life is a waste of time. Time is a waste of life. So get wasted all of the time and have the time of your life. |
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 21 October 2003 : 11:32:18
|
There are 10 types of people, those who understand binary, and those who do not... |
|
 |
|
silent_frosty
Junior Member
 
USA
178 Posts |
Posted - 21 October 2003 : 16:39:55
|
quote: Originally posted by dayve
There are 10 types of people, those who understand binary, and those who do not...
I never really got that until now  |
Life is a waste of time. Time is a waste of life. So get wasted all of the time and have the time of your life. |
 |
|
|
Topic  |
|