SeniorSide Flashcards
What are the three great virtues of a programmer?
Laziness, Impatience, Hubris
Name at least one use case for each of the commands listed in this exercise.
Cat- print contents of something
Ls- see the contents of current directory
Pwd- see the path of where you are
Echo- command line version of console.log
Touch- if touch a file that doesn’t exist then it gets created. Otherwise, its access time gets updated to right now
Mkdir- make new directory
Mv- renaming files or moving files
Rm- deleting or remove files, but if directory then use -r
Cp- copy a file
What is a GUI?
“gooey” graphical user interface. Ex. Finder in mac is a GUI for manipulating file system or file explorer in windows
What is a CLI?
Command line interface
What is Array.prototype.filter useful for?
creates a new array while excluding certain items
What is Array.prototype.map useful for?
creates a new array with transformed array elements
What is Array.prototype.reduce useful for?
combines the items of array into a single thing
What is Node.js?
A program that allows Javascript to be run outside of a web browser
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What is a REPL?
A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple, interactive computer programming environment that takes single user inputs (i.e., single expressions), evaluates (executes) them, and returns the result to the user; a program written in a REPL environment is executed piecewise.
When was Node.js created?
2009
What back end languages have you heard of?
node.js, Python, PHP, Ruby
What is a computer process?
a process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.[1][2]
While a computer program is a passive collection of instructions, a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often results in more than one process being executed.
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
a lot, about 470 when i checked
Why should a full stack Web developer know that computer processes exist?
Because their job is to make processes talk to each other and computer applications are made of multiple processes
You will create a client (browser application) and own server on same computer
What is the process object in a Node.js program?
Process object is global (accessible everywhere without declaring it) and provides information about, and control over, the current Node.js process
How do you access the process object in a Node.js program?
use the process keyword
What is the data type of process.argv in Node.js?
array of strings
What is the JavaScript Event Loop?
Tool for observing when call stack is empty so it can move item from task queue to call stack (JavaScript has a concurrency model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks. This model is quite different from models in other languages like C and Java.
What is different between “blocking” and “non-blocking” with respect to how code is executed?
Blocking is when the execution of additional JavaScript in the Node.js process must wait until a non-JavaScript operation completes. This happens because the event loop is unable to continue running JavaScript while a blocking operation is occurring.
Blocking methods execute synchronously and non-blocking methods execute asynchronously.
Blocking code is code executing on the call stack right now and non-blocking is code on the callback queue
What is a JavaScript module?
a javascript file
What values are passed into a Node.js module’s local scope?
exports, require, module, __filename, __dirname
Give two examples of truly global variables in a Node.js program.
process, clearInterval
What is the purpose of module.exports in a Node.js module?
to provide functionality to other modules