Skip to content

Instantly share code, notes, and snippets.

View matthewstokeley's full-sized avatar
🎯
Focusing

Matthew Stokeley matthewstokeley

🎯
Focusing
View GitHub Profile
@matthewstokeley
matthewstokeley / Cyclomatic complexity and lexical scope in JavaScript.
Created October 30, 2020 21:30
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
@matthewstokeley
matthewstokeley / event-driven-jQuery-task-complétion.md
Created October 18, 2020 19:16
event-driven-jQuery-task-complétion.md
@matthewstokeley
matthewstokeley / Landing-page-onesheet.md
Created October 16, 2020 19:23
Landing page onesheet
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 April 16, 2020 00:08
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 April 16, 2020 00:08
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 April 16, 2020 00:08
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 April 8, 2020 18:05
bootloading a transpiler
#! /usr/bin/node
/* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
* Bootload a Transpiling Environment
*
* @version 0.0.2
*/
/* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
* Declare Modules
@matthewstokeley
matthewstokeley / delegation-pattern.js
Last active April 7, 2020 13:34
Delegation design pattern
// #### Delegation
// A SOLID method is delegated via composition.
/**
*
*/
type Subtask: Function(name: String): Function
/**
@matthewstokeley
matthewstokeley / on-one-off.ts
Last active March 16, 2020 18:39
an on-one-off robust api with the mixin pattern
// dom versus publisher subscribe naming conventions
const Handler = ( function() {
return {}
} )()
type eventName: String
type eventFn: Function