Career Advice For Young Grasshoppers (or I whish someone - - PowerPoint PPT Presentation

career advice for young grasshoppers
SMART_READER_LITE
LIVE PREVIEW

Career Advice For Young Grasshoppers (or I whish someone - - PowerPoint PPT Presentation

www.applied-duality.com Career Advice For Young Grasshoppers (or I whish someone told me this 30 years ago) IOBservable<IObservable<Experience>> career


slide-1
SLIDE 1

www.applied-­‑duality.com ¡

slide-2
SLIDE 2

Career ¡Advice ¡For ¡Young ¡Grasshoppers ¡

(or ¡I ¡whish ¡someone ¡told ¡me ¡this ¡30 ¡years ¡ago) ¡

slide-3
SLIDE 3
slide-4
SLIDE 4

IOBservable<IObservable<Experience>> ¡ career ¡ ¡ ¡= ¡life.Window(TimeSpan.FromYears(10)); ¡

child ¡ teenager ¡ student ¡ academic ¡ architect ¡ founder ¡

slide-5
SLIDE 5

child ¡ teenager ¡ student ¡ academic ¡ architect ¡ founder ¡

Causality ¡

denota<onal ¡ seman<cs ¡ category ¡theory ¡ Haskell ¡ Web ¡ programming ¡ C# ¡ Rx, ¡Ix, ¡Ax ¡ Solve ¡ the ¡real ¡ problems ¡ Play ¡ ¡ let's ¡not ¡ ¡talk ¡ about ¡this ¡ Mike ¡Lee's ¡"One ¡Minute" ¡Keynote ¡ Henk ¡Barendregt ¡on ¡Buddhism ¡

slide-6
SLIDE 6

Ideas ¡ ¡ you ¡ ¡ produce ¡ What ¡ your ¡ environment ¡ can ¡absorb ¡

  • verflow ¡

excep<on ¡

slide-7
SLIDE 7

Amount ¡

  • f ¡coding ¡

Amount ¡

  • f ¡mee<ngs ¡

fail ¡ succeed ¡

slide-8
SLIDE 8

$$$$$ ¡ janitor ¡ senior ¡ principal ¡ partner ¡ VP ¡ Ability ¡ ¡ to ¡do ¡crazy ¡shit ¡

slide-9
SLIDE 9

Data ¡ Compute ¡ Cloud ¡

slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12

Scien<fic ¡method ¡has ¡been ¡prac<ced ¡in ¡ some ¡form ¡for ¡at ¡least ¡one ¡thousand ¡years [4] ¡and ¡is ¡the ¡process ¡by ¡which ¡science ¡is ¡ carried ¡out. ¡Because ¡science ¡builds ¡on ¡ previous ¡knowledge, ¡it ¡consistently ¡ improves ¡our ¡understanding ¡of ¡the ¡world. ¡ The ¡scien<fic ¡method ¡also ¡improves ¡itself ¡ in ¡the ¡same ¡way, ¡meaning ¡that ¡it ¡gradually ¡ becomes ¡more ¡effec<ve ¡at ¡genera<ng ¡new ¡

  • knowledge. ¡For ¡example, ¡the ¡concept ¡of ¡

falsifica<on ¡(first ¡proposed ¡in ¡1934) ¡ reduces ¡confirma<on ¡bias ¡by ¡formalizing ¡ the ¡aEempt ¡to ¡disprove ¡hypotheses ¡ rather ¡than ¡prove ¡them. ¡

Ibn ¡al-­‑Haytham ¡(Alhazen), ¡ ¡ 965–1039 ¡Iraq. ¡

What ¡shall ¡we ¡falsify ¡today? ¡

slide-13
SLIDE 13

Does ¡your ¡data ¡really ¡look ¡like ¡this? ¡

slide-14
SLIDE 14

Modelers ¡ Developers ¡

slide-15
SLIDE 15

Modelers ¡== ¡Nouns ¡

DECLARE ¡Customers ¡TABLE ¡ ¡ ¡(ID ¡int ¡PRIMARY ¡KEY, ¡…) ¡ DECLARE ¡Orders ¡TABLE ¡ ¡ ¡(ID ¡int ¡PRIMARY ¡KEY, ¡CID ¡int ¡ REFERENCES ¡Customers(ID), ¡…) ¡ DECLARE ¡LineItems ¡TABLE ¡ ¡ ¡(ID ¡int ¡PRIMARY ¡KEY, ¡OID ¡int ¡ REFERENCES ¡Orders(ID), ¡…) ¡

slide-16
SLIDE 16

Customers ¡ Orders ¡ LineItem ¡

No ¡abstrac*on ¡ ¡ Need ¡ in*mate ¡ knowledge ¡ to ¡do ¡joins ¡ Hard ¡to ¡get ¡a ¡single ¡ value ¡ ¡ Sta*cally ¡typed ¡

slide-17
SLIDE 17

SELECT ¡ ¡ ¡Customer, ¡ ¡ ¡LineItem.Category, ¡ ¡ ¡Sum(LineItem.Price) ¡ FROM ¡ ¡ ¡Customers, ¡Orders, ¡LineItems ¡ WHERE ¡ ¡ ¡Customers.ID ¡= ¡Orders.CID ¡ ¡ AND ¡ ¡ ¡Orders.ID ¡= ¡LineItems.OID ¡ GROUP ¡BY ¡ ¡ ¡LineItem.Category ¡

"Declara*ve" ¡

slide-18
SLIDE 18

WITH ¡RECURSIVE ¡temp ¡(n, ¡fact) ¡AS ¡ ¡ ¡(SELECT ¡0, ¡1 ¡ ¡ ¡ ¡ ¡UNION ¡ALL ¡ ¡ ¡ ¡ ¡SELECT ¡n+1, ¡(n+1)*fact ¡ ¡ ¡ ¡ ¡FROM ¡temp ¡ ¡ ¡ ¡WHERE ¡n ¡< ¡9) ¡ SELECT ¡* ¡FROM ¡temp; ¡

"Declara*ve" ¡

slide-19
SLIDE 19
slide-20
SLIDE 20

Sta*c ¡ No ¡call ¡stack ¡ No ¡recursion ¡(typically) ¡ Dataflow ¡"engine" ¡

slide-21
SLIDE 21

Term Description Atomic ¡ Either ¡all ¡of ¡the ¡opera<ons ¡in ¡the ¡ transac<on ¡succeed ¡or ¡none ¡of ¡the ¡

  • pera<ons ¡persist. ¡

Consistent ¡ If ¡the ¡data ¡are ¡consistent ¡before ¡the ¡ transac<on ¡begins, ¡then ¡they ¡will ¡be ¡ consistent ¡ader ¡the ¡transac<on ¡finishes. ¡ Isolated ¡ The ¡effects ¡of ¡a ¡transac<on ¡that ¡is ¡in ¡ progress ¡are ¡hidden ¡from ¡all ¡other ¡ transac<ons. ¡ Durable ¡ When ¡a ¡transac<on ¡finishes, ¡its ¡results ¡are ¡ persistent ¡and ¡will ¡survive ¡a ¡system ¡crash. ¡

slide-22
SLIDE 22

SET ¡TRANSACTION ¡ISOLATION ¡LEVEL ¡ ¡ ¡ ¡ ¡{ ¡READ ¡UNCOMMITTED ¡ ¡ ¡ ¡ ¡| ¡READ ¡COMMITTED ¡ ¡ ¡ ¡ ¡| ¡REPEATABLE ¡READ ¡ ¡ ¡ ¡ ¡| ¡SNAPSHOT ¡ ¡ ¡ ¡ ¡| ¡SERIALIZABLE ¡ ¡ ¡ ¡ ¡} ¡

slide-23
SLIDE 23

The ¡closed ¡world ¡ assump<on ¡is ¡the ¡ presump<on ¡that ¡what ¡is ¡ not ¡currently ¡known ¡to ¡ be ¡true ¡is ¡false. ¡ ¡

slide-24
SLIDE 24

The ¡fallacies ¡of ¡Distributed ¡ Compu<ng ¡

  • 1. The ¡network ¡is ¡reliable. ¡
  • 2. Latency ¡is ¡zero. ¡
  • 3. Bandwidth ¡is ¡infinite. ¡
  • 4. The ¡network ¡is ¡secure. ¡
  • 5. Topology ¡doesn't ¡change. ¡
  • 6. There ¡is ¡one ¡administrator. ¡
  • 7. Transport ¡cost ¡is ¡zero. ¡
  • 8. The ¡network ¡is ¡homogeneous. ¡

The ¡fallacies ¡of ¡Declara<ve ¡ Compu<ng ¡

  • 1. Excep<ons ¡do ¡not ¡exist. ¡
  • 2. Sta<s<cs ¡are ¡precise. ¡
  • 3. Memory ¡is ¡infinite. ¡
  • 4. There ¡are ¡no ¡side-­‑effects. ¡
  • 5. Schema ¡doesn't ¡change. ¡
  • 6. There ¡is ¡one ¡developer. ¡
  • 7. Compila<on ¡<me ¡is ¡free. ¡
  • 8. The ¡language ¡is ¡homogeneous. ¡
slide-25
SLIDE 25

A ¡RDMS ¡can ¡do ¡all ¡its ¡magic ¡ precisely ¡because ¡it ¡ assumes ¡a ¡closed ¡word! ¡

slide-26
SLIDE 26

Just ¡give ¡me ¡ ¡ your ¡B-­‑tree ¡ and ¡I'll ¡be ¡happy ¡

(leaky ¡abstrac<ons ¡are ¡a ¡GOOD ¡THING) ¡

slide-27
SLIDE 27

The ¡"real" ¡world ¡is ¡open ¡

slide-28
SLIDE 28

The ¡opposite ¡of ¡the ¡ closed ¡world ¡assump<on ¡ is ¡the ¡open ¡world ¡ assump<on, ¡sta<ng ¡that ¡ lack ¡of ¡knowledge ¡does ¡ not ¡imply ¡falsity. ¡

slide-29
SLIDE 29

Programming, ¡ Motherfucker ¡ Do ¡you ¡speak ¡it? ¡

hkp://programming-­‑motherfucker.com/ ¡

slide-30
SLIDE 30

¡ ¡Intermezzo ¡ (by ¡popular ¡demand) ¡

slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34

Gumball ¡

lgebra ¡

slide-35
SLIDE 35

Remove ¡

.Result ¡

slide-36
SLIDE 36

Once ¡out, ¡Never ¡in ¡

slide-37
SLIDE 37

.Select( ¡ ¡ ¡ ¡ ¡) ¡

slide-38
SLIDE 38

Never ¡ underes<mate ¡ the ¡power ¡of ¡the ¡ magic ¡ pony ¡

slide-39
SLIDE 39

Franchise ¡

slide-40
SLIDE 40

.Select(…) ¡ .Franchise() ¡

ContinueWith ¡

slide-41
SLIDE 41

.ContinueWith() ¡

slide-42
SLIDE 42

Gumball ¡Machines ¡ are ¡comonads! ¡

S ¡Result<S>( ¡ ¡ ¡xs) ¡ S ¡ ¡ ¡ ¡ContinueWith<S,T>( ¡ ¡ ¡ ¡xs, ¡ ¡ ¡ ¡ ¡ ¡Func< ¡ ¡ ¡ ¡,T> ¡continuation) ¡ ¡ ¡ ¡ ¡ ¡ S ¡ S ¡ T ¡

slide-43
SLIDE 43

IEnumerable<S> ¡Singleton<S>( ¡ ¡ ¡S ¡item) ¡ S ¡Result<S> ¡Result( ¡ ¡ ¡Task<T> ¡task) ¡ IEnumerable<T> ¡SelectMany<S,T>( ¡ ¡ ¡IEnumerable<S> ¡src, ¡ ¡ ¡ ¡Func<S, ¡IEnumerable<T>> ¡selector) ¡ Task<T> ¡ContinueWith<S,T>( ¡ ¡ ¡Task<S> ¡src, ¡ ¡ ¡ ¡Func<Task<S>, ¡T> ¡continuation) ¡

slide-44
SLIDE 44

End ¡of ¡Intermezzo ¡

slide-45
SLIDE 45

Developers ¡== ¡Verbs ¡

“… ¡An ¡object ¡can ¡also ¡offer ¡simple-­‑to-­‑use, ¡standardized ¡ methods ¡for ¡performing ¡par<cular ¡opera<ons ¡on ¡its ¡ data, ¡while ¡concealing ¡the ¡specifics ¡of ¡how ¡those ¡tasks ¡ are ¡accomplished. ¡In ¡this ¡way ¡altera0ons ¡can ¡be ¡made ¡ to ¡the ¡internal ¡structure ¡or ¡methods ¡of ¡an ¡object ¡without ¡ requiring ¡that ¡the ¡rest ¡of ¡the ¡program ¡be ¡modified.” ¡ "Impera*ve" ¡ "Abstrac*on" ¡

slide-46
SLIDE 46

class ¡Dictionary<K,V> ¡ ¡ : ¡IDictionary<K,V> ¡ , ¡ICollection<KeyValuePair<K,V>> ¡ , ¡IEnumerable<KeyValuePair<K,V>> ¡ , ¡IDictionary ¡ , ¡ICollection ¡ , ¡IReadOnlyDictionary<K,V> ¡ , ¡IReadOnlyCollection<KeyValuePair<K,V>> ¡ , ¡IEnumerable ¡ , ¡Iserializable ¡ , ¡IDeserializationCallback ¡ Single-­‑core ¡

slide-47
SLIDE 47

Name ¡ Descrip<on ¡ Comparer ¡ Gets ¡the ¡IEqualityComparer<T> ¡that ¡is ¡used ¡ to ¡determine ¡equality ¡of ¡keys ¡for ¡the ¡ dic<onary. ¡ Count ¡ Gets ¡the ¡number ¡of ¡key/value ¡pairs ¡ contained ¡in ¡the ¡Dic<onary<TKey, ¡TValue>. ¡ Item ¡ Gets ¡or ¡sets ¡the ¡value ¡associated ¡with ¡the ¡ specified ¡key. ¡ Keys ¡ Gets ¡a ¡collec<on ¡containing ¡the ¡keys ¡in ¡ the ¡Dic<onary<TKey, ¡TValue>. ¡ Values ¡ Gets ¡a ¡collec<on ¡containing ¡the ¡values ¡in ¡ the ¡Dic<onary<TKey, ¡TValue>. ¡

slide-48
SLIDE 48

Name ¡ Descrip<on ¡ Add ¡ Adds ¡the ¡specified ¡key ¡and ¡value ¡to ¡the ¡dic<onary. ¡ Clear ¡ Removes ¡all ¡keys ¡and ¡values ¡from ¡the ¡Dic<onary<K, ¡V>. ¡ ContainsKey ¡ Determines ¡whether ¡the ¡Dic<onary<K, ¡V> ¡contains ¡the ¡ specified ¡key. ¡ ContainsValue ¡ Determines ¡whether ¡the ¡Dic<onary<K, ¡V> ¡contains ¡a ¡ specific ¡value. ¡ Remove ¡ Removes ¡the ¡value ¡with ¡the ¡specified ¡key ¡from ¡ the ¡Dic<onary<K, ¡V>. ¡ TryGetValue ¡ Gets ¡the ¡value ¡associated ¡with ¡the ¡specified ¡key. ¡

slide-49
SLIDE 49

In ¡this ¡way ¡altera0ons ¡ can ¡be ¡made ¡to ¡the ¡ internal ¡structure ¡or ¡ methods ¡of ¡an ¡object ¡ without ¡requiring ¡that ¡ the ¡rest ¡of ¡the ¡program ¡ be ¡modified ¡

slide-50
SLIDE 50

class ¡ConcurrentDictionary<K,V> ¡ ¡ : ¡IDictionary<K,V> ¡ , ¡ICollection<KeyValuePair<K,V>> ¡ , ¡IEnumerable<KeyValuePair<K,V>> ¡ class ¡CloudDictionary<K,V> ¡ ¡ : ¡IDictionary<K,V> ¡ , ¡ICollection<KeyValuePair<K,V>> ¡ , ¡IEnumerable<KeyValuePair<K,V>> ¡ Mul*-­‑core ¡ Cloud ¡

Same ¡interface ¡ Different ¡implementa<on ¡

slide-51
SLIDE 51

Cloud.SortedList<int,Player> ¡highScores; ¡ highScores ¡= ¡Cloud.ConnectToList("…"); ¡ await ¡highScores.Add(100000, ¡me); ¡ var ¡top10 ¡= ¡await ¡highScores.TakeAsync(10); ¡

Collec<ons ¡As ¡A ¡Service ¡

slide-52
SLIDE 52

Commuta<ve ¡ Replicated ¡Data ¡ Types ¡ Redis ¡ KeptCollec<ons ¡ ? ¡

Can ¡we ¡have ¡our ¡collec<ons ¡ be ¡"allocated" ¡in ¡the ¡Cloud ¡ instead ¡of ¡in ¡the ¡heap ¡… ¡

slide-53
SLIDE 53

<Intermezzo ¡src="Google ¡Thialfi ¡team"> ¡

“Ini<ally, ¡we ¡had ¡no ¡client ¡library ¡whatsoever, ¡

  • p<ng ¡instead ¡to ¡expose ¡our ¡protocol ¡directly. ¡

Engineers, ¡however, ¡strongly ¡prefer ¡to ¡develop ¡ against ¡na<ve-­‑language ¡APIs. ¡And, ¡a ¡high-­‑level ¡API ¡ has ¡allowed ¡us ¡to ¡evolve ¡our ¡client-­‑server ¡protocol ¡ without ¡modifying ¡applica0on ¡code.” ¡

</Intermezzo> ¡

slide-54
SLIDE 54

<script> ¡ var ¡actor ¡= ¡ ¡ ¡ ¡ ¡{ ¡text ¡: ¡"hello" ¡ ¡ ¡ ¡, ¡speak ¡: ¡function() ¡{ ¡alert(this.text); ¡} ¡ ¡ ¡ ¡}; ¡ actor.speak(); ¡ actor.text= ¡"hello ¡YOW!"; ¡ actor.speak(); ¡ actor.speak ¡= ¡function(){ ¡alert(this.text+"!"); ¡}; ¡ actor["speak"](); ¡ </script> ¡

slide-55
SLIDE 55

JavaScript ¡Object ¡Model ¡

this ¡

name ¡: ¡value ¡ name ¡: ¡value ¡ name ¡: ¡value ¡ Mutable ¡ Code ¡== ¡data ¡ key-­‑value ¡pairs ¡

slide-56
SLIDE 56

this ¡ this ¡ this ¡ Intercept ¡all ¡state ¡changes ¡on ¡this ¡ Replicate ¡ for ¡high ¡ availability ¡

key-­‑value ¡store ¡

slide-57
SLIDE 57

In ¡this ¡way ¡altera0ons ¡ can ¡be ¡made ¡to ¡the ¡ internal ¡structure ¡or ¡ methods ¡of ¡an ¡object ¡ without ¡requiring ¡that ¡ the ¡rest ¡of ¡the ¡program ¡ be ¡modified ¡

slide-58
SLIDE 58

interface ¡IActorState ¡ { ¡ ¡ ¡ ¡void ¡Set(string ¡key, ¡dynamic ¡value); ¡ ¡ ¡ ¡dynamic ¡Get(string ¡key); ¡ ¡ ¡ ¡bool ¡TryGet(string ¡key ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡out ¡dynamic ¡value); ¡ ¡ ¡ ¡void ¡Delete(string ¡key); ¡ ¡ ¡ ¡Task ¡Replicate(); ¡ ¡ } ¡

Opera<ons ¡

  • n ¡this ¡
slide-59
SLIDE 59

interface ¡IActor ¡ { ¡ ¡ ¡ ¡ ¡dynamic ¡Eval ¡ ¡ ¡ ¡ ¡(Func<IActorState ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡dynamic[] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡dynamic ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡> ¡function ¡ ¡ ¡ ¡ ¡ ¡, ¡dynamic[] ¡parameters); ¡ } ¡

Mutate ¡this ¡

slide-60
SLIDE 60

actor.Eval ¡ ( ¡(that,ps)=>that.Set(ps[0],ps[1]) ¡ , ¡new ¡dynamic[] ¡ ¡ ¡{ ¡"speak" ¡ ¡ ¡, ¡(@this,_)=>@this.Get("text") ¡ ¡ ¡} ¡ ); ¡

actor.speak ¡= ¡function() ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡{ ¡return(this["text}]); ¡}; ¡

slide-61
SLIDE 61

[ActorMethod] ¡ static ¡dynamic ¡Speak ¡ ( ¡IActorState ¡@this ¡ , ¡dynamic[] ¡ps) ¡ { ¡ ¡ ¡ ¡return ¡@this.Get("text"); ¡ } ¡

actor.speak ¡= ¡function() ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡{ ¡return(this["text"]); ¡}; ¡

slide-62
SLIDE 62
slide-63
SLIDE 63

Does ¡that ¡sound ¡a ¡likle ¡like ¡how ¡databases ¡implement ¡transac<ons ¡;-­‑) ¡

slide-64
SLIDE 64
slide-65
SLIDE 65

Actor ¡

IObserver<Update> ¡ IObservable<Change> ¡

It ¡is ¡a ¡ Subject! ¡

slide-66
SLIDE 66

IObserver<Update> ¡ IObservable<Change> ¡ UI ¡is ¡a ¡subject ¡

slide-67
SLIDE 67

Apache ¡ Web ¡Server ¡

IObserver<Response> ¡ IObservable<Response> ¡ IObservable<Request> ¡ IObserver<Request> ¡

HTTP ¡

slide-68
SLIDE 68

A ¡

Query/Transform ¡ Subject ¡

B ¡ Q ¡ R ¡

Communica<ng ¡Stream ¡Processors ¡

Dart ¡ Javascript ¡ Objec<veC ¡ Java ¡ C# ¡

slide-69
SLIDE 69

… ¡but ¡for ¡developers ¡ ¡

slide-70
SLIDE 70
slide-71
SLIDE 71
slide-72
SLIDE 72
slide-73
SLIDE 73

A ¡ C ¡ Q ¡

Reac<ve ¡Message ¡Queue ¡(Qx) ¡ ¡

B ¡

Separate ¡ producer ¡and ¡ consumer ¡by ¡<me ¡ and ¡space ¡

slide-74
SLIDE 74
slide-75
SLIDE 75
slide-76
SLIDE 76

Pat ¡Helland ¡was ¡right ¡again! ¡

slide-77
SLIDE 77
slide-78
SLIDE 78

You ¡Are ¡The ¡Subject ¡

slide-79
SLIDE 79
slide-80
SLIDE 80
slide-81
SLIDE 81
slide-82
SLIDE 82
slide-83
SLIDE 83
slide-84
SLIDE 84
slide-85
SLIDE 85
slide-86
SLIDE 86
slide-87
SLIDE 87
slide-88
SLIDE 88
slide-89
SLIDE 89
slide-90
SLIDE 90
slide-91
SLIDE 91

this ¡ this ¡ this ¡ this ¡ this ¡ this ¡ this ¡ this ¡ this ¡

Composi<onal/fractal ¡

Rx ¡

slide-92
SLIDE 92
slide-93
SLIDE 93
slide-94
SLIDE 94
slide-95
SLIDE 95