667
you are viewing a single comment's thread
view the rest of the comments
[-] supersquirrel@lemmy.ca 16 points 4 days ago

Side note, why the hell did programmers make this as the home ip? Why couldn't it have been something intuitive that said to normal people "home" in some way?

I will never not be grumpy about this, it is such a trivial, random choice that only makes sense once you understand everything about it already.

[-] wheezy@lemmy.ml 72 points 4 days ago* (last edited 4 days ago)

Most satisfying answer I could find.

The designers of the Internet really knew how the hardware worked, and they designed with low level implementation in mind.

The values 0, 127 and 255 are special in 8 bit assembly and machine language programming because there are "tricks" you can use to test for these values and branch to different code using smaller instructions that execute faster than for other integers. 127 is the highest signed 8 bit integer, so incrementing it by 1 will cause a signed overflow. Similarly, incrementing 255 will cause unsigned overflow. Merely loading the value 0 into a register will usually set a zero flag on the chip. Imagine the networking program looks like this in pseudocode:

if (value == 0) doLocal();

if (value == 127) doLoopback();

if (value == 255) doNetwork();

Although it depends on the chip, in those days most chips could encode these tests with 2 words, 3 words and 3 words respectively (total 8 words) and further those particular tests were all likely to execute in 1 clock cycle each. Using any other value would probably require 4 words each (total 12 words), a 50% increase in code size and likely a 50% increase in execution time as well.

https://superuser.com/questions/31824/why-is-localhost-ip-127-0-0-1

[-] artwork@lemmy.world 25 points 4 days ago* (last edited 4 days ago)

Thank you... Thank you heartfelt... for not referencing/using sorrowful empty LLM for it, but referencing an actually accountable answer with an author to appreciate and learn from, with a direct link to the source.

I upvoted the answers I found supportive, the question, read more to recall it all again, and bookmarked.

[-] wheezy@lemmy.ml 10 points 4 days ago

Thanks. It's hard to find good answers anymore but a good "before:2022" still helps a bit in Google. And removing the AI overview.

[-] lord_ryvan@ttrpg.network 0 points 3 days ago

before:n is something I still sorely miss from DuckDuckGo

[-] wheezy@lemmy.ml 1 points 3 days ago
[-] lord_ryvan@ttrpg.network 0 points 3 days ago

DuckDuckGo search result for "gta 6 before:2023"

The first two results are news articles published after 2023, so no it looks like it still doesn't work in DDG, to my demise

[-] wheezy@lemmy.ml 1 points 2 days ago

I wonder if it's because the webpage has been updated. It's likely showing its last publish date on Google based on some metric of change the use.

So, it could be going off it's original publish date was prior to 2022. Google has similar issues.

"before:n" is most useful for avoiding AI images. Because I think it is using the image specifically to determine the date.

[-] folekaule@lemmy.world 14 points 4 days ago

Excellent explanation. Just came here to add more context: This was before CIDR routing when networks were classful. Localhost is in the class A network range and was reserved in 1981 for loopback use in IPv4. In 1981 processors were much, much slower than today and every cycle counted. If you look at bit patterns for the various networks and netmasks, it will all start to make more sense.

IPv6 Always had ::1 for loopback.

[-] Taldan@lemmy.world 1 points 3 days ago* (last edited 3 days ago)

Specifically, all loopback addresses will begin with 0111 1111

Any time a computer reads an address beginning with those 8 digits, it can already determine it's a loopback address without reading the other 24 digits (keep in mind, computers read IP addresses in binary)

Why they decided to use an entire /8 CIDR block, I'll never know. It is an absurd number of addresses to allocate out for localhost

[-] KaninchenSpeed@lemmy.blahaj.zone 26 points 4 days ago* (last edited 4 days ago)

its not only this ip. In ipv4 the whole 127.0.0.0/8 subnet is the current computer / localhost, so every 127.x.x.x points to localhost (i know its a bit silly, but so is a lot of legacy ip). 127.0.0.1 is just the first address in this subnet that can be used for devices. I would assume 127 was chosen because its the largest 7 bit number so its 01111111 in 8 bit which is easy to detect in hardware.

In ipv6 its much more sensible, only ::1 is localhost.

Sorry for wasting your time (but please use ipv6 anyways >:3)

[-] Taldan@lemmy.world 2 points 3 days ago

The fact 127.80085 is an RFC compliant loopback address will never not be funny to me

[-] MonkderVierte@lemmy.zip 4 points 4 days ago* (last edited 3 days ago)

i know its a bit silly, but so is a lot of legacy ip

The /usr thing? The Unix guys disk was full. The dotfiles thing? A bug in the ~~Unix file system~~ ls. And so on and so on. 1/3 of IT is just things someone decided on a whim. Another 1/3 is for obsolete reasons.

[-] bus_factor@lemmy.world 3 points 4 days ago* (last edited 3 days ago)

The .files thing wasn't a bug in the file system, file systems don't care about the file names. The code was in ls. They were trying to ignore '.' and '..' when listing directories, and did so by checking if the first character was a dot. Fairly quickly someone decided to leverage that to hide files.

[-] supersquirrel@lemmy.ca 4 points 4 days ago* (last edited 4 days ago)

I super appreciate the explanation and I figured that it makes sense when you look at the context... but still did this really have to be the home ip? I can never remember the sequence of numbers, I know it is only a handful of them but it is just so damn unintuitive that I almost always have to look it up because my memory recall is trash... and I don't think I should have to it should be so obvious that anybody can remember it.

Even if this "had" to be the home ip grammar... couldn't they have at least created a commonly accepted shortcut/alternate name you could type in that normal people could remember?

[-] Starchildjohn@leminal.space 16 points 4 days ago* (last edited 4 days ago)

Easy, just remember 01111111 and convert back when you need it ๐Ÿ™ƒ

For real tho just use ipv6 ::1 or localhost if you can't remember

[-] MnemonicBump@lemmy.dbzer0.com 9 points 4 days ago

You can usually just type localhost://

[-] truthfultemporarily@feddit.org 2 points 4 days ago

I'm curious, what IPv4 address space reads like "home"?

[-] supersquirrel@lemmy.ca -2 points 4 days ago

An easy to remember pattern of any kind would have been better, a repeating sequence like 1010101 or 1234567 or something else that doesn't feel completely and utterly arbitrary (almost to the point of condescension to normal non-techy users in my opinion).

[-] SparroHawc@piefed.world 4 points 4 days ago

127 is the highest number you can fit in 7 bits of binary. It's a lot easier to remember if you know your powers of 2.

One bit can hold the numbers 0 and 1.
Two bits can hold 0 through 3.
Three bits can hold 0 through 7. Et cetera. These numbers were far more important to remember when everyone who did programming had to do low-level programming to get any sort of performance out of their code.

[-] metallic_z3r0@infosec.pub 2 points 3 days ago

Ah, but if it's an 8-bit signed number, then 01111111 is actually "-1". This is a lot more fun.

[-] SparroHawc@piefed.world 1 points 3 days ago

But... but then you're mixing signed and unsigned numbers in the same address! Panic! Human sacrifice! Dogs and cats living together! MASS HYSTERIA!!

this post was submitted on 24 Nov 2026
667 points (96.8% liked)

Programmer Humor

34316 readers
1496 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS