3.2 KiB
Project Server Notes
Checkpoint 1
- Lots of software today connects to remote servers, and can't work offline. What are some advantages of using a program or an app which uses a remote server? What are some advantages of using a program or an app which is completely local?
I imagine that a remote server would allow for people to communicate with more robust/high powered servers from the comfort of their own low powered devices. Like the way we can access LMMs like ChatGPT from our laptops, but the actual servers for those things are HUGE. However a local program/app would be more reliable since you don't have to worry about being online or not. It would also protect against people intercepting the signals from server to device for nefarious reasons, because it's all happening locally.
- You just ran a server on your own computer, and connected to it as a client on the same computer. In what other situations might it be useful to run a server on your computer, where you're the only client, on the same computer?
Maybe if you wanted to create a more user-friendly (or more aesthetically pleasing maybe) interface. This way you are seeing the polished version of the work and don't have to get tangled in the metaphorical "weeds."
Checkpoint 2
- Choose a program (Steam), web app (Google Docs), or app (Weather) that you use frequently. You can't observe the calls this program is making to its server (unless you have fancy tools), but you can infer some of the calls based on the program's behavior. Describe a few routes which you think may exist for your chosen program's backend server.
A site I use frequently is Google Docs. I imagine that a route it has would have something to do with saving your work. This is probably on a timer or happens manually when you hit the save button, and then it recieves the input you've written in the file and saves it as a data structure somewhere in your cloud. Similarly, there must be a route that happens when you search within your Google Docs home for the doc you want to work on and it returns the best fit based on the title of the file that you put in the search bar.
- In your own words, what is an exception? When might it be useful to handle an exception? When is it better not to handle an exception, and instead let the program crash?
An exception is when there is an error from the user (input) of the program/request and not an error on behalf of the program (hence why the examples are all 400 errors and not 500 errors.) I think a good time to handle an exception would be when there is a common user error that you can anticipate and you have a specific way you want it to be addressed. For example, a common error would be to not include all the necessary parameters for a request, and instead of crashing the program, the computer could use a default for those parameters. However, sometimes it may be difficult to come up with a good alternative when an error occurs, like in the instance where you put in a riddle ID that doesn't exist. You wouldn't want the program to just return a random riddle or use some default, you would want the program to stop and tell the user that there is an error.