Slide 1

Slide 1 text

The effective JavaScript developer Radoslav Stankov 12/11/2022

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

!

Slide 7

Slide 7 text

Radoslav Stankov @rstankov

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

“It is better to be a good programmer with great habits, than a great programmer.” - Kent Beck

Slide 13

Slide 13 text

“Process is automatic decisions for trivial questions and framework for making decisions for all other questions.” - Rado What is process

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

1. Focus

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Flow

Slide 20

Slide 20 text

“Flow state, also known as being in the zone, is the mental state of operation in which a person performing an activity is fully immersed in a feeling of energized focus, full involvement, and enjoyment in the process of the activity.” - WikipediA Flow

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

“Task switching is an executive function that involves the ability to shift attention between one task and another unconsciously.” - WikipediA Task switching

Slide 23

Slide 23 text

" you # your $

Slide 24

Slide 24 text

What's next %

Slide 25

Slide 25 text

Todoist

Slide 26

Slide 26 text

Focused Task

Slide 27

Slide 27 text

Focused Task https://github.com/RStankov/FocusedTask

Slide 28

Slide 28 text

& Eliminate distractions ' block websites ( reduce app notifications ) do not disturb mode

Slide 29

Slide 29 text

Manage your energy

Slide 30

Slide 30 text

“In cognitive psychology, cognitive load refers to the used amount of working memory resources. ” - WikipediA Cognitive load

Slide 31

Slide 31 text

“Ego depletion refers to the idea that self- control or willpower draws upon a limited pool of mental resources that can be used up.” - WikipediA Ego depletion

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

“Process is automatic decisions for trivial questions and framework for making decisions for all other questions.” - Rado What is process

Slide 39

Slide 39 text

“Process is automatic decisions for trivial questions and framework for making decisions for all other questions.” - Rado What is process

Slide 40

Slide 40 text

* Routine ⏲ Reminders , Checklist - Templates . Automations

Slide 41

Slide 41 text

Prepare the clothes you are going to wear tomorrow the evening before. /Life Hack

Slide 42

Slide 42 text

Capture knowledge

Slide 43

Slide 43 text

“Our head is for creating ideas, not storing them” - David Allen, author GTD

Slide 44

Slide 44 text

Rado's Head Bear Todoist Idea / Store Next action

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

/Split task into parts

Slide 52

Slide 52 text

done todo won't do in progress

Slide 53

Slide 53 text

https://blog.rstankov.com/how-i-plan-and-execute-features/

Slide 54

Slide 54 text

2. Effective

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

Know your craft

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

First principles and fundaments

Slide 60

Slide 60 text

First principles and fundaments TypeScript Node Browser React Next JavaScript

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

0 Read the source code

Slide 63

Slide 63 text

⚛ 2 React Hooks

Slide 64

Slide 64 text

export function useEffect( create: () => (() => void) | void, deps: Array | void | null, ): void { const dispatcher = resolveDispatcher(); return dispatcher.useEffect(create, deps); } https://github.com/facebook/react/blob/main/packages/react/src/ReactHooks.js

Slide 65

Slide 65 text

https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberHooks.new.js const HooksDispatcherOnMount: Dispatcher = { // ... useRef: mountRef, // ... }; const HooksDispatcherOnUpdate: Dispatcher = { // ... useRef: updateRef, // ... }; const HooksDispatcherOnRerender: Dispatcher = { // ... useRef: updateRef, // ... }; const ContextOnlyDispatcher: Dispatcher = { // ... useRef: throwInvalidHookError, // ... };

Slide 66

Slide 66 text

https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberHooks.new.js " const HooksDispatcherOnMount: Dispatcher = { // ... useRef: mountRef, // ... }; const HooksDispatcherOnUpdate: Dispatcher = { // ... useRef: updateRef, // ... }; const HooksDispatcherOnRerender: Dispatcher = { // ... useRef: updateRef, // ... }; const ContextOnlyDispatcher: Dispatcher = { // ... useRef: throwInvalidHookError, // ... };

Slide 67

Slide 67 text

https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberHooks.new.js function updateRef(initialValue: T): {current: T} { const hook = updateWorkInProgressHook(); return hook.memoizedState; }

Slide 68

Slide 68 text

function updateWorkInProgressHook(): Hook { // This function is used both for updates and for re-renders triggered by a // render phase update. It assumes there is either a current hook we can // clone, or a work-in-progress hook from a previous render pass that we can // use as a base. When we reach the end of the base list, we must switch to // the dispatcher used for mounts. let nextCurrentHook: null | Hook; if (currentHook === null) { const current = currentlyRenderingFiber.alternate; if (current !== null) { nextCurrentHook = current.memoizedState; } else { nextCurrentHook = null; } } else { nextCurrentHook = currentHook.next; } let nextWorkInProgressHook: null | Hook; if (workInProgressHook === null) { nextWorkInProgressHook = currentlyRenderingFiber.memoizedState; } else { nextWorkInProgressHook = workInProgressHook.next; } if (nextWorkInProgressHook !== null) { // There's already a work-in-progress. Reuse it.

Slide 69

Slide 69 text

function updateWorkInProgressHook(): Hook { // This function is used both for updates and for re-renders triggered by a // render phase update. It assumes there is either a current hook we can // clone, or a work-in-progress hook from a previous render pass that we can // use as a base. When we reach the end of the base list, we must switch to // the dispatcher used for mounts. let nextCurrentHook: null | Hook; if (currentHook === null) { const current = currentlyRenderingFiber.alternate; if (current !== null) { nextCurrentHook = current.memoizedState; } else { nextCurrentHook = null; } } else { nextCurrentHook = currentHook.next; } let nextWorkInProgressHook: null | Hook; if (workInProgressHook === null) { nextWorkInProgressHook = currentlyRenderingFiber.memoizedState; } else { nextWorkInProgressHook = workInProgressHook.next; } if (nextWorkInProgressHook !== null) { // There's already a work-in-progress. Reuse it.

Slide 70

Slide 70 text

function updateWorkInProgressHook(): Hook { // This function is used both for updates and for re-renders triggered by a // render phase update. It assumes there is either a current hook we can // clone, or a work-in-progress hook from a previous render pass that we can // use as a base. When we reach the end of the base list, we must switch to // the dispatcher used for mounts. let nextCurrentHook: null | Hook; if (currentHook === null) { const current = currentlyRenderingFiber.alternate; if (current !== null) { nextCurrentHook = current.memoizedState; } else { nextCurrentHook = null; } } else { nextCurrentHook = currentHook.next; } let nextWorkInProgressHook: null | Hook; if (workInProgressHook === null) { nextWorkInProgressHook = currentlyRenderingFiber.memoizedState; } else { nextWorkInProgressHook = workInProgressHook.next; } if (nextWorkInProgressHook !== null) { // There's already a work-in-progress. Reuse it.

Slide 71

Slide 71 text

Know your tools

Slide 72

Slide 72 text

3 Run a test 0 Search in codebase ✈ Jump across files 5 Refactoring - moving code around 6 Search documentation 7 Writing new code ⛩ Common operations

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

9

Slide 78

Slide 78 text

9

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

Alfred + Dash

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

https://blog.rstankov.com/my-alfred-setup/

Slide 84

Slide 84 text

...more tools

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

3. Goals

Slide 90

Slide 90 text

“Reading is good, action is better.” - Eric Ries ( Lean Startup)

Slide 91

Slide 91 text

: Personal Goals 7 Work Goals ; Baseline

Slide 92

Slide 92 text

: Personal Goals ✈ Travel to Japan < 3 Weight 90kg 7 Work Goals = Ship claiming of Product Hub 6 Learn PostgreSQL internals ; Baseline > 10k steps per day ? Train 3 days a week @ Sleep 8 hours a night

Slide 93

Slide 93 text

A Yearly B Monthly 
 C Weekly 
 D Daily

Slide 94

Slide 94 text

E Top priority F G Second priority H I Third priority J ⏺ Something else ⏺ Something else ⏺ Something else F Priority

Slide 95

Slide 95 text

E Top priority F G Second priority H I Third priority J ⏺ Something else ⏺ Something else ⏺ Something else F Priority

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

E Status of goals G What went well? I What could have been done better? L What are the goals and plans for next week? M Weekly Review

Slide 98

Slide 98 text

Books

Slide 99

Slide 99 text

The Pragmatic Programmer Getting Things Done The Checklist Manifesto Soft Skills Peak Performance

Slide 100

Slide 100 text

Recap

Slide 101

Slide 101 text

“Every productivity system stops working eventually and there’s nothing you can do about it” - Someone on the internet

Slide 102

Slide 102 text

“Think about your own workflows and improve them one step of the time/” - Rado

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

Thanks :

Slide 107

Slide 107 text

https://speakerdeck.com/rstankov