Skip to content

Instantly share code, notes, and snippets.

These examples are presented in an attempt to show how each coding styles attempts to or does not attempt to isolate side-effects. There are only 2 semantic elements in a barebone "Hello World" implementation:

  • Invocation of console.log
  • Declaration of HELLO_WORLD

Since every coding style can abstract away data into a parameter or variable, there is no point for us to show that. All implementations assume HELLO_WORLD is a constant that is always inlined. This way it reduces the variations we need to present. (To make an anology, if we were to implement incrementByOne, would we need to inline the number 1 or pass it in as parameter?)

CAVEAT/LIMITATION: All implementations also assume console is static. In case of OOP inheritance, Console is assumed to be extendable. In case of functional programming, console.log is asumed to be a function that can be passed around without further modification.

Declarative

Legend
C = ⌘ : Command key
Ct = ⌃ : Control key
Cr = ↩ : Return or Enter key
O = Option or Alt key
S = ⇧ : Shift key
D = ⌫ : Delete key
Dn = ↓ : Down arrow key
Up = ↑ : Up arrow key
Esc : Escape key
@Usse
Usse / dabblet.css
Created January 14, 2014 21:07 — forked from anonymous/dabblet.css
Multiple line li center
/**
* Multiple line li center
*/
ul {
list-style-type:none;
text-align:center;
}
li {