Why is it often the case that when a problem occurs with a PC, it is resolved by 'restarting'?
When a problem occurs with your PC, many people try the solution of ``trying to restart it.'' And often, just a reboot can solve the problem. Nolan Lawson, an engineer at Salesforce, has summarized his thoughts on why restarting the PC solves the problem in a blog.
Programmers are bad at managing state | Read the Tea Leaves
Mr. Lawson simply stated that the reason for resolving the issue by restarting was that ``programmers are not good at managing state.'' When a program is written and started for the first time, all variables are as intended by the programmer, and through automated testing etc., the program is in the 'purest and most perfect state'.
However, after starting a program, the user not only clicks something or writes characters in an input field, but also, if it is a web application, presses the browser's back/forward button or refresh button, or after leaving it for several weeks. Start and perform various operations. These operations can cause the program to end up in a state different from what the original programmer intended, resulting in errors, crashes, and freezes.
The operation of ``turning off the power once and turning it on again'' is said to be highly effective by resetting the state of the program and returning it to the original programmer's intention.
In fact, when Mr. Lawson's wife tried to start Steam for the first time in several years, it did not start properly, and even when she tried reinstalling it, it failed to load. However, it is stated that by deleting the folder ``~/Library/Application Support/SteamSteam'' where Steam data is saved and resetting the status, they were able to get it to work properly.
Also, when a problem occurred where the web app would freeze while loading no matter how many times it was reloaded, it was resolved by ``clearing site data'' in the ``Applications'' tab of Chrome DevTools.
Furthermore, there is also an example where the problem of not being able to print on a MacBook after updating macOS was resolved by uninstalling the old printer software.
In addition, when you start Firefox for the first time in a while, a message appears saying, ``It's been a while! It looks like Firefox hasn't been used in a while. Would you like to clean your profile and make it look like new?'' Lawson said. Said it was 'a great way to drive users to Firefox.' The difference in perceived speed between browsers is more influenced by extensions, settings, history, cache, etc. than by actual differences in ability, so refreshing Firefox will reset these conditions and allow you to experience the original speed of Firefox. That's why there is. This is the same reason why new PCs and smartphones seem to operate surprisingly smoothly.
Lawson said, ``Software is complex, and it is impossible to predict all the states a program may be in.'' 'It would be great to have some sort of escape hatch,' he said, emphasizing the importance of having a means of resetting.
Related Posts:
in Software, Posted by log1d_ts