General Coding Flashcards

1
Q

Statically Typed Languages

A

The type of variable is known at compile time.

  • You must declare the type of each variable explicitly and the type info is checked during compilation

Ex: Java, C++, C#, Swift, Rust, Go

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Pros: Static Typed Languages

A
  • Type checking: reduces runtime errors and improves code reliability
  • Performance: Leads to optimizations during compilation
  • Clarity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Dynamically Typed Languages

A

The type of variable is determined at runtime.

  • You don’t need to declare types explicitly. The language inverse the type based on value assigned

Ex: Python, JS, Ruby

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Pros: Dynamic Typed Languages

A
  • Flexibility: variable types can at runtime
  • Less boilerplate
  • Ease of use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Weakly Typed Languages

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Compile Time

A

A programs source code is translated into machine code/executable code

  • Before the program is executed

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Runtime

A

When a compiled program is actually executed by the computer

  • When a programs code is run and the program interacts with user

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Source file

A

Contains human readable code written in a programming language

  • The starting point for creating executable programs or other outputs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly