Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Thinking Different by Saul Mora

Realm
February 19, 2015
10k

Thinking Different by Saul Mora

Presented to the Swift Language User Group Meetup.

Realm

February 19, 2015
Tweet

Transcript

  1. What can you do in Swift that you couldn’t have

    done in Objective C? (audience participation requested)
  2. – B R E T V I C T O

    R A (programming) language must be parsed by people, not just compilers
  3. – M E , J U S T N O

    W You can write bad code in any language.
  4. Swift Objective C Namespaces ✔ First Class Functions ✔ Operator

    Overloading ✔ Full Unicode Strings ✔ ✔* Dynamic Dispatch ✔
  5. Modern Swift Objective C Semicolons ✔ Curly Braces ✔ ✔

    Confusing square brackets ✔ ✔ Emoji Variable Names ✔ Modern ✔
  6. – M O D E R N P R O

    G R A M M I N G L A N G U A G E D E F I N I T I O N A programming language that implements new and recently developed language syntax, tools and ideas as primary characteristics.
  7. – J O H N N Y B R O

    G R A M M E R Dude, naw, it’s a programming language that doesn’t suck like Objective C, brah! True story…
  8. joy lda SWCHA ;load joysticks! ora #$0f ;strip the data

    for player #2 joystick! cmp #$ef ;up! beq up! cmp #$df ;down! beq down! cmp #$bf ;left! beq left! cmp #$7f ;right! beq right! lda #$00 ;no movement! sta JOYDEL ;reset the joystick delay variable! lda #$01 ;reset the first move variable! sta JOY1ST! jmp oscan ;finish off the overscan! ! up lda HOURS ;check to see if we've run out our hours! cmp #$01! beq oscan ;yep, then ignore the movement! inc JOYDEL ;increase the joystick delay variable! lda JOY1ST ;check to see if this is the first move in this! cmp #$01 ;direction.! beq now1 ;if it is then change the variable now! lda #$1E ;nope then see if there's been enough of a delay! cmp JOYDEL ;to change the variable yet.! bne oscan! now1 lda #$00 ;reset the joystick delay and set the first move! sta JOY1ST ;indicator to "no"! sta JOYDEL! dec HOURS ;decrease the hours counter! jmp oscan
  9. What should we ask Swift to do, that would be

    hard or impossible in Objective C?