Why I Ruby (Or: My First Program)

3d65a0bc911de24fde5e58d84b0276af?s=47 Liz
September 02, 2015

Why I Ruby (Or: My First Program)

I write Ruby because the community helped me be a successful beginner when I was struggling alone after more than 10 years of writing HTML & CSS and knowing no one else who wrote code. This talk is an ode to Ruby and the wonderful things we've done together, and a little flash back to my first program ever.

3d65a0bc911de24fde5e58d84b0276af?s=128

Liz

September 02, 2015
Tweet

Transcript

  1. why i ruby or: my first program liz abinante AKA

    @feministy wizard & slothologist by night software engineer at new relic by day
  2. preface slides are text-heavy so we can all follow along

  3. (brief) history of liz, vol. 1

  4. age 12: html & css the entire internet is ugly

    and there is no one to impress
  5. this works so well for me

  6. subtext: i used <blink> … a lot.

  7. subtext: i used <blink> … a lot.

  8. i made beautiful websites for 10+ years… alone

  9. for 10+ years i did not know anyone else who

    wrote code.
  10. i was perfectly happy about the state of things until

    i started learning more about technology.
  11. then, it was just doom. confusing, exciting doom.

  12. OMG WHAT EVEN IS THE INTERNET?

  13. i learned to program 2.5 years ago

  14. ruby was my first programming language

  15. why i ruby

  16. i learned ruby because there were people to help be

    a successful beginner
  17. i learned ruby because the community has done lots of

    small things that have big impact
  18. i learned ruby because i was never alone when i

    was a beginner
  19. it seemed to work out! i’m here, after all

  20. my first program

  21. something with logic. something with state.

  22. something with design requirements.

  23. something with a user interface of sorts.

  24. something that either works…

  25. or fails spectacularly

  26. so, what was it?

  27. thanks, internet: http://www.huffingtonpost.com/2013/11/26/tamagotchi-reboot_n_4339168.html

  28. TAMAGOTCHI!!!!!

  29. my first program was a PuppyGotchi

  30. d

  31. just look at it:

  32. class PuppyGotchi def initialize(name) @name = name @puppy_belly = 10

    @puppy_bladder = 0 @puppy_bowels = 0 @puppy_is_sleeping = true puts "Congrats! You are now the proud owner of #{@name}." end # ... end
  33. poopers = PuppyGotchi.new("Kiwi") poopers.feed_puppy poopers.puppy_bathroom_tinkle poopers.puppy_bathroom_poopy

  34. my awesome dog, kiwi

  35. how does the PuppyGotchi experience time?

  36. def passing_time if @puppy_belly >= 2 @puppy_belly = @puppy_belly -

    1 @puppy_bowels = @puppy_bowels + 1 @puppy_bladder = @puppy_bladder + 1 elsif @puppy_belly == 1 @puppy_is_sleeping = false else dead_puppy end if @puppy_bowels == 10 @puppy_bowels = 0 puts "#{@name} just took a huge deuce in your favorite suede shoes. That's what you get for leaving them out!" end if @puppy_bladder == 10 @puppy_bladder = 0 puts "#{@name} just went pee all over your $5,000 carpet. This is the definition of love. Go clean it up and learn from your mistakes." end if puppy_hungry? @puppy_is_sleeping = false puts "#{@name} wakes up and demands to be fed." end if puppy_poopy? @puppy_is_sleeping = false puts "#{@name} wakes up and urgently needs to poo." end if puppy_tinkle? @puppy_is_sleeping = false puts "#{@name} is awake! They need to pee. Really badly. You better get on that." end end
  37. def passing_time if @puppy_belly >= 2 @puppy_belly = @puppy_belly -

    1 @puppy_bowels = @puppy_bowels + 1 @puppy_bladder = @puppy_bladder + 1 elsif @puppy_belly == 1 @puppy_is_sleeping = false else dead_puppy end if @puppy_bowels == 10 @puppy_bowels = 0 puts "#{@name} just took a huge deuce in your favorite suede shoes. That's what you get for leaving them out!" end if @puppy_bladder == 10 @puppy_bladder = 0 puts "#{@name} just went pee all over your $5,000 carpet. This is the definition of love. Go clean it up and learn from your mistakes." end if puppy_hungry? @puppy_is_sleeping = false puts "#{@name} wakes up and demands to be fed." end if puppy_poopy? @puppy_is_sleeping = false puts "#{@name} wakes up and urgently needs to poo." end if puppy_tinkle? @puppy_is_sleeping = false puts "#{@name} is awake! They need to pee. Really badly. You better get on that." end end 5 conditionals el ol sorry, sandi
  38. the PuppyGotchi fails pretty spectacularly

  39. it usually dies because it needs constant care…

  40. … but also because the concepts of logic and math

    in programming were lost on me as a beginner
  41. positive note, though: this is exactly how a real tamagotchi

    behaved!
  42. we are always beginners

  43. when was the last time you learned a new programming

    language…
  44. and wrote something that was totally foolish,

  45. or ridiculously fun, or failed spectacularly?

  46. it’s scary to be a beginner at anything

  47. programmers are really smart, and we brag. a lot.

  48. all of the code books are perfect, beautiful code

  49. beginners don’t have the tools to write that code yet

  50. sharing your (adorable) mistakes makes learning more fun for beginners

  51. sharing your mistakes lets beginners see their future success in

    your past experiences
  52. ruby is better together

  53. here is your small thing to do:

  54. find your first program

  55. it can be the first program you ever wrote or

    from a new language you learned
  56. tweet it! NO EDITING. #myfirstprogram

  57. None
  58. for better or worse, all of my early programming

  59. #myfirstprogram share your code. help beginners to be awesome. show

    them what the ruby community is all about! THANK YOU!!!! @feministy