foundations summary
- notes/the-odin-project/foundations/internet-infrastructure
- Client and server, packets.
- Web page -> Website -> Web Server
- IP Address -> Router -> ISP
- Domain Name Servers
- TCP and UDP
- Virtual Machines
- Programming in general
Problem Solving (most important concept)
- Divide and conquer approach
- How to ask good questions
- Pseudocode
Compiler
- Lexical analyzer
Tokens and lexemes
- Reserved words, Operators, Identifiers, Constants, Separators
- Example:
1 2 3 4 5 6 7 8 9 10 11
newvalue = oldvalue + rate * 60 --[[ Token Lexeme Identifier newvalue assignOperation = Identifier oldvalue addOperation + identifier rate mulOperation * number 6 ]]
- Lexical analyzer
Literals
Variables
- Declaration and assignment
- Data types
- Enumeration (enum)
- Primitive
- Boolean
(which is stored as 1 byte instead of 1 bit)
- Falsy and truthy values
- Integer
- 2
bytes
- short, int16
- unsigned short, uint16
- 4 bytes
- signed integer, int32
- unsigned integer, uint32
- float
- 8 bytes
- double
- 2
bytes
- Char and String
- String manipulation
- String concatenation
('a'+'b')
- String interpolation
('${a} {b}')
- Escaping
(/)
- Boolean
(which is stored as 1 byte instead of 1 bit)
- Composite
- Object
{}
- Array
[]
- Object
Operators
- Logical
AND
(and, &&, ∧, ·, &),OR
(or, ∥, ||, ∨, +),NOT
(not,¬, ~, !),XOR
(exclusive or, ↮, ⊕, ⊻, ≢. Either x or y is true, and not both true),NAND
(not and, ⊼, !(x && y)),NOR
(not or, ⊽, !(x || y))
- Comparison
>
(greater than),<
(lesser than),>=
(greater or equal than),<=
(lesser or equal than),==
(equals),!=
(not equals)
- Ternary operator:
(condition) ? IfTrue : IfFalse
- Logical
Functions
- Invocation, calls.
functionName()
- Arguments and parameters
function foo(parameters){}; foo(arguments)
- Recursion `function bar(){ if (condition) return; bar()}
- Nesting
function f(g())
- Coroutines
- Scope. Environment.
- Stack trace
- Varargs
(...)
- Invocation, calls.
Passing data
- Pass by value: passing the data itself.
- Pass by reference: pass the variable that references the data.
- Pass by share: pass the reference itself, sharing the memory location the variable uses (this is the way JavaScript handles assignments and function parameters).
Language Paradigms
- Functional (e.g., Haskell)
- Procedural, Imperative, Event-driven (e.g., JavaScript)
- Event listeners
- Callback functions
- Adding and removing
- Memory leaks
- Garbage collection
- Memory leaks
- Event listeners
- Object-oriented (e.g., Java)
- Classes
- Instance
- Inheritance
- Singleton
- Properties, Methods and Events
- Classes
- Multi-paradigm
Abstraction
- Examples: Analog -> Digital -> Binary -> Hexadecimal -> Assembly -> C -> C++ -> Java -> JavaScript. From standard libraries to custom frameworks. Literals (
1
) to Variables (a := 1
) to Objects (obj := {a: 1}
) to Classes (a = object.New("Class");a:ChangeValue(1)
).
- Examples: Analog -> Digital -> Binary -> Hexadecimal -> Assembly -> C -> C++ -> Java -> JavaScript. From standard libraries to custom frameworks. Literals (
Learning
- Concepts
- Reading documentation
- Asking in communities
- Analyzing other’s code
- Implementing proof of concepts (POCs)
- Strategies
- Active and passive learning
- Focus mode and diffuse mode
- Grit and motivation
- Fixed vs growth mindset
- Avoiding rabbit holes and information overload. Patience.
- Creating analogies, linking to existing ideas, reformulation and recitation.
- [Flow mental state]( https://en.wikipedia.org/wiki/Flow_(psychology)
- Mentoring, helping others.
- Not by showing solutions outright, but by giving direction.
- Concepts
Data structures
- Arrays
- Push and pop
- Lists
- Key and value pairs
- Dictionaries and tables
- Indexing, retrieving, insertion
tableName.keyName, tableName["Key Name"]
- Indexing, retrieving, insertion
- Arrays
Algorithms
- Time Complexity
- Notation
- Big O
O(n) example: for element in list
- Big O
- Notation
- Sorting data
- Binary search
- Loops
for
- Numeric:
for i=start, end, step
- Generic:
for element in list
- Numeric:
while
,repeat
ordo while
- Nesting
for i=start,end,step {for j=start,end,step}
- Flow control
break
(the current loop)continue
(to the next iteration)
- Conditionals
if
else
else if
switch
- Nesting
- Time Complexity
Regular Expressions (Regex)
\[A-Z]\g+
Modules, Libraries, Frameworks
Experience terms: Trainee, Junior (JR), Semi-Senior (SSR), Senior (SR)
Field of development terms
- Front-End
- Graphical User Interfaces (GUI), User Experience (UX), Graphic Design, Interactivity
- Back-End
- Databases, Data Persistence, Schema, Reliability
- DevOps
- Deployment, Connectivity
- GitHub Actions
- Workflows
- Keys
- Secrets
- Tokens
- Full-Stack
- Integrity, Synergy, Compatibility
- Stack Initials
- LAMP (Linux + Apache + MySQL + PHP)
- MERN (MongoDB + Express + React + Node.js)
- MEAN (MongoDB + Express + Angular + Node.js)
- MEVN (MongoDB + Express + Vue + Node.js)
- Front-End
Code style
- Case
camelCase
,PascalCase
- Design patterns
- Creational, structural, behavioral, concurrency
- Don’t Repeat Yourself (DRY) principle
- Refactoring
- Anti-patterns
- Readability
- Cognitive load/strain
- Self-documenting code
- Source code comments
- Case
Integrated Development Environments (IDEs)
- e.g., Visual Studio Code, Eclipse
People
- Alan Turing, George Boole, John von Neumann, Ada Lovelace
- Debugging
- Chrome Developer Tools
- Inspector
- Breakpoints
- Steps
- Console
- Device Mode
print
/console
,error
andwarn
functions- Static analysis programs
- ESLint, semgrep
- Test Driven Development (TDD)
- Tools
- Jest
- Tools
- Chrome Developer Tools
- Markup languages
- HTML (.html)
- Elements and tags
- Markdown (.md)
- Formatting
- Variants, Extensions, Flavors
- GitHub Flavored Markdown (GFM)
- Mermaid
- HTML (.html)
- Style sheet languages
- CSS (.css)
- Selectors (and properties holding values)
- Typography
- Typefaces
- Fonts
- Serif (e.g., Arial)
- Sans-serif (e.g.,Times New Roman)
- Typefaces
- Character encoding
- UTF-8, ASCII, Shift JIS, Unicode
- Specificity
!important > id > class; top to bottom; numbers
- Box Model
- Padding -> Border -> Margin
- Display types
- None
- Block
- Inline
- Flex-box
- Containers and items
- Main and cross axis
- Properties and/or shorthands
flex
,flex-flow
,flex-grow
,flex-shrink
,flex-basis
,flex-direction
,justify-content
,align-items
,align-content
,justify-items
,gap
- Grid
grid-template-columns
,grid-template-rows
,grid-column-gap
,grid-row-gap
,grid-template-areas
,grid-area
- Pseudo-elements
- Pseudo-classes
- Variables
- CSS (.css)
- Application Programming Interfaces (API)
- notes/the-odin-project/foundations/document-object-model (DOM)
- Nodes and node-lists
- Capture and bubbling in events.
- notes/the-odin-project/foundations/document-object-model (DOM)
- JavaScript (.js)
- Variables
var
,let
,const
NaN
,undefined
,null
- Post-fixing and prefixing (++varName, varName++)
- bigInt (for big numbers)
typeof
function
- Operators
- Order of precedence
- Unary (one operand)
+
,!
==
(equal value) and===
(equal value and data type)- Nullish coalescing operator:
??
(and difference from ||, the OR operator)
- Functions
- Anonymous (without name)
- Arrow:
(input) => output
- Loops
- Control Flow
- Labels (they are similar in concept to GOTO)
- Control Flow
- Runtime environments
- Browsers
- Compatibility differences
- Node.js
- Node Version Manager (nvm)
- Node Package Manager (npm)
- Browsers
- Test Driven Development
- Tools
- Jest
- Assertion (do
x
if failed, doy
if successful) - Unit testing
- Tools
- Variables
- Command line interface (CLI)
- Flags:
-
and--
. Example:-f
,--help
- Flags:
- Terminal commands
mv
(move),rm
(remove),mkdir
(make directory),touch
,pwd
(present working directory),cd
(change directory),code
,chrome
,cat
,ls
- File navigation
..
(to parent directory relative to the present working directory)./folderName
(go to this folder relative to the present working directory)~
(home directory)
- Source Control
- Version Control Systems (VSC)
- Types and history of version control
- Git
- Difference between workspace and repository
- Commands
init
,push
(to),pull
(from),branch
,reflog
,log
,commit
,rebase
,add
,restore
,status
,remote
,clone
,fetch
,merge
,checkout
- Atomic commits, commit frequency
- Redaction of commit messages
- .gitignore
- Version Control Systems (VSC)
- GitHub
- Making a repository
- Making a GitHub Pages site
- Pull requests
- SSH Keys
- Personal Access Tokens (PATs)
- Actions
- Workflows
- Figma
- Excalidraw