Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Matthew Stokeley matthewstokeley

🎯
Focusing
View GitHub Profile
@matthewstokeley
matthewstokeley / Cyclomatic complexity and lexical scope in JavaScript.
Created Oct 30, 2020
Cyclomatic complexity and lexical scope in JavaScript.
View Cyclomatic complexity and lexical scope in JavaScript.
Cyclomatic complexity and lexical scope in JavaScript.
Arrow functions, the equivalent of prototypally-inherited invoked bound functions, and modules, specifically the implementation of the ECMA spec designed from the competition between AMD and Commonjs implementations, radically altered default practices for handling global namespace collisions, variable design considerations and mutation strategies. This progression to discrete functions and native encapsulation can be thought of in terms of the principle of reducing cyclomatic complexity. The depth of lexical record is reduced at every function invocation, the global namespace is obviated, reducing IIFE’s and revealing modules that increase scope depth, and design choices increase given immutable variable declaration to reduce closures - design systems utilizing revealing module-enabled chaining syntax and object-oriented prototypal JavaScript are unaffected. Cyclomatic complexity is considered detrimental in method design because of memory constrain
View Landing-page-onesheet.md
View Stateful strategies for HTTP Applications
Stateful strategies in HTTP applications
Http applications
- Mobile
- Js apps
- Server-side
- Hybrid
- API’s
Persistence
@matthewstokeley
matthewstokeley / single-threaded-processing-in-5-seconds.md
Last active Apr 16, 2020
Single-threaded-processing-in-5-seconds.md
View single-threaded-processing-in-5-seconds.md
// the thread of a processor is like a queue
- - - - -
// processes take various amounts of time to execute
--- -- - ------- -
@matthewstokeley
matthewstokeley / javascript-modules-in-5-seconds.md
Last active Apr 16, 2020
javascript-modules-in-5-seconds.md
View javascript-modules-in-5-seconds.md

wip needs editing

// Google Closure Library
google.require()
// ES6 Modules
import {export} from 'module'
// all
@matthewstokeley
matthewstokeley / javascript-native-array-methods-in-5.md
Last active Apr 16, 2020
javascript-native-array-methods-in-5.md
View javascript-native-array-methods-in-5.md

wip needs editing

// native array methods are functions attached to the prototype of the variadic constructor or object literal, and are inherited via prototypal inheritance
Array.prototype[METHOD].call, [].prototype[METHOD].call, let arr_ = [1,2,3]; arr[METHOD].call
// the common argument pattern for methods is VIA: value, index, array
[].forEach((value, index, array) => value++)
@matthewstokeley
matthewstokeley / bootloader.js
Last active Apr 8, 2020
bootloading a transpiler
View bootloader.js
#! /usr/bin/node
/* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
* Bootload a Transpiling Environment
*
* @version 0.0.2
*/
/* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
* Declare Modules
@matthewstokeley
matthewstokeley / delegation-pattern.js
Last active Apr 7, 2020
Delegation design pattern
View delegation-pattern.js
// #### Delegation
// A SOLID method is delegated via composition.
/**
*
*/
type Subtask: Function(name: String): Function
/**
@matthewstokeley
matthewstokeley / on-one-off.ts
Last active Mar 16, 2020
an on-one-off robust api with the mixin pattern
View on-one-off.ts
// dom versus publisher subscribe naming conventions
const Handler = ( function() {
return {}
} )()
type eventName: String
type eventFn: Function