Let’s learn Ruby on Rails, want to?


Punctuation

Posted in oop, ruby by MrPeanut on the September 30, 2007

The one thing that has always made my head spin when it comes to programming is the syntax. Whenever I see something like “thing.new()” I immediately wave the white flag and go back to my safe little html world where everything is in simple tags and it all makes sense. To be honest, dots and parentheses scare me. While reading Build Your Own Ruby On Rails Web Applications (from now on… that will be known as BYORORWA) for the first time, I glossed over this information. I read it, I understood it, but I just as quickly forgot it. Only now, on my second pass through the chapter, am I truly starting to understand what it means. Below are my notes on notation:

Dot Notation – The dot (or period) is used to separate the objects from the methods… or to separate the receivers from the messages.

(I’ll fill in an example later)

Parentheses – These are used to pass arguments to methods. They are optional in cases where no arguments are being passed.

(I’ll fill in an example later)

This is a pretty bare bones attempt at explaining notation in Ruby, but since these two things have often been the bugbear of my learning experience, I thought it wise to pull them out give them their due.

A Wise Man Named Seinfeld Once Said…

Posted in productivity by MrPeanut on the September 27, 2007

I’m a big fan of online productivity tools. Over the past year, I’ve used probably half a dozen different sites (not including calendar applications) to try to keep myself in order. There are things that I’ve liked about all of them, but there was always at least one thing that just didn’t work for me. Finally I landed on Todoist and I haven’t looked back since. On a recent Todoist blog post, I noticed that they had implemented something that was inspired by the “Jerry Seinfeld’s productivity secret.” Color me intrigued. I wanted to learn more so I clicked on the link, and sure enough there was a very intelligent, easy to use system for keeping yourself motivated to continue tasks over a long period of time.

I, of course, want to implement this for my project (learning Ruby on Rails). I’m not much of a paper and pen type of person. I prefer to give and receive my info in a digital format… so imagine how excited I was when I found THIS! While I love the Todoist… for some reason, their implementation of this concept (though not radically different from the smarterfitter site) just didn’t speak to me the way this one does. It’s beauty is it’s simplicity. I hope I continue to use it… if not, I might have to get a “real” calendar. Yuck.

Back to Basics

Posted in oop by MrPeanut on the September 25, 2007

Last week I mentioned that I might take a step back to relearn the MVC architecture. Instead I decided to take two steps back. I realized that part of my confusion was more basic than MVC—it’s that I don’t have a strong command over the concept of object oriented programming. I usually understand OOP while reading about it, but I over time I forget the terminology, and sometimes the concepts get a little fuzzy in my brain. Since I’m right at the point in the learning process where I usually start to lose it, I’m going to take my time and really try to understand OOP. I think I was a little too eager to get started on my application, and to get my hands dirty with code, that I tried to breeze through some of the more important parts. I have a tendency to do this… I don’t want to suffer through the boring stuff, I just want to get to the fun. Because I’m recognizing this in myself and because I realize that there is some important precursory stuff that I need to learn before I can really jump in, I think I might give ruby another look before jumping into the rails code again. We’ll see how comfortable I feel when that time comes. For now, however, here are my notes on some of the basic concepts of OOP (they are just notes, and therefore kind not very well fleshed out. I may choose to edit them in the future):

  • OOP programs are be composed of individual entities or objects
  • Objects can communicate with other objects AND each can store data
  • Programming objects are often modeled after real-life objects
  • Like in real life, OOP defines objects with similar characteristics as belonging to the same class

OBJECT – Single entity

CLASS – Construct for defining properties for objects that are alike and equipping them with functionality.

METHOD – Actions that have been assigned to a class.

INSTANTIATION – To create a new object, we must base it on an existing file. This process is called instantiation.

ARGUMENT – The input value that is provided to a method. Can be used to either influence how a method operates, or to influence which object a method operates on.

In the future, I’ll try to put up some examples of the previous so it makes a little more sense.

Back to Work

Posted in rubyonrails by MrPeanut on the September 17, 2007

Look at that… it’s been exactly a month and a day since I last updated this blog. No I haven’t been slacking (well, mostly I haven’t…), I’ve been on vacation. No, not just from code… like, in the real world. True there has been about a week’s worth of padding on either end of said vacation, but it takes a little while to work your way back into the swing of things. I’m now in the process of actually writing some code (following along with my book) and I’m noticing that some of the things are coming to me pretty easy, and others are more difficult. I think I might take a quick step back to re-read about the specifics of MVC architecture. I seem to be most confused when I hear talk of inheritance and such. I feel like this is the most critical info in the whole learning-how-to-program process, so it’s worth another look. I have no new info to share with the blog today, just a note to say that I’m back and I’m ready to get to work.