generated from mwc/lab_server
I answered the Checkpoint 1 and 2 questions.
This commit is contained in:
parent
1e4a41f065
commit
ab63f9185d
32
notes.md
32
notes.md
|
@ -7,12 +7,26 @@
|
||||||
server? What are some advantages of using a program or an app which is
|
server? What are some advantages of using a program or an app which is
|
||||||
completely local?
|
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
|
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
|
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?
|
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
|
## Checkpoint 2
|
||||||
|
@ -23,10 +37,28 @@
|
||||||
program's behavior. Describe a few routes which you think may exist for your
|
program's behavior. Describe a few routes which you think may exist for your
|
||||||
chosen program's backend server.
|
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).
|
||||||
|
|
||||||
|
|
||||||
4. In your own words, what is an exception? When might it be useful to handle an
|
4. 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
|
exception? When is it better not to handle an exception, and instead let the
|
||||||
program crash?
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue