~/talk

Refactoring to Functional Style

Talkat NDC Oslo 2018 · 2018-06-11..06-15· [frontend-architecture, javascript]
slides:none on file

Starts from noisy imperative examples and shows concrete refactorings in Java using the Java Stream API: replace mutable loops with filter map noneMatch to find an uppercase name older than 30 and prove laziness by instrumenting getAge so the stream stops at "Paulo". Uses IntStream noneMatch for primes, Files.lines().filter().count for host search, Collectors.groupingBy to invert scores, and a Stream.iterate plus flatMap for one-to-many to generate ten Pythagorean triples and sum square roots of primes with lazy, limited evaluation.

AI-written summary · about

  1. 0:00Start
  2. 4:08Higher-Order Functions
  3. 5:08Declaration Style
  4. 6:07Functional Composition
  5. 13:56What Does a Benefit this Code Really Offers
  6. 43:06Map Operation
  7. 46:05Example of Accidental Complexity
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.