Hi all,
First, this is a longer than normal read but I hope that you get through
it all and can learn from my experiences.
So, I wanted to talk about my experiences with my first rails project
now that I’ve completed it for the beginning of the football season.
First, here’s the link:
I used to work as a Windows System A. for Charles Schwab,
working out of a U.S. Trust regional area before they sold the company
to Bank of America. After the transition, my fiance and I moved to
Plymouth, MA to be closer to her family and I figured finding work would
be easy in Boston or Providence. However, with the market conditions,
finding infrastructure jobs worsened for everyone, including myself.
So, I had some extra time and I had two hard choices before me. I could
either work on finishing up some certifications, MCSE or CCNA etc. or I
could work on development, a side of life I really enjoy immensely. I
chose the latter.
I’ve always wanted to learn Ruby and Ruby on Rails is a great framework,
in addition. My former ncaastatpages.com site was solely driven on PHP
and had numerous issues.
So, approx. 9 weeks ago, knowing absolutely nothing about ruby or ruby
and rails, I purchased 4 books (1-ruby, 2 - rails, and 1 enterprise
rails) and started to read. I took on a new project which included
upgrading my site and getting familiar with all that rails had to offer.
I went through a lot of hoops and hurdles but I’m happy to say that I
learned a great deal from working with the project, and from this
mailing group / boards.
So many of you have helped me over the past 9 weeks that I feel I’m
sharing a project that’s been touched by many. I really want to thank
those of you who shared your wisdom, your understanding, and your
patience with me.
=======================
My first baby steps
The first thing I did really, was go out and purchase a giant dry eraser
board. I nailed it right next to my computer and started to draw out
diagrams for how everything in my site was currently working. I saw a
lot of huge mistakes right from the start and since I was starting over,
I figured I could -erase- them and begin anew.
My database wasn’t normalized to 3NF (3rd normal form) and that’s where
I wanted to begin. Making sure that my database was organized properly
was important. I drew out my own schema which changed so many times, I
used up an entire pen drawing and erasing it out.
=======================
Components
I needed to figure out what components I wanted to use with my site. I
knew I needed the following:
Authentication
Pagination for tables
I started with just a few things - restful authentication and will
paginate. I quickly realized that I needed more than this but started
to get lost in the shuffle. I needed some hand holding and found that
Ryan B.’ railscasts site and the Learning Rails site from Michael
Slater and Christopher Haupt helped me out immensely, showing how to
create and manage my site with some baby steps.
I worked like a mad man, approx. 11 - 13 hours a day every day for 9
weeks to get my site ready for the season.
=======================
Hey n00b, yes you…
There were times I felt like a real newbie, even a little embarrassed to
have to ask some questions that might show that my skill with rails was
quite dismal. However, I have a photographic memory and retain
information like a sponge. I learn incredibly fast and no one here made
me feel embarrassed to have asked any question. I want you to know that
if you are new to rails that any question that goes unanswered for you,
will only make things worse.
Measuring skillsets with rails really comes down to how many questions
you have left to ask. Each day I had at least 100 questions. Today I
can probably count my entire list of questions on two hands.
=======================
Expand and Test
Creating tests was probably at times more difficult than creating my
site. It took me a long time to understand how to build a test criteria
and once I learned it, it became easier and easier. When I first
started, I thought, nope - no testing, not going to do it. It isn’t
necessary because I’m thorough. The more I added to my site the easier
it was to overlook something simple, even with as thorough as I had
been. I couldn’t put it off and so I started to write tests for
everything.
Lo, and behold, what’s that? Some of your database date columns are
float columns! What’s this? Some of your associations aren’t really
associated…
I think you can understand the point I’m making. Testing adds the most
important layer to your application, in that it won’t get tired. It
will not get lazy. If you cannot write a test failure for your code,
then you should find out why and fix that. Don’t be lazy. Make it
work.
=======================
Seeing the whole picture
About a week ago I started to relax a bit. I took a deep breath and
started to look over the whole picture. What had I really accomplished
with my project in the 9 weeks I began to work on it?
Full Authentication
User Authentication Mailers
Subscription Mailers
News Mailers
Encrypted Payment Gateway with IPN
CMS style in-text editing on dynamic pages
Fully normalized database, indexed, optimized for speed
Full collegiate statistics tables
TSRS Ratings System converted from php to rails
Head-2-Head Virtual Matchups (game comparisons)
Team clubhouse pages
Trends Analysis Support for teams
Flash and non-flash support
Scripting and non-scripting support
Browser testing with all major browsers
… etc… etc…
=======================
Going to Production
My site uses Linux, Apache2, Passenger, Capistrano + Github and my
experience with all of those could be summed up with the following
number (4%). I had about 4% experience with any of those pieces before
I started working with Rails. In 2 months, my experience with all 4 is
now around (75%).
My site had some hiccups but I fully administrate it on slicehost
myself. I’m the designer, the administrator, the creator of my world.
It’s not that difficult when you figure out that there are IRC channels
out there that can help with everything:
http://webchat.freenode.net/ (hit #RoR for ruby on rails, #Github for
github, #httpd for apache support, #Capistrano for Capistrano support,
passenger for passenger support)
=======================
Humble Confidence
I will say with a humble confidence that if you set your mind on a task,
believe in yourself (even if no one else does) you can do great things.
I believe that the harder road is the one that provides the path to
greater wealth and wisdom. If you do things that are easy, you receive
a lesser reward.
Always have faith and be patient, even in the darker hours when you feel
you are alone and no one is there to catch you as you fall into a dark
abyss. When you get there, step back, get some rest and tomorrow is
another day.
I’ve learned over this tumultuous 9 weeks that Rails is a fantastic
framework and Ruby is a fantastic language. I’ve learned that others
out there believe the same thing and that many of you who have helped
me, stand by these thoughts.
=======================
In Closing
Don’t be afraid to learn. Don’t be afraid to help others, especially
since you probably needed help at one time too. Be consistent and learn
from your mistakes. Take great notes and document your application
properly. If you leave your app for 1 year you should be able to come
back and understand where everything is and why it’s there.
I love Ruby and Rails. I put a “Riding on Rails” link on my site out of
tribute to the community and to the framework. I hope you enjoy my
site. A lot of positive things are coming out of it already and
hopefully this season it takes off.
Take care and many blessings.
JD.