Robotlegs 2 and your brain
Upcoming SlideShare
Loading in...5
×
 

Robotlegs 2 and your brain

on

  • 10,094 views

Extended slide deck of my September 2011 Flash on the Beach presentation "Robotlegs 2 and your brain - a great developer toolchain". ...

Extended slide deck of my September 2011 Flash on the Beach presentation "Robotlegs 2 and your brain - a great developer toolchain".

The presentation asks the question - what do programmers need to know about how their brains work? And how did we employ cognitive and neuroscience to make decisions about version 2 of the Robotlegs ActionScript framework.

If you're brand new to Robotlegs then the coverage of the workings of Robotlegs 1 are likely to be insufficient - I'd suggest picking up a copy of ActionScript Developers Guide to Robotlegs first.

More details are available at www.robotlegs.org

Statistics

Views

Total Views
10,094
Views on SlideShare
6,804
Embed Views
3,290

Actions

Likes
16
Downloads
128
Comments
2

13 Embeds 3,290

http://www.xxcoder.net 3041
http://lanyrd.com 106
http://paper.li 53
http://www.linkedin.com 38
http://www.linkedin.com 38
http://www.unisinos.br 4
http://us-w1.rockmelt.com 3
http://www.mefeedia.com 2
http://tweetedtimes.com 1
http://protons 1
http://translate.googleusercontent.com 1
http://translate.googleusercontent.com 1
http://www.xxcoder.net} {1384927752|||pingback 1
More...

Accessibility

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Great Robotlegs Example. The dependency injection is functional, but non-native.

    Adobe's Flash Platform roadmap is out! Included are ActionScript 4.0 revelations. From a language design standpoint, Adobe uses the following assumptions as a guide for next-generation ActionScript development; a) longterm productivity, b) high performance, & c) hardware utilization.

    What would Robotlegs developers love to see in AS4? Native dependency injection?

    READ ALL THE DETAILS!
    http://www.rivellomultimediaconsulting.com/actionscript-4-revealed/
    Are you sure you want to
    Your message goes here
    Processing…
  • i like the Steve Jobs one point per slide + imagery influence. I used it on my latest deck (not currently up) as well. Nice.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Robotlegs 2 and your brain Robotlegs 2 and your brain Presentation Transcript

  • Robotlegs 2 and Your Brain Stray (Lindsey Fallow) @stray_and_ruby xxcoder.net 1
  • Stray (Lindsey Fallow) @stray_and_ruby xxcoder.net Ruby Stray 2
  • Team Robotlegs Joel Hooks Ro botlegs Core Robot legs or iginator Signals Shaun Smith Robert Penner Till Schneidereit Swiftsuspendersand me, Stray (behind camera) 3
  • +[robotlegs 2] 4
  • What we’ll cover [robotlegs 2] ? ? ? 5
  • A robotlegs pomodoro timer (FOTB attendees won these)You’ll need a pen and paper for exercises 6
  • STOPJARGON FREE ZONE 7
  • “Dependency Injection” We’ll try not to terms like this w use ithout explaining them. 8
  • What is Robotlegs? “ActionScript 3 framework”[robotlegs] Doesn’t really tell us much. 9
  • What do we meanby “framework”? 10
  • What do we meanby “framework”? A framework is a tool 11
  • What do we meanby “framework”? Take 30 seconds to A framework is a tool list as many things as you can think of that you could do with this tool. 12
  • What do we meanby “framework”? A framework is a toolMost people would say that this is a better screwdriver, but howmany things on your list can’t be done with this tool? 13
  • I used the correct size of screwdriver for this screw.Using the wrong tool can be I used the wrongfrustrating, or - worse - it can size of screwdriverresult in the work becoming for this screw.‘broken’ beyond repair. 14
  • Write down yourdevelopment toolset 15
  • You probably included some of these. 16
  • Your toolset includes your brain17
  • Most developers know almost nothing about the mostimportant part of their toolset. 18
  • :~ man brain 19
  • :~ man brain> No manual entry for ‘brain’ 20
  • Your brain is a legacy system 21
  • Your brain is a legacy system If you were designing a system for writing software you wouldn’t start with the human brain. 22
  • “The triune brain” Problem solving brain Mammal brain (neo-cortex)Lizard brain (limbic system)(brain stem)
  • Your lizard brain takes care of basic ‘staying alive’ impulses such as breathing.24
  • Your mammal brain (limbic-system) allows you to formattachments, cooperate and live alongside your peers. 25
  • Your mammal brain evolvedbefore we had language, so its influence on you is mostlychemical - you ‘feel’ messages from your limbic-system. 26
  • Your problem-solving brain is aminor additionto the olderbrain structurethat supports it.
  • We care about the brain because - as with any tool - we need to know: What is your brain good at?What is your brain not good at?
  • What is your brain good at? Simple mental arithmetic
  • What is your brain good at? Estimating 30 seconds Simple mental arithmetic
  • What is your brain good at? Estimating 30 seconds while doing Simple mental arithmetic
  • Start a stopwatch, then make a list of thesquares of prime numbers starting from 2, and try to estimate 30 seconds passing.
  • GO!
  • Multi-tasking FTL! Our lizard brain is fine at multi- tasking, but our problem-solvingbrain isn’t. When we try to multi- task our performance in evensimple tasks dramatically reduces.
  • Architecture & Coding are different tasks Using Robotlegs should allow you to focus more cleanly on one or the other. When you’re coding a class, thoughts about architecture shouldn’t be intruding.
  • Working memory• The ‘RAM’ we use to hold things in mind in order to solve a problem.• Items stored in working memory are regularly garbage collected - you won’t remember them later.• Programmers rely heavily on working memory when carrying concepts within and between classes.
  • Working memory test Give yourself 30 seconds to commit the following list of words to memory, and then move to the next slide.
  • Working memory testrefugee mill architectquilt mermaid pimpleweather salary walletlaundry tram verseinternet athletics thundereyebrow nurse spacechess seal eggflight stamp system
  • Working memory test Now write down as many as you can remember. Order is not important. Give yourself 30 - 60 seconds.
  • Working memory test Check your answers.refugee mill architectquilt mermaid pimpleweather salary walletlaundry tram verseinternet athletics thundereyebrow nurse spacechess seal eggflight stamp system
  • Working memory test Most people remember 6 - 9 words. I’m now going to challenge you to remember more than twice as many, from a different list of 25. Again, give yourself 30 seconds to memorise them, and then move to the next slide.
  • Working memory test 25 words - 30 secondsWar and peace Nobody does it betterOver the rainbow Love and warCats and dogs I’ll be backNight before Christmas ctrl, alt, delete
  • Working memory test 25 words - 30 seconds Now write down as many as you can remember. Order is not important. Give yourself 30 - 60 seconds.
  • Working memory test 25 words - 30 seconds Check your answers - count every word that you got correct.War and peace Nobody does it betterOver the rainbow Love and warCats and dogs I’ll be backNight before Christmas ctrl, alt, delete
  • Chunking FTW! Your working me7±2 of 7 ‘plus or min mory consists us 2’ chunks
  • Chunking is like ‘zip’ for your working memory up and Mickey down Mouse nurse 747 7 7,8,9 A chunk can be a single A chunk can be a word or number sequence, set or pattern that you have met before
  • Chunking uses neural networks Peace Pipes War Repeated simultaneous firing of individual neurons creates connections between them. Triangle Euclid Love
  • “What fires together, wires together!” Peace Pipes War Triangle Euclid Love
  • If you wrote crap code today,you hard wired your brain to ... 49
  • If you wrote crap code today,you hard wired your brain to find it easier to write crap code tomorrow. 50
  • Chunking and RobotlegsWe want Robotlegs to occupy as few chunks aspossible, leaving most of your working memoryfree to tackle your specific problem.
  • Are you bored yet?If you are, this presentation isn’t causingyou to create enough dopamine. 52
  • DopamineDopamine is a neurotransmitter. Like engine oil foryour brain. It helps you to stay on task and alsomakes you more effective at problem solving. 53
  • DopamineDistracted Focussed 54
  • Dopamine Vicious Circle - not enough dopamine => distracted, unproductive, prone to mistakes, slow progress => Virtuous Circle - plenty lower dopamine. dopamine => focussed, productive, insightful, fast progress => more dopamine.Distracted Focussed 55
  • Dopamine is key topattern recognition Helps you find ‘the zone’ and stay there 56
  • You noticed that some of theseshapes were different, withoutdeciding to look for differences.We call this ‘pre-attentive’ processing. Helps you find ‘the zone’ and stay there 57
  • Give yourself 6 seconds to estimate the number oftriangles in the next picture 58
  • 59
  • how many triangles? 60
  • how many triangles? Answer = Zero(to see why, flick back and forth between the next 2 slides) 61
  • 62
  • 63
  • Our brain craves patternsTo the extent that we’ll findthem even when they’re notreally there. 64
  • Cognitive dissonanceThe feeling that“Something doesn’t fit”.That ‘feeling’ is a dropin dopamine. 65
  • Dopamine Cognitive dissonance Time 66
  • Cognitive dissonance canbe meaningful and directingFighter pilots rely on it for rapidly detecting problems.It can also tell you that something is wrong with your code. 67
  • Cognitive dissonance can bemeaningless and distracting Event.ADDED Event.COMPLETE To me, it feels like there’s something wrong when I mix cases in event types. 68
  • Meaningful, directing vsMeaningless, distracting 69
  • Meaningful, directing In order to tune in to this, we need to limit the amount of cognitive vs dissonance the Robotlegs framework triggers.Meaningless, distracting 70
  • Dopaminevariation FTW & FTL!
  • Have you everwritten code that was like this?
  • Great solution,wrong problem.
  • Great solution, wrong problem. It’s a really lovely yoda suit for adog, but who needs one of those?
  • ‘Right execution of the wrong thing’ happens when one half of our brain dominates decision making. Left brain Right brain(right hand) (left hand) 75
  • A brain of two halves Left brain Right brain(right hand) (left hand) • Specific • Context • Details • Big picture • Calculation • Estimation 76
  • Programming is whole-brain problem solving Left brain Right brain(right hand) (left hand) “How to do it right” “The right thing to do” Emerges as specific Emerges as somatic thoughts (body) feelings 77
  • Metaphors triggerwhole brain activity +(Which is why we talked about Yoda-suits for dogs) 78
  • Metaphors triggerwhole brain activity +(And why Robotlegs 2 will try to give things descriptive names) 79
  • Brain Summary• Avoid multi-tasking• Take advantage of chunking• Dopamine is key to staying in flow• Make cognitive dissonance meaningful• Programming is a ‘whole brain’ activity• Metaphor activates the ‘whole brain’ 80
  • Brain questions?81
  • What is Robotlegs? “ActionScript 3 framework”[robotlegs] 82
  • What is Robotlegs? “ActionScript 3 communication, cooperation, and configuration framework”[robotlegs] 83
  • Writing code is easy Very clever class that gets and A menu A really sends data to accepting user tasty view and from a input server A clever class that checks whether Another reallyA quite simple tasty viewclass that does input is validstuff with XML 84
  • Joining code together is hard Very clever class that gets and A menu A really sends data to accepting user tasty view and from a input server A clever class that checks whether Another reallyA quite simple tasty viewclass that does input is validstuff with XML 85
  • A “dependency” is just a need touse an instance of another object for communication, cooperation, or configuration 86
  • “Dependency Injection”var kittenPath:String = “http://kittens978.com/feed.xml”;var kittenRequest:URLRequest = new URLRequest(kittenPath);_kittenLoader = new URLLoader(kittenRequest); 87
  • “Dependency Injection”var kittenPath:String = “http://kittens978.com/feed.xml”;var kittenRequest:URLRequest = new URLRequest(kittenPath);_kittenLoader = new URLLoader(kittenRequest); 88
  • DI can lead to a lot of “pass the parcel code”Animation timing View class that has nothing to do with timing, or feeds, but creates and contains the animation and the menu Feed details Animation class Menu class that that times the displays feeds to fading of images the user 89
  • Static Singletons One approach to solving the ‘pass the parcel’ dependency chain problem. 90
  • Static SingletonsSuck• ImposeSingleton class on the extra responsibilities• Impose extra knowledge on the using class• Very difficult to vary and test corner cases 91
  • The Robotlegs dream:Dependency Inception Feed details 92
  • The Robotlegs dream:Dependency Inception A an object inside an object inside an object inside an object... and Feed details nobody knows how it got there - it just appeared. 93
  • To declare a dependency [Inject] public var importantCollaborator:ICollaboratorClass; 94
  • Injections recipe Class with Injected [Inject] objectrequirements The Robotlegs Injector is just a factory 95
  • Injection opens up possibilities• Communication via a shared eventDispatcher instance• “Mediators” - connecting (dumb) views to your application• The Command Pattern 96
  • Shared eventDispatcher -broadcast events to your app Some Some other Some Some service service model other model 97
  • Mediators for individual views View Mediator 98
  • Commands are snack-sizecontrollers, triggered by events Feed Loader Service FeedSelectorEvent.Mediator FEED_SELECTED Command with [Inject] requirements 99
  • Again: Injection is not magic• The Injector is just a factory• It needswithbe pre-advised about how to deal to injection requests 100
  • How to tell the injector what to doinjector.mapSingletonOf(IFeedService, XMLFeedService);injector.mapValue(IFeedConfig, new DefaultFeedConfig()); 101
  • Robotlegs 1 - Feature recap• [Inject] dependencies• Shared eventDispatcher• Mediators automatically created & destroyed for views• Commands mapped to events 102
  • Robotlegs questions?[robotlegs] 103
  • +[robotlegs 2] 104
  • Robotlegs uses ‘Semantic versioning’• Point releases must be backward compatible - eg 1.3 can be dropped in to an application previously using 1.2, without breakages.• Major releases (eg 2.0 vs 1.0) can rewrite the API.• This gives us great freedom in terms of Robotlegs 2.0• but... 105
  • Neural networks do not adhereto semantic versioning 106
  • So, everything you alreadyunderstand about Robotlegs will remain the same. 107
  • We looked onthe robotlegsforums for thethings that madeyou feel likethis... 108
  • Using mediators as view controllers 109
  • Unclear mapping syntaxinjector.mapClass(IFeedConfig, FeedConfig); 110
  • Lack of symmetryaddViewListener(MouseEvent.CLICK, handleSubmit);removeViewListener(MouseEvent.CLICK, handleSubmit); 111
  • Lack of symmetryaddViewListener(MouseEvent.CLICK, handleSubmit);removeViewListener(MouseEvent.CLICK, handleSubmit); This function doesn’t exist 112
  • Annoying to mix utilitiespublic class MyContext extends RelaxedSignalModuleStatefulContext 113
  • Modular feels hard 114
  • In unfamiliar territory, we canlose our ‘right brain’ context.We feel lost.New and upgrading users wanta quick push in the rightdirection. 115
  • 4 new Robotlegs 2 ‘flavours’ PerformanceFast Flexible Clean 116
  • Choose one to start your project PerformanceFast Flexible Clean 117
  • DISCLAIMERthis.api.is(UNDER_CONSTRUCTION); 118
  • Fluent context buildercontextBuilder.installUtility(CommandMap) .installUtility(ConfigLoader) .installUtility(ViewManager) .installUtility(SignalCommandMap) .withConfiguration(XMLMappings) .build(); 119
  • Fluent mappingsinjector.asSingleton.map(IFeedService).to(XMLFeedService);viewManager.handle(FeedMenu) .mediateWith(FeedMenuMediator); 120
  • Chunking in Robotlegs 2? “Guards and Hooks” 2 Simple ideas add a lot of functionality 121
  • Guards prevent/allow action Feed Loader Service FeedSelectorEvent. Command withMediator FEED_SELECTED [Inject] requirements 122
  • Guards prevent/allow action Feed Loader Service Sufficient Command with FeedSelectorEvent. Network [Inject] requirementsMediator FEED_SELECTED Capacity Guard Feed Status Fallback Command 123
  • Hooks support collaborationView Mediator Menu Skinner Hook View and a skinning factory are injected into the hook. 124
  • Hooks support collaborationView Mediator View Logic Wiring Hook View and a logic factory are injected into the hook. 125
  • Many-mediators-per-view Enemy Spaceship EnemySpaceship Mediator Mediator View 126
  • Descriptive type matchingISpaceship IPlayer Spaceship ✓ ✗ Mediator IEnemy IBoss Enemy ✓ ✗ Mediator 127
  • var enemyMatcher:TypeMatcher = matcherFor(ISpaceship) .and(IEnemy) .not(IBoss) .andNot(IEnemyGhost); 128
  • View manager:have your cake and eat it Awesome Utility Mediator Map View Map Map Stage Never more than one listener for a stage event 129
  • Wow, I thought we weresomewhere totally different 130
  • Imagine every stop is a state of your app. Confused?131
  • Grouping control flow can help youCommand Flows follow state changes more easily. 132
  • Rule setsInjections recipe Injections recipe Rules applied and removed in response to events. 133
  • Less cognitive dissonance, more flow We often create big classes with multiple responsibilities in order to create a sense of flow. 134
  • Less cognitive dissonance, more flowRobotlegs can help you stayin flow even when workingwith larger numbers ofsmaller classes.And speaking of separatingresponsibilities... 135
  • Modular just works“everything is a module” 136
  • “Soft” mappings Excuse me, if Injections recipe nobody else has already created a mapping for this, then I’ll oblige. Allows you to use thismodule stand-alone or in combination with other Robotlegs modules. Without recompiling! 137
  • The InspectorGadgetYour code de 138
  • The InspectorGadget“This injection point looks broken” 139
  • The InspectorGadget“This Command never executed” 140
  • The InspectorGadget“This is the order in whichobjects were instantiated” 141
  • Robotlegs 2: Feature overview• Build your context - have it your way • Rule sets• Fluency / mxml • Multiple mediators• 4 Robotlegs ‘flavours’ • Type matchers• Command flows • The InspectorGadget• Mix view management strategies • Modular just works 142
  • Release process• Alpha releases: API still in flux• Beta releases: API locked, future proof• One feature at a time• Match v1 Feature set• As fast as we can! 143
  • [robotlegs 2]www.robotlegs.org 144
  • Robotlegs 2 questions?[robotlegs 2] 145