the ag_deck
+ - 0:00:00
Notes for current slide
Notes for next slide

earth

1 / 153

earth
turtle

2 / 153

earth
turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle turtle

3 / 153
4 / 153

nyan turtle

5 / 153

> typeof universe

'recursive space turtles'

> universe instanceof RecursiveSpaceTurtles

'who's to say really?'

6 / 153

hi my name is @ag_dubs

7 / 153

real eyes

8 / 153

npm5

npm i npm5 -g

9 / 153

bit.ly/jsconfeu-2017

ashleygwilliams/jsconfeu-2017

10 / 153

i like to think about thinking

11 / 153

i like to think about thinking

especially the type of thinking that happens when people write code

12 / 153

jquery PR

13 / 153

teaching is nature's way of letting you know how sloppy your thinking is

14 / 153

nodetogether

15 / 153

nodetogether

16 / 153

nodetogether

17 / 153

how do you decide what goes in a module?

19 / 153

testing

testing

21 / 153

reuse

22 / 153

garyjoke spicyjan

23 / 153

reuse

24 / 153

throw dart

25 / 153

haverbeke1 haverbeke2

26 / 153

people got mad

27 / 153

people

28 / 153

people

got

29 / 153

people

got

mad

30 / 153

people had no idea how/why to module but they felt very strongly that it was good

31 / 153

too many

32 / 153

explore

33 / 153

a brief history of time

34 / 153

the package ecosystem is javascript's picture of the universe

turtle

35 / 153

packages people 'npm install' a lot

http://npmjs.com. Accessed April 2017.
36 / 153

module counts

http://modulecounts.com. Accessed April 2017.
37 / 153

npm is the LARGEST MODULE REPOSITORY IN THE WORLD.

38 / 153

npm is the LARGEST MODULE REPOSITORY IN THE UNIVERSE??!!1

39 / 153

npm is the LARGEST MODULE REPOSITORY IN THE UNIVERSE??!!1

but why?

40 / 153

all the things

41 / 153

cut my code into pieces

42 / 153

cut my code into pieces

this is my javascript

43 / 153

pizzahut

44 / 153

require('dijkstra');

dijkstra

45 / 153

The programmer is in the unique position... They have to be able to think in terms of conceptual hierarchies that are much deeper than a single mind ever needed to face before... the automatic computer confronts us with a radically new intellectual challenge that has no precedent in our history.

Edsger Dijkstra

On the cruelty of really teaching computing science, EWD1036-0.
46 / 153

lol "automatic computer"

47 / 153

modularity is a way of addressing this challenge

48 / 153

what is modularity?

turtle

49 / 153

Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.

Modular Programming. Wikipedia. https://en.wikipedia.org/wiki/Modular_programming. Accessed 9 May 2016.
50 / 153

"one aspect"

51 / 153

small modules philosophy

52 / 153

It's all about containing complexity... By making small focused modules you can easily build large complex systems without having to know every single detail of how everything works. Our short term memory is finite.

Sindre Sorhus

https://github.com/sindresorhus/ama/issues/10#issuecomment-117766328
53 / 153

how small is too small?

54 / 153

one-line-node-modules

55 / 153

left-pad

56 / 153

warning

57 / 153

left-pad

58 / 153

left-pag

59 / 153

left-pad

60 / 153

shit

61 / 153

shit

62 / 153

ppk

63 / 153

ppk

64 / 153

building small reusable abstractions is the foundation of all computer science

65 / 153

did we forget to program when we stopped writing C?

66 / 153

did we forget to program when we stopped writing C?

... or when we stopped writing assembly?

67 / 153

did we forget to program when we stopped writing C?

... or when we stopped writing assembly?

... or when we stopped doing electrical engineering?

68 / 153

no true programmer!

69 / 153

no true scotsman!

70 / 153

no true programmer

71 / 153

no true programmer

no

72 / 153

When applications are done well, they are just the really application-specific, brackish residue that can't be so easily abstracted away. All the nice, reusable components sublimate away onto github and npm where everybody can collaborate to advance the commons.

substack

http://substack.net/how_I_write_modules
73 / 153

communism all the way down

74 / 153

communism all the way down

75 / 153

commons are Hard...

76 / 153

rollingweekly

77 / 153

~2 billion downloads a week

78 / 153

ohno

79 / 153

require('gall');

gall systemantics

80 / 153

A complex system that works is invariably found to have evovled from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over with a simple system.

John Gall

81 / 153

the trouble with modularity

turtle

82 / 153

The more I modularize my code. The bigger it gets.

Nolan Lawson

"The cost of small modules". Read the Tea Leaves. 15 August 2016.
83 / 153

Over 400ms is being spent simply walking the Browserify tree.

Sam Saccone

"The cost of small modules". Read the Tea Leaves. 15 August 2016.
84 / 153

the cost of small modules

85 / 153

duckhorse

86 / 153

How many modules are in a typical web application?

  • requirebin.com: 91 modules

  • keybase.io: 365 modules

  • m.reddit.com: 1050 modules

  • Apple.com: 1060 modules

https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/
87 / 153

modulepackers

88 / 153

webpack and browserify

every module gets its own function

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = 0
},{}],2:[function(require,module,exports){
module.exports = 1
},{}],3:[function(require,module,exports){
module.exports = 10
},{}],4:[function(require,module,exports){
module.exports = 100
// etc.
89 / 153

rollup and closure

hoist everything into a single function

(function () {
'use strict';
var module_0 = 0
var module_1 = 1
// ...
total += module_0
total += module_1
// etc.
90 / 153

loadtime

91 / 153

prepack

92 / 153

prepack

93 / 153

94 / 153

the use of modularity has grown to such a scale that web developers are being confronted with issues that we'd never have anticipated

95 / 153

low level programming concepts are now more relevant to web developers than ever

96 / 153

i, for one, welcome our new compiler/transpiler overlords

97 / 153

Yes, small modules are easier to write. Yes, they’re easier to test. Yes, it’s easier to adhere to semver. These are all things that make your life as a library author easier. As we’ve seen, they come at a cost for others.

Rich Harris

https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4#.9qtsjcmd6
98 / 153

the small modules philosophy:

99 / 153

the small modules philosophy:

  • ✅ benefits the library writers

100 / 153

the small modules philosophy:

  • ✅ benefits the library writers

  • 😩 disadvantages application writes

101 / 153

the small modules philosophy:

  • ✅ benefits the library writers

  • 😩 disadvantages application writes

  • 🙅🏾 harms end users

102 / 153

how did we end up here?

103 / 153

require('kuhn');

kuhn

104 / 153

Scientists work from models acquired through education and through subsequent exposure to the literature often without quite knowing or needing to know what characteristics have given these models the status of community paradigms.

Thomas Kuhn

Kuhn, Thomas. "The Structure of Scientific Revolutions", pg 46 (1962)
105 / 153

inconvenience

106 / 153

require('ceejbot');

ceejbot

107 / 153

Your monolith is complex. A split system is more complex.

CJ Silverio

108 / 153

solution

109 / 153

require('hickey');

hickey

110 / 153

Most of the big problems in software are problems of misconception.

Rich Hickey

"Hammock Driven Development". Clojure Conj, 2010. https://www.youtube.com/watch?v=f84n5oFoZBc.
111 / 153

software development is change management

turtle

112 / 153

require('hawking');

hawking

113 / 153

It is an interesting reflection on the general climate of thought before the twentieth century that no one had suggested that the universe was expanding or contracting.

Steven Hawking

A Brief History of Time. Bantam Books Trade Paperbacks: 6, 1988.
114 / 153

require('parnas');

david parnas decomposing criteria paper

115 / 153

[Start] with a list of difficult design decisions or design decisions which are likely to change. Each module is then designed to hide such a decision from the others.

David Parnas

Parnas, D. L. 1972 On the Criteria To Be Used in Decomposing Systems into Modules. Association for Computing Machinery, Inc: Programming Techniques, 1053-1058.
116 / 153

the goal of modularity is not to make things easier but to hide the things that are hard

117 / 153

how to computer?

turtle hiding

118 / 153

None of us are born knowing how to write software.

Rich Hickey

119 / 153

failure

120 / 153

despair?

121 / 153

require('sartre');

sartre

122 / 153

tef tweet

123 / 153

require('tef');

tef

124 / 153

Write code that is easy to delete, not easy to extend. Instead of building re-usable software, we should try to build disposable software. I don’t need to tell you that deleting code is more fun than writing it.

Tef

http://programmingisterrible.com/post/139222674273/write-code-that-is-easy-to-delete-not-easy-to
125 / 153

if u love it

126 / 153

jquery PR

127 / 153

jquery PR

128 / 153

we are seeing a return of conservativism

129 / 153

modularity is an old problem that we are dealing with at a new scale

130 / 153

132 / 153

all is not lost, dogs know calculus

133 / 153

dogcalc

134 / 153

dogcalc

135 / 153

dogcalc

136 / 153

corgis are made of star stuff

137 / 153

corgis are made of star stuff

and so are we

138 / 153

dylan

139 / 153

140 / 153

summary

141 / 153

modularize your code to make it easier for you to develop

142 / 153

isolate the hard-to-write and the likely-to-change parts from the rest of the code, and each other.

143 / 153

modularity is not free, in fact it's pretty expensive

144 / 153

what works for you as a developer can have other consequences for other developers, as well as your end users

145 / 153

the tools that currently exist help mitigate a cost your are already enduring

use them

146 / 153

this is a fast moving space right now that doesn't have any definitive answers

147 / 153

so quit being jerks to each other on twitter ok

148 / 153

this problem is far from being solved

149 / 153

julia how to be a wizerd

Julia Evans, @b0rk

150 / 153

npm install

a-brief-history

{ "name": "a brief history and mishistory of modularity", "author": "ashley williams @ag_dubs", "version": "1.0.0", "dependencies" : { "Edsger Dijkstra": "On the Cruelty of Really Teaching Computer Science", "Stephen Hawking": "A Brief History of Time", "Rich Hickey": "Hammock Driven Development", "Rich Hickey": "Design, Composition, Performance", "Tef": "Write code that is easy to delete, not easy to extend.", "CJ Silverio": "Cheating Gall's Law", "Nolan Lawson": "The cost of small modules", "Substack": "How I write modules", "Sindre Sohrus": "Small Modules: Tales from a Serial Module Author" }

151 / 153

npm5

npm i npm5 -g

152 / 153

squirtle

153 / 153

earth
turtle

2 / 153
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow