r/ProgrammerHumor • • Oct 19 '26

Meme ohTheBasics

Post image
13k Upvotes

1.4k comments sorted by

View all comments

Show parent comment

66

u/blindedtrickster Oct 19 '26

The easy way to tell them apart is that IPv4 only uses digits, but IPv6 is in Hexidecimal, so you'll see 0-9 as well as A-F. And just in case you're not familiar with Hex, A is equal to 10, B is equal to 11, and so on, with F ending the sequence at a value of 15.

35

u/blaues_axolotl Oct 19 '26

You could also display IPv4 in hexadecimal, then it's eight digits/letters. It's just not done in practice for whatever reason.

2

u/hauthorn Oct 20 '26

I think there is some research done on number sequences that humans can remember. We are used to phone numbers, and v4 isnt much longer usually.

No-one is trained to remember hexadecimal.

But im not going to bother finding the source, its in my old interaction design book somewhere.

38

u/jaerie Oct 19 '26

You're talking about IP addresses. The Internet Protocol is bigger than just the address spec.

0

u/blindedtrickster Oct 19 '26

Context and scope, my friend. Context and scope.

2

u/jaerie Oct 20 '26

I'm not sure what you're trying to say. I'd be pretty disappointed if that question was part of the interview (meaning the job has something do with it) and my interviewee only talked about addresses

1

u/blindedtrickster Oct 20 '26

That's rather my point. The context of the situation changes the expectation. If it's a Junior level Help Desk position, it'd be contextually strange if the questions involved something like the IANA.

I'm not trying to directly say you're wrong. What I'm trying to say is that I believe it's probable that, based on the context, it wasn't speaking about something at a high level and seemed much more likely to be pointing out that a software engineer didn't even understand something as basic as the differences between IP schemas.

7

u/Jeferson9 Oct 19 '26

I mean I know that one has more characters. But does that really pass as an answer to that question

4

u/FUTURE10S Oct 19 '26

IPv4 is 0 through FF, IPv6 is 0 through FFFF. So you have 4 bytes of data, we just use numbers for some reason. We can do the same with ipv6, I think we should be.

1

u/blindedtrickster Oct 19 '26

Yes, it has the same equivalent value. FF is equivalent to 255.

I'm not sure I see a benefit to retrofitting IPv4 to Hex though. Care to expound?

2

u/FUTURE10S Oct 19 '26

I don't think there's a benefit to retrofitting IPv4 to hex, I think there's more of a benefit to change IPv6 from hex to decimal numbers

1

u/blindedtrickster Oct 19 '26

That'd be 16 octets long... And that's preferable?

2

u/FUTURE10S Oct 20 '26

Well, no, I mean something like 2001:0db8:85a3:0000:0000:8a2e:0370:7334 becomes 8193:3512:34211:0:0:35374:880:29492

1

u/blindedtrickster Oct 20 '26

That's really just a formatting change, and it only works for a subset of all possible values when using Hex.

1

u/FUTURE10S Oct 20 '26

I mean, we do one for IPv4 and the other for IPv6, why? Why can't we just use one for both?

1

u/Dagger0 Oct 20 '26

You can indeed do that!

$ ping 0xc0.0xa8.0x1.0x1
PING 0xc0.0xa8.0x1.0x1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=62 time=3.12 ms

1

u/Burroflexosecso Oct 19 '26

And yeah meta has already reserved a bunch of -faceb00c- number space