lab_server/notes.md

2.9 KiB

Project Server Notes

Checkpoint 1

  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?

    Some advantages of using a program with a remote server is that it allows for the collaboration of multiple people, and it also does not require a download onto your computer.

    The advantages of a local program is that it can be used offline. Additionally, since you are not communicating over the internet, your data is safer and does not necessarily require encryption.

  2. 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?

    It may be useful to run a server on your computer where you're the only client on the same computer when developing and debugging a web-based application as a software developer. This can also be used for entertainment purposes. You can host a server with movies on it and access that server as a client on the same computer in order to watch those movies.

Checkpoint 2

  1. 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.

    One program that I use frequently is Instagram. I assume that there are routes for creating posts (which would have arguments for the picture and the caption), adding comments (which would have the arguments for which post you are commenting on and the contents of the comment), following users (which would have an argument for the username of the user), and searching for specific users (which would also have an argument for the name of the user).

  2. 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 something that would crash your program. It can be helpful to handle an exception when it is something you expect could happen and know how to handle. For example, if the program is expecting the user to provide a numerical response, and the user inputs a string of letters instead, you would not want the entire program to crash. Instead, this exception can be handled and the user can be prompted that their response must be numerical. It is better not to handle an exception if you do not know how to handle it. For example, if something within the computer itself malfunctions, it is better to let the program crash.