Defleurville
Defleurville t1_iy3uvx0 wrote
Reply to comment by Kientha in eli5 How is computer memory deleted? by unlikemike123
Another precision for other readers, which I assume Kientha knows, is that when speaking of computers, “randomly” never means randomly, as computers are incapable of doing anything at random (even electronic slot machines aren’t random).
In some cases, in means “not in sequential order”: We don’t continue reading a dictionary from where we stopped last time, but we do go in looking for a specific word, not pop it open and read whatever’s on the page. In computer terms, despite not being at all random, this is called “random access”.
In other cases, it means “made to appear random to a human”. Computers can easily generate values where users can’t tell what it will pick next, but under identical circumstances (the “seed”) it will pick the same values in the same order every time. We generally “cheat” by incorporating the time (down to the millisecond) into generating the numbers, so it’s mostly unpredictable.
Changes in Flash data aren’t random, they’re 100% deterministic and predictable (knowing all the info): they’re just not readily predictable to a user, which is functionally basically the same.
Defleurville t1_iy3lxmr wrote
Reply to comment by unlikemike123 in eli5 How is computer memory deleted? by unlikemike123
Just to clear up any confusion, the word memory is often used in confusing ways. Expensive working memory (RAM) is used to do stuff (like a kitchen counter), whereas cheaper storage memory (SSD, HDD) is used to keep stuff (like kitchen cabinets).
Current computers have working memory in the 16GB to 128GB range and storage memory in the hundreds to thousand of gigabytes (known as terabytes)
Phones and tablets (and video game consoles) all have working memory, but the numbers are basically unadvertised (~up to 4 GB). Their storage memory is widely advertised, but is often in the same 16-128GB range as a computer’s working memory, which adds to the confusion.
While technically these are all “memory”, when we speak of a computer’s memory, we usually mean working memory (RAM) — not the one freed up by deleting files. But when we speak of a phone’s memory, we usually mean storage memory (SSD)
Defleurville t1_iy3k9vj wrote
Reply to comment by unlikemike123 in eli5 How is computer memory deleted? by unlikemike123
Note that different types of storage handle things slightly differently.
Magnetic storage (HDD, floppies) cannot delete files, it can only overwrite them, so the space will never stand empty.
Flash storage (SSD or a memory stick) will actually delete the file (or parts of the file) at some point (but you won’t know when) and may leave space empty for a while.
Re-writable optical storage (DVD-R) will basically wipe disc contents when you erase it (but is really bad at deleting individual files).
RAM (there are some circumstances where you can delete a file from RAM, such as when using a RAM disk) will retain the file “inaccessibly” until it is either overwritten or the RAM loses power, which causes it to lose all contents.
Note that in every case, “inaccessible” just means harder to access. If the data is there, there are ways of reading it.
Defleurville t1_iybba9x wrote
Reply to ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
Structured programming code can generally be read from any position, in either direction: If you find a train car on a track, you can check what it went through before by following the track towards where it came from.
A Goto works closer to a Starfleet transporter: When you find a train car on the track, it might just have teleported in there from wherever. If there are traces of an ambush a mile up the track, you have no idea if that train car went through it.
Goto is a tool which often allows you to do something easily instead of doing it right.
For example, maybe Goto would make your program work now, but it will make it harder to resolve bugs and if there are later changes they could be much harder to implement.