Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Explanations on foundational terms from multiple programming languages w/ coding, usages, pros & cons.

Notifications You must be signed in to change notification settings

enginooby-academics/coding-terminology

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

Typing

Structurally typed [TS]

  • Allow instances of a type to have extra properties
interface User {name: string; age: number}

const jeff = {name: 'Jeff', age: 18, gender: 'male'}; 
const user: User = jeff; // OK

Statically typed [C/C++, C#, Java, Kotlin, TypeScript, Scala, Rust, Go, Pascal, FORTRAN]

Types are determined at compile time

  • Require to declare data w/ type annotation or type inference
string name = "Jeff";  // type annotation
var name = "Jeff"; // type inference
  • Disallow to re-assign variable w/ different types
string name = 3; // ⛔ Compile error 
string name = "John"; // ✅ OK

🌗 Opposite: Dynamically typed

Dynamically typed [JavaScript, Objective-C, PHP, Python, Ruby, Lisp]

Types are determined at runtime

  • Don't require to declare data types
name = "Jeff"
  • Allow to re-assign variable w/ different types
name = 3; // ✅ OK

🌗 Opposite: Statically typed

Strongly typed

Weekly typed

Data Structure

Tuple [Python, C#7]

  • Characteristics:
    • Immutable: size is fixed and elements can not be modified => less memory and iterate faster than list, array,
    • Can contain elements of different data types.
    • Operations: indexing, slicing, membership test.
  • Use cases:
    • Return multiple values from private and internal utility methods w/o define a new type (POCO class/interface...)
    • Asign multiple variables at the same time.
    • Swap two variables w/o using additional temprory variable.

Others

First class citizen

An entity which supports all the operations generally available to other entities, such as being passed as an argument, returned from a function, modified, assigned to a variable.

First class function [JS/TS, Dart, Kotlin, Scala, Swift, Rust]

  • Treat function as first class citizen -> can be passed as an argument
  • The argument function can be a ananymous function
  • Use cases:
    • Callback
    • Used along w/ collection operations such as map(), where(), and reduce(), etc

About

Explanations on foundational terms from multiple programming languages w/ coding, usages, pros & cons.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published