Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 797 Bytes

Ruby-Intro.md

File metadata and controls

44 lines (32 loc) · 797 Bytes

#Introduction to Programming

##What's a RubyGem?

gem list gem update --system gem update gem list

##How do we run a ruby file?

ruby ./hello.rb

##Why Ruby?

###Advantages of Ruby

  • It's object-oriented
  • It's a pure OO language
  • It's dynamic - you can change code during runtime
  • It's interpreted
  • It has a nice syntax
  • It's easier to learn

###ISO/IEC 3017:2012 this means they can't just change the ruby language. If they do they have to change the ISO too

##DRY (Don't Repeat yourself) adhere to best practices

####Demonstration

##Recap -Numbers -gets.chomp -variables

##Methods don't need brackets when calling a method never put empty brackets for methods that call no arguments we dont need the return keyword

####Demonstration ruby-doc.org rand(100) random number from 1 - 100