CS Basics

Covers basic computer science ideas in brief

Functional programming

TODO

Subset of declarative

Possibly this?

SOLID

The goal of SOLID is the creation of mid-level software structures that tolerate change, are easy to understand, and are easily used for multiple purposes.

  • Single Responsibility Principle: Each piece of software in any corporation is overseen by one individual, so that each module has one, and only one, reason to change. (The best way to make this possible is for the software to reflect the org's social structure). Corollary to Conway's law.
  • Open-Closed Principle: Add new code instead of changing existing code. This is "extensibility".
  • Liskov substitution principle: Software modules must adhere to a common contract in order to have interchangeable parts.
  • Interface Segregtion Principle: Software modules shouldn't depend on things they don't use.
  • Dependency Inversion Principle: High-level policy code should dictate low-level details, not vice versa (like in the old days).

Types of programming

  • Imperative: statements change a program's state (src).
    • Golang is imperative and pro (link
  • Procedural: the language makes use of sets of commands, called procedures, which can be invoked in any order the programmer pleases. These are an extension of imperative languages, since procedures are just reusable sets of imperative statements.
  • Declarative: the programmer uses the language to specify what should be done, as opposed specifying how it should be done.
    • SQL, HTML, React are declarative
      • SQL declares what information should be retrieved, not how the DB engine should retrieve it
      • React declares what should be done to the DOM, not how it should be done
    • Great article here and here.
  • Functional: a form of declarative programming, except that all calls are done via pure functions and all state is immutable.
    • Functional programming leverages a set of expressions that map values to other values (source).
    • Advantages of functional programming are listed here.