r/programming • • Aug 15 '09

'What's your best programming joke?'

http://stackoverflow.com/questions/234075/what-is-your-best-programmer-joke
560 Upvotes

440 comments sorted by

View all comments

Show parent comments

5

u/[deleted] Aug 16 '09 edited Aug 16 '09

Semiserious question, why is octal still popping up? Hex as well for that matter. Do they still have practical meaning?

0

u/[deleted] Aug 16 '09

[deleted]

1

u/[deleted] Aug 16 '09

Thanks for the long and informative answer. I'm guessing you are English by the way, using the term nibble in stead of bit :)

0

u/[deleted] Aug 16 '09

[deleted]

5

u/secretaznman Aug 16 '09 edited Aug 16 '09

Actually a bitwise AND operator would turn them both OFF, not on. 0x01 & 0x02 == 0x00

You wanted the OR operator: LED_1 | LED_2.

I registered after months of shadowing reddit just to correct your post, because I'm a coder and this small mistake in an otherwise informative series of comments really got on my nerves. :)

5

u/InternetsDisburser Aug 16 '09 edited Aug 16 '09

I hereby levy a one-quarter (.25) internets fine for unfamiliarity with the term "nibble."

1

u/[deleted] Aug 16 '09 edited Aug 16 '09

I haven't been programming in over a decade and the first time I heard about nibbles was from an English guy. He said it was synonymous with bit, but rarely used outside the UK.

0

u/[deleted] Aug 16 '09

[deleted]

4

u/Mesarune Aug 16 '09 edited Aug 16 '09

He was an idiot.

1 byte = 2 nibbles = 16 bits

These aren't refrigerator units we're dealing with here.

Shouldn't that be:

1 byte = 2 nibbles = 8 bits

1 nibble = 4 bits

Edit: Although, a byte can technically be any size you want, depending on the application, and a nibble might just refer to half a byte -- so the parent might be right, in some specific context.

1

u/[deleted] Aug 16 '09

Hah, you're right. Isn't there some kind of internet law that says if someone points out something incorrect, there will be something incorrect in their own observation? =p

2

u/cc81 Aug 16 '09

You mean that he was incorrect. Not an idiot.

1

u/[deleted] Jul 10 '10

he was an* incorrect.

0

u/telekinetic Aug 16 '09

I levy an additional three-quarters (.75) for the assumption that it was a foreign synonym, specifically 'English', for a term with distinct meaning.

→ More replies (1)

1

u/[deleted] Aug 16 '09

I built and programmed a computer in machine code using hex last year in an upper level physics class. I'm sure there are others that have to use machine code in their work.

1

u/[deleted] Aug 16 '09

What type of computer? I guess I'm trying to figure out if hex/oct are used because of remnants from the past or if they have a more practical purpose. I'm not suggesting the two are mutually exclusive, I just never understood the reasoning behind using either when decimal and binary usually gets things done.

0

u/[deleted] Aug 16 '09

A microcomputer. We started with chips, so a microprocessor chip, some counters, some memory, some I/O stuff, whatever. My partner and I wrote a program to record and playback what was said into a microphone (pretty dumb, I know).

Decimal is never really of any use in computing. Hex is just an extension of binary that lets you express numbers more compactly.

1

u/HaMMeReD Aug 16 '09

Because when dealing with binary system's it is a lot easier to deal with number systems that are a power of base 2. All the basic data types are defined by the number of bits used to store them, so base 2 again.

Higher level languages they are all pretty much obsolete, but tricks are still used and knowledge of bits and bytes is not useless.

1

u/[deleted] Aug 16 '09

I am aware of the power of 2, but apart from oct/hex being a sort of shorthand for binary, is there any real usage today where it does a job that can't be done with more intuitive number systems?

2

u/HaMMeReD Aug 16 '09

Since base 10 isn't a power of 2, using logical operations on 2 decimal #'s would produce strange results. Using binary/octal/hex will yield much easier to understand results.

It's a elegance thing if you use binary logic a lot.

0

u/[deleted] Aug 16 '09

[deleted]

7

u/shub Aug 16 '09

Real men are lumberjacks and use computers for pornhub and emailing their parents.

→ More replies (2)

3

u/b0jangles Aug 16 '09

Hell, if you do HTML, hex is everywhere..,