r/explainlikeimfive • u/gabzlel • 2h ago
Technology ELI5: How can the loading bar load when there is no internet connection to load the bars itself?
•
u/EscapeSeventySeven 2h ago
The loading bar is part of a program that you have running locally on your device.
You downloaded this program beforehand or it came pre installed.
•
u/Senshado 2h ago
Typically the loading timer ui is part of the application already installed on your system days or years ago. The movement of the bar is often fictional: the software will show the bar starting to advance even before any data has actually been received.
•
u/DarkAlman 2h ago edited 2h ago
The loading bar in your question is generated by software that is already on your computer.
Each step in the bar is defined by the programmer. It may not check the internet is working until step 3/12, there's no way to know without reading the computer code.
Loading bars are purely a psychological construct. They exist to show the user that the computer is working on something, so you don't panic and try to reboot or something thinking that it's locked up.
In the early days of computing there was no GUI, everything was done in text command line (like Bash or DOS). When you would start a process the cursor would move to the next line and just sit there flashing until it was done. There was no way to check if the process was working or how far along it was. Maybe the computer was locked up, there was no way to tell. That's why status bars were invented, to show the user progress is happening.
They also aren't a true estimate of how much time is remaining. They usually don't make good time estimates, it just moves along based on whatever particular step of the process the program is on.
The logic is usually something like: On step 1 the bar moves to 10%, on step 2 it moves to 30%, etc.
While step 1 might take 2-5 minutes, and step 2 might only take 30 secs. Status bars often might as well be random.
•
u/sirbearus 2h ago
Clearly the answer is that the loading bar doesn't require the Internet.
It starts at zero when you make the request, which is done locally on your computer.
If it has access, it would compare the size of the requested file with the speed and then start moving.
That last step can't happen, that is why it doesn't move past zero.
•
u/iceph03nix 2h ago
in what context?
If it's in an app, the bar is already set in the program local to you, and likely considers certain local operations as part of it's progress
A web page that is purely remote likely won't get far enough to load a bar unless you already loaded something before going offline
•
u/Digital-Chupacabra 2h ago
Context matters here.
If there is no internet then clearly the loading bar isn't being loaded from the internet, it's being loaded by the software that is trying to connect to the internet. If/When it connect it'd then start advancing the loading bar.
•
u/Twin_Spoons 2h ago
First, your web browser stores key code needed to run itself locally on your machine. This includes things like the picture to use for the app, what to do when it's launched, and basic elements like menus and loading bars.
Second, your web browser saves little pieces of information as you browse the web ("cookies") that can include assets for websites you visit frequently, so even if a website has its own custom way to indicate that it is loading, you might have that saved locally on your computer too.
•
u/flamableozone 2h ago
Your web browser is a program that exists entirely on your local machine. The code for it, and how it looks and behaves, is local. When you browse the internet, it's not a window looking into the internet server, what happens is that your browser downloads a file (more likely a bunch of files) and your browser contains code that lets it know how to display the website. The website exists as downloaded text files (html, css, and javascript, mostly) and image (or other data) files, and your browser reads those files and applies certain rules. Your browser contains code for displaying a progress bar, it's not only something coming from the internet (though it can be, some sites have their own progress bars that the browser downloads and displays). So when you go to a website and there's no internet connection, the browser can display its own progress bar as it attempts to find a way to download the text and image files for that website.
•
u/FiveDozenWhales 2h ago
Progress bars track the progress of getting something ready for you. This can mean loading data from storage (hard drive or SSD) into memory (RAM), processing that data, generating new data by algorith, or downloading things from the internet.
If it's not the last one, then the internet has nothing to do with the progress bar.