Hello, Ruby

This past weekend, I got introduced to Ruby thanks to Girl Develop It Chicago. I didn’t plan on going anywhere near Ruby, especially not anytime soon, but I’ve been trying to make a GDI meetup event for a while now and I just decided to go for this one when it popped up.

I’ve probably said this a dozen times already, but the first language I learned in school was Java.
Prior to that, the experience I had programming was drag and drop in Alice.

Ruby is a pretty simple language compared to Java– at least in my opinion– and I kind of wish that it had been the first one I learned.

One of the first things you learn how to code in any language is how to display the message “Hello World!”
In Java?

public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } }

But in Ruby?  

puts "Hello World"

See how simple that was? 

Variables, objects, methods, booleans, loops, conditionals, and collections. Oh, and error messages. Plenty of error messages.

I didn’t start taking screenshots until the second half of the class, but you’d be amazed at how fast time flies while you’re coding!

Practicing if statements + user input + math functions.
Practicing loops by asking the user if the loop is a loop. Yep.

For each number between 1 and 1000, print out ones divisible by 7
For each number in the range of 0-500, print the value

So, between now and the next class, we were given some homework to practice what we learned (which I will post when I’ve finished it) plus some reading to prep for next week. I’ll also be going through the course on Codecademy (the Codecademy site was actually built using Ruby!).


2 thoughts on “Hello, Ruby

  1. While I haven’t learned Java, I think that it might be to your benefit that you learned Java first since it’s set your brain up for complex commands vs “puts xyz”. BTW, I’m really enjoying your blog! I don’t have a background in CS but am teaching myself at home and via meetup groups. Its great to see other people’s progress and makes it seems much more attainable.


    • Having a CS background is definitely helping! I felt like I had forgotten everything, but I picked up Ruby basics and JavaScript fairly easy 🙂
      I wish I could go to more meetup groups, it’s nice to learn coding and have some social interaction at the same time lol

      I wish I had seen this when you posted this ages ago, sorry!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s