Commit 4db53a552e3e351132de9ff96cd61a20cc4810ee
okay
Michael Williams committed on 8/6/2017, 12:21:47 AMParent: c563ee340b811683da77ae884f028ad43419ef51
Files changed
README.md | changed |
index.html | changed |
README.md | |||
---|---|---|---|
@@ -69,10 +69,12 @@ | |||
69 | 69 … | - i take the Douglas Engelbart approach to developer experience | |
70 | 70 … | - you may have heard of the Mother of all Demos, if not i highly recommend you check it out | |
71 | 71 … | - he intended to boost collective intelligence to solve urgent global problems | |
72 | 72 … | - Englebart's vision was that the power of technology came with inherent complexity | |
73 … | + - not a good idea to sweep complexity under the rug | ||
73 | 74 … | - so priority is not ease of use but powerful human computer expression | |
74 | -- let's evolve our JavaScript together to solve urgent global problems | ||
75 … | + - kinda the opposite of Steve Jobs | ||
76 … | +- keen to evolve our JavaScript with this in mind | ||
75 | 77 … | ||
76 | 78 … | references: | |
77 | 79 … | ||
78 | 80 … | - https://alistapart.com/column/douglas-engelbart | |
@@ -93,9 +95,8 @@ | |||
93 | 95 … | ??? | |
94 | 96 … | ||
95 | 97 … | an ambiguous utopia | |
96 | 98 … | ||
97 | - | ||
98 | 99 … | --- | |
99 | 100 … | class: info | |
100 | 101 … | ||
101 | 102 … | ## Luddite? | |
@@ -152,9 +153,9 @@ | |||
152 | 153 … | class: info | |
153 | 154 … | ||
154 | 155 … | ### what is a standard? | |
155 | 156 … | ||
156 | -anything that enough people use is a "standard" | ||
157 … | +a standard is an opinion about a pattern | ||
157 | 158 … | ||
158 | 159 … | example: ["standard style"](https://github.com/feross/standard) | |
159 | 160 … | ||
160 | 161 … | ``` | |
@@ -162,9 +163,9 @@ | |||
162 | 163 … | ``` | |
163 | 164 … | ||
164 | 165 … | ??? | |
165 | 166 … | ||
166 | -- a standard is one opinion, shared my many | ||
167 … | +- an opinion that enough people agree with is a serious standard | ||
167 | 168 … | - tc39 is a great team advancing the state of the art in JavaScript, | |
168 | 169 … | - but the standards produced by tc39 are only one of _many_ possible JavaScript opinions | |
169 | 170 … | - we all have the power to create our own JavaScript opinions | |
170 | 171 … | - no experience necessary! | |
@@ -289,10 +290,8 @@ | |||
289 | 290 … | - why new syntax? | |
290 | 291 … | - there's myths that es modules make possible something new | |
291 | 292 … | - what is happening here? | |
292 | 293 … | - i find this can be confusing for beginners who don't understand the special syntax and complex implementation details | |
293 | -- in the wild, export default breaks CommonJS code | ||
294 | - - yes, i'm bitter about this, i've lost many hours debugging broken code, only to realize the module author published a patch version that broke the CommonJS exports | ||
295 | 294 … | ||
296 | 295 … | --- | |
297 | 296 … | class: success | |
298 | 297 … | ||
@@ -320,10 +319,52 @@ | |||
320 | 319 … | - wrap in closure to provide global variables like `require`, `module`, `exports`, `global` | |
321 | 320 … | - run code in JavaScript interpreter | |
322 | 321 … | - capture result of `module.exports` variable | |
323 | 322 … | - when i started using Node.js from Python, `require`-as-a-function is what excited me the most | |
324 | - - so yes, i'm somewhat bitter that now JavaScript is adopting the same syntax as Python | ||
323 … | + | ||
325 | 324 … | --- | |
325 … | +class: success | ||
326 … | + | ||
327 … | +### depject | ||
328 … | + | ||
329 … | +```js | ||
330 … | +const module = { | ||
331 … | + needs: { | ||
332 … | + message: { | ||
333 … | + layout: 'first', | ||
334 … | + render: 'map', | ||
335 … | + decorate: 'reduce' | ||
336 … | + } | ||
337 … | + }, | ||
338 … | + gives: { | ||
339 … | + message: { | ||
340 … | + view: true | ||
341 … | + } | ||
342 … | + }, | ||
343 … | + create: ({ message: { layout, render, decorate }) => { | ||
344 … | + return { message: { view } } | ||
345 … | + | ||
346 … | + function view () {} | ||
347 … | + } | ||
348 … | +} | ||
349 … | + | ||
350 … | +combine([modules...]) | ||
351 … | +``` | ||
352 … | + | ||
353 … | +??? | ||
354 … | + | ||
355 … | +https://github.com/depject/depject | ||
356 … | + | ||
357 … | +- dependency injection for overlapping opinions | ||
358 … | +- each module is an object with exposes `{ needs, gives, create }` | ||
359 … | +- `needs` is a map of names to types | ||
360 … | + - first: use the first module that has an opinion about a thing | ||
361 … | + - map: get each module's opinion about a thing | ||
362 … | + - reduce: compose each module's opinion about a thing into one opinion | ||
363 … | +- gives is an object of names to export | ||
364 … | +- create is a function which receives needed plugs and returns given plugs | ||
365 … | + | ||
366 … | +--- | ||
326 | 367 … | class: center, info | |
327 | 368 … | ||
328 | 369 … | ## dom elements | |
329 | 370 … | ||
@@ -363,8 +404,9 @@ | |||
363 | 404 … | - looks friendly on the surface, but underneath has non-obvious edge cases | |
364 | 405 … | - hides that JSX is actually `React.createElement` function calls | |
365 | 406 … | - "why can't i use `if () { first } else { second }`? | |
366 | 407 … | - can only use expressions, not statements | |
408 … | +- new syntax means you need a special code syntax highlighter, i ran out of time | ||
367 | 409 … | ||
368 | 410 … | --- | |
369 | 411 … | ||
370 | 412 … | class: success | |
@@ -397,10 +439,10 @@ | |||
397 | 439 … | ``` | |
398 | 440 … | ||
399 | 441 … | ??? | |
400 | 442 … | ||
401 | -- syntax can be confusing at first | ||
402 | -- `React.createElement` is basically a strict hyperscript | ||
443 … | +- same with lust functions | ||
444 … | +- syntax can be unattractive at first | ||
403 | 445 … | ||
404 | 446 … | see also: | |
405 | 447 … | ||
406 | 448 … | - [`hyperscript-helpers`](https://github.com/ohanhi/hyperscript-helpers) | |
@@ -437,8 +479,12 @@ | |||
437 | 479 … | return h('div', { className }, text) | |
438 | 480 … | ) | |
439 | 481 … | ``` | |
440 | 482 … | ||
483 … | +??? | ||
484 … | + | ||
485 … | +- `React.createElement` is basically a strict hyperscript | ||
486 … | + | ||
441 | 487 … | --- | |
442 | 488 … | class: center, info | |
443 | 489 … | ||
444 | 490 … | ## eventual value | |
@@ -544,10 +590,13 @@ | |||
544 | 590 … | ??? | |
545 | 591 … | ||
546 | 592 … | - promise errors smush the user and programmer errors together | |
547 | 593 … | - promises wrap all your handlers in a `try` / `catch`, so even if you have a different opinion about error handling, promises will force it's opinion on you | |
548 | - - yes, i'm bitter about this, i've lost many hours trying to figure out where my errors went | ||
549 | 594 … | ||
595 … | +i could talk about how to do pipe continuable as a waterfall, in parallel, etc, but... | ||
596 … | + | ||
597 … | +both continuables and promises have their own place in hell, we need better abstractions. | ||
598 … | + | ||
550 | 599 … | --- | |
551 | 600 … | class: center, info | |
552 | 601 … | ||
553 | 602 … | ## reactive values | |
@@ -725,8 +774,25 @@ | |||
725 | 774 … | // first value: 0 | |
726 | 775 … | ``` | |
727 | 776 … | ||
728 | 777 … | --- | |
778 … | +class: info | ||
779 … | + | ||
780 … | +#### pull stream errors | ||
781 … | + | ||
782 … | +with a pull stream source callback, there are four possible signals: | ||
783 … | + | ||
784 … | +1. value: `callback(null, value)` | ||
785 … | +2. user error: `callback(error)` | ||
786 … | +3. programmer error: `throw error` | ||
787 … | +4. complete: `callback(true)` | ||
788 … | + | ||
789 … | +??? | ||
790 … | + | ||
791 … | +- both the source and sink can signal back-pressure ("hey i'm busy") by not calling the respective callback | ||
792 … | + | ||
793 … | + | ||
794 … | +--- | ||
729 | 795 … | class: success | |
730 | 796 … | ||
731 | 797 … | #### sink spec | |
732 | 798 … | ||
@@ -860,8 +926,10 @@ | |||
860 | 926 … | ||
861 | 927 … | #### compose pull streams | |
862 | 928 … | ||
863 | 929 … | ```js | |
930 … | +pull(source, through, sink) === sink(through(source)) | ||
931 … | + | ||
864 | 932 … | pull(source, through) // returns source | |
865 | 933 … | ||
866 | 934 … | pull(through, sink) // returns sink | |
867 | 935 … | ||
@@ -897,24 +965,8 @@ | |||
897 | 965 … | ||
898 | 966 … | obviously you don't want to re-implement simple streams from scratch all the time | |
899 | 967 … | ||
900 | 968 … | --- | |
901 | -class: info | ||
902 | - | ||
903 | -#### pull stream errors | ||
904 | - | ||
905 | -with a pull stream source callback, there are four possible signals: | ||
906 | - | ||
907 | -1. value: `callback(null, value)` | ||
908 | -2. user error: `callback(error)` | ||
909 | -3. programmer error: `throw error` | ||
910 | -4. complete: `callback(true)` | ||
911 | - | ||
912 | -??? | ||
913 | - | ||
914 | -- both the source and sink can signal back-pressure ("hey i'm busy") by not calling the respective callback | ||
915 | - | ||
916 | ---- | ||
917 | 969 … | class: center, info | |
918 | 970 … | ||
919 | 971 … | ## why should you be a JavaScript luddite? | |
920 | 972 … | ||
@@ -922,10 +974,14 @@ | |||
922 | 974 … | class: success | |
923 | 975 … | ||
924 | 976 … | ### better performance | |
925 | 977 … | ||
926 | -software performance is less about gaining muscle, more about losing weight | ||
978 … | +software performance is | ||
927 | 979 … | ||
980 … | +less about gaining muscle | ||
981 … | + | ||
982 … | +more about losing weight | ||
983 … | + | ||
928 | 984 … | ??? | |
929 | 985 … | ||
930 | 986 … | - code runs faster when it does less | |
931 | 987 … | - was going to put a picture showing an over-powered muscly person versus a light and lean runner, but hey i'll leave it to your imagination :) | |
@@ -935,10 +991,12 @@ | |||
935 | 991 … | class: success | |
936 | 992 … | ||
937 | 993 … | ### easier to describe | |
938 | 994 … | ||
939 | -specification is a function signature, not a complex state machine | ||
995 … | +specification is a function signature, | ||
940 | 996 … | ||
997 … | +not a complex state machine | ||
998 … | + | ||
941 | 999 … | ??? | |
942 | 1000 … | ||
943 | 1001 … | - clear inputs and outputs | |
944 | 1002 … | - small code blocks (or "snippets") can be deceiving | |
@@ -1054,9 +1112,11 @@ | |||
1054 | 1112 … | class: success, center | |
1055 | 1113 … | ||
1056 | 1114 … | #### offline social media | |
1057 | 1115 … | ||
1058 | -<http://patchwork.campjs.com> | ||
1116 … | +[patchwork.campjs.com](http://patchwork.campjs.com) | ||
1117 … | +& | ||
1118 … | +[scuttlebutt.nz](https://www.scuttlebutt.nz) | ||
1059 | 1119 … | ||
1060 | 1120 … | <img src="./patchwork-screenshot.jpg" height="400" class="center" /> | |
1061 | 1121 … | ||
1062 | 1122 … | --- | |
@@ -1134,11 +1194,11 @@ | |||
1134 | 1194 … | class: info | |
1135 | 1195 … | ||
1136 | 1196 … | ### all the "standards" | |
1137 | 1197 … | ||
1138 | -make up your own "standards"! | ||
1198 … | +make up your own opinions! | ||
1139 | 1199 … | ||
1140 | -you have just as much a right to make the next JavaScript standard as anyone else. | ||
1200 … | +your opinion about JavaScript is valid. | ||
1141 | 1201 … | ||
1142 | 1202 … | ??? | |
1143 | 1203 … | ||
1144 | 1204 … | at the end of the day, standards are just somebody's opinion. |
index.html | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 901081 bytes New file size: 902531 bytes |
Built with git-ssb-web