Showing posts with label Ruby Lesson. Show all posts
Showing posts with label Ruby Lesson. Show all posts

Wednesday, May 22, 2013

Ruby Lesson 2 Section 4 of 4 and Project: Review and Thith Meanth War!

I am going to take this time to reflect that these lessons are the foundations of Ruby. As such it is important to know 100% of what is being taught, not 99%. This is because any small holes in our knowledge now can easily destroy a program later on. Remember, it only takes one bad line of code to crash a program.

Monday, May 20, 2013

Ruby Lesson 2 Section 2 / 3 of 4: Making Comparisons and Boolean Operators

Double sections! I know you're excited =)

Section 2 Topics

  • Equal / Not Equal 
  • Less Than / Greater Than 

Sunday, May 19, 2013

Ruby Lesson 2 Section 1: Introduction to Control Flow

Section Topics 

  • Control Flow
  • expression / if 
  • else
  • elsif
  • unless
Control Flow gives us flexibility in the repsonse Ruby will return. Think about it like a do it yourself fantasy book where you given a story and choices. The story will change depending on the choices you  make. This is the same with control flow, Ruby will return a designated response (choosing which block of code to run) depending on the user input.

Saturday, May 18, 2013

Ruby Lesson 1 Project: Putting the Form in Formmatter

With the exception of Lesson 8, which is dubbed a challenge instead of of a course like the others, each lesson has a project to complete. These projects seem to incorporate much of what is learned throughout the lesson and add some new material as well. The posts on these projects will simply be about the new material presented. 

Materials Presented 
  • Prompting the User
  • gets 
  • .chomp
  • .capitalize
  • "!" 
  • "#{}" String Interpolation 

When looking for user input we would usually ask a questions like "How old are you?" or "What's your favorite color?" To display these questions we would input commands like the "puts" and "print". 

Tuesday, May 14, 2013

Ruby Lesson 1 Section 4 of 4 Review

Even though this is a review I learned something about methods. Originally I stated that we can have multiple methods on one line. While this is true Ruby will can have them on separate lines and it will have the same output.

Ruby Lesson 1 Section 3: Writing Good Code

Section Topics: 


  • Single-Line Comments
  • Multi-Line Comments
  • Naming Conventions 

Comments 


To start off, why do we need comments in coding? These are some of the reasons I can think of:

Ruby Lesson 1 Section 2 of 4: String Methods

Section Topics:


  • .length 
  • .reverse
  • .upcase and .downcase 

So methods are like commands except for the following (that I know of): 
  1. A period is used before a method 
  2. You can have more than one method on a line and Ruby will follow the sequence from left to right

Monday, May 13, 2013

Ruby Lesson 1 Section 1 of 4: Variables and Data Types

Section Topics:


  • Data Types: Numbers, Booleans, Strings
  • Variables 
  • Math
  • puts and print

There are 3 Data Types: Numbers, Booleans, and Strings