Code: The stances of Jennifer
The eight stances: the code
The examples behind the slides. They need no server and no decks and run with Jennifer 0.27.0 from this folder. Most slides show code that Jennifer rejects; those snippets cannot be .j files here, because every program in code/ must parse and lint cleanly, so rejected.sh writes them out and runs them instead.
rejected.sh: writes each rejected snippet to a temporary directory under the name the slide prints (s1a.j,s2c.j, ...), runs it and prints the first line of the error, so positions match the slides. It also lintss1d.jands7a.jfor the warnings shown. Covers "1. One way per thing", "1. Even when the shortcut would be safer", "2. Explicit over implicit", "3. Presentation, not transformation" (thecaseoption), "4. Strict at boundaries", "4. A missing value is an error, not a default", "5. Value semantics" (the deepconst), "6. No shadowing", "7. Topic-based, opt-in libraries" and "When a familiar feature is missing" (finally,return $q, $r;). Run:sh rejected.shexplicit.j: the explicit conversions instead of the rejected ones ("2. The explicit versions"). Run:jennifer run explicit.jprintf.j: presentation options onprintfverbs ("3. Presentation, not transformation"). Run:jennifer run printf.junderflow.j:1e-400is0.0, a finite value ("4. A missing value is an error, not a default"). Run:jennifer run underflow.jvalues.j: assigning a list copies it ("5. Value semantics"). Run:jennifer run values.jconventions.j: the same failure in several libraries, and the kinds that still differ ("8. One convention everywhere"). Run:jennifer run conventions.jdivmod.j: two results returned as a struct, the alternative toreturn $q, $r;("When a familiar feature is missing"). Run:jennifer run divmod.j
| File | Size | |
|---|---|---|
| LICENSE | 899 B | raw |
| README.md | 1.8 KiB | raw |
| conventions.j | 917 B | raw |
| divmod.j | 244 B | raw |
| explicit.j | 169 B | raw |
| printf.j | 56 B | raw |
| rejected.sh | 2.0 KiB | raw |
| underflow.j | 59 B | raw |
| values.j | 119 B | raw |