Statically Typed Languages
The type of variable is known at compile time.
Ex: Java, C++, C#, Swift, Rust, Go
Pros: Static Typed Languages
Dynamically Typed Languages
The type of variable is determined at runtime.
Ex: Python, JS, Ruby
Pros: Dynamic Typed Languages
Weakly Typed Languages
More flexible approach to type conversions, often performing implicit conversions between types
Languages: JS, PHP
Ex: implicit conversion of number to string
Let number = 10
let text = “the number is “ + number
Compile Time
A programs source code is translated into machine code/executable code
Compiler checks for
1. Syntax and type checking which must be resolved before the program can run
2. Optimization
3. Code generation (executable code or byte code from the source code which is then ready to be executed by computer)
Runtime
When a compiled program is actually executed by the computer
Key Characteristics
1. Programs instructions are executed by the CPU
2. Dynamic behavior occurs like memory allocation, dynamic typing, user input handling. Errors not caught at compile time are found here
Source file
Contains human readable code written in a programming language
when to source your env
When you want to load environment variables from it into your current shell session before running your application
What is Node.js
a JS runtime built on Chromes V8 JS engine
Key features of Node.js
NPM
Largest ecosystem of open source libraries and packages
Chromes V8 JS Engine
An open source JS engine developed by Google
How Node.js works
JS execution
- node.js uses the V8 engine to execute JS code. The V8 engine then compiles JS to machine code which is then executed by the computers processor
Client side Javascript
Environment: Runs in the Web browser
Use cases:
- user interface interactions like manipulating the DOM
- Event handling
- Form validation
Server side Javascript
Environment: Runs in Node.js
Use cases:
-HTTP web servers to handle client requests and serve responses
- APIs
- Background tasks