Getting the hang of it class 12

Ramon Cruz-Hinojosa
3 min readAug 6, 2021
  • What’s the difference between operational and programmer errors?

Operational errors are errors that happen with code that is written correctly, so something like failing to connect to a database. The error can lie elsewhere outside of our programs.

Programmer errors are problems that the developer themselves caused by either having a typo in their code or having code that just doesn’t work. A bad example could be if the developer is trying to pass a string where an object is expected. These issues can always be solved by changing some lines of code.

  • What is ‘event-driven’ programming?

Event-driven programming is a programming paradigm in which the flow of program execution is determined by events — for example a user action such as a mouse click, key press, or a message from the operating system or another program.

In an event-driven application, there is generally a main loop that listens for events and then triggers a callback function when one of those events is detected.

  • What are ‘worker processes’?

Worker processes are windows processes that are responsible for handling requests sent to a web server for a specific application pool.

  • Describe how Node.js can be made more scalable.

To make node more scalable load balancing would have to be used. Load balancing is separating the workload of the many processes between different resources that can handle the work independently.

  • Explain global installation of dependencies.

Global installation of dependencies is when you use the -g flag when installing packages through node. When you install packages this way they are always sent to the same place, which depends on your setup, regardless of where you npm installed them.

  • Explain RESTful Web Service.

A restful web service is one that follows the rules and patterns set by REST. REST stands for representational state transfer and the guiding principles of rest are -

Client server — This is just separating the user interface from the database end to keep things clean and easier to work on.

Stateless — All requests from client to server are done without stored context. This just means every time we make requests from client to server we have to include all of the information involved because the server will not hold onto any information otherwise. This is done to keep the sessions state entirely on the client side and to not give the server more work.

Cacheable — Cache constraints require that the data within a response to a request be implicitly or explicitly labeled as cacheable or non-cacheable. If a response is cacheable, then a client cache is given the right to reuse that response data for later, equivalent requests.

Uniform interface — By applying the software engineering principle of generality to the component interface, the overall system architecture is simplified and the visibility of interactions is improved. In order to obtain a uniform interface, multiple architectural constraints are needed to guide the behavior of components. REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, hypermedia as the engine of application state.

Layered system — The layered system style allows an architecture to be composed of hierarchical layers by constraining component behavior such that each component cannot “see” beyond the immediate layer with which they are interacting.

Code on demand (optional) — REST allows client functionality to be extended by downloading and executing code in the form of applets or scripts. This simplifies clients by reducing the number of features required to be pre-implemented.

--

--