Refactoring: A Milestone in my Developing Career

Reflecting back on the past six weeks, I recall moments of maddening rage. Sometimes I wanted to throw my laptop out of the window (shattering the glass in a brutal fashion), drive down to Florida, become a caddy at a golf course, and lead a simpler life. I restrained myself from doing so because I don't have a car and I haven't played golf in 6 years, and therefore it would take awhile for me to break into the caddying profession. Ruby on Rails is really all I've got (dramatic pause). So when I would get those ERROR MESSAGES because I made some aggregious ERROR because I am CARELESS and FOOLISH, I would take a deep breath, and read the error message, and it would tell me, "No ControllerForGalleries". And then I would add a Galleries_Controller, and pray that no one saw the vein in my forehead maddeningly pulsating.

Thankfully, the blinding 'error rage' subsided as I became more comfortable and familiar with error messages and the basic MVC framework of Rails applications. We approached the architecture of our applications through Error Driven Development, or "EDD". After enough practice, the errors acted like road maps; basic instructions on how to build our app. We successfully made an app modeled after Flickr with images, galleries, groups, followers, and more -- all great features that I can see myself using for my passion project and other future app creations.

It's hard to believe that we are now at Metis' half-way point. We have learned so much the past six weeks that I'm not even sure where to begin, so I won't delve into the nitty-gritty of the curriculum. Last week was refactoring week, and our last week of lectures. I saw refactoring week as a very poignant milestone in my developing career. As I described before, EDD is incredibly useful as it helps one construct the framework upon which your app is built. However, prior to refactoring week, we did not delve much into writing "clean code", nor learn proper design techniques. Infact, I had no idea that these were even "things" -- I thought, naively, that if the code worked, and app functioned properly, then that was that.

Refactoring has unveiled a whole new world to me. I felt the same way when we progressed from procedural programming to Object Oriented programming -- it just made sense. Grouping objects logically (OOP) made more sense to me than listing features chronilogically (procedural). These parts of programming -- the parts where I can feel the gears in my brain begin to turn and grind -- are the parts that drew me to the field in the first place. Yes, there are 'aha!' moments when your code is functional, but I achieve a much deeper sense of satisfaction and confidence when I can look at my app and notice that things are designed and structured in a manner that translates well. Strangely enough, I also feel a sense of accomplishment when I look at code I have written and notice that something isn't quite right. The fact that I am developing the skills to differentiate between good and bad code is encouraging to me; I feel that these abilities are what will follow me throughout my career as a developer, and will be skills that I will forver continue to hone and perfect.

Refactoring has forced me to really understand the inner-workings of my app. We intentionally wrote cluttered code, only to look back and refactor it. I am so, so grateful that this is the approach Metis took. This entire time, I felt that something was inherently wrong with the code we were writing for our mock-Flickr app. A lot of it did not logically make a lot of sense to me. Sure, it was OOP. Most of the business logic were in the models, and our controllers were pretty skinny. But these principles alone do not make for a strong app, and thus, many "code smells" began to emerge. Now that we are refactoring our app, I feel as though a weight has been lifted off of my app's shoulders. I'm not simply writing more code to implement features; I'm restructuring code to accomodate features, and refactoring code to make it as understandable and readable as possible. As a wise man once said, "Change is the only constant in programming", and thus, we must write our code to be as accomodating to change as possible. However, it is not expected that we write 100% clean, refactored code on the first go; it's a process. We know or sense that there is some flaw within our code -- an abstraction of sorts -- and from that, we set out to refactor it. As Sandy Metz points out, "You don't have to know where you're going to successfully refactor."

In conclusion -- while I may not be writing the best code right now, I'm happy that I'm becoming more adept at identifying problems within my code, and looking forward to working on the multitude of upcoming projects in the next six weeks. Metis has been an incredible experience thus far, and I am excited to begin to work more independently and hone the programming skils I have acquired from our lectures and Flickr application.

From Neopets to Metis...

When I was younger, I was an avid fan of the website ‘neopets’, a site where you take care of virtual pets and make virtual money. I had four starving neopets (who cares, they’re not real and can’t die) and 2 million neopoints because I figured a way to hack this wheel-of-fortune-esque game. I manipulated the url and was able to give myself an unlimited amount of spins. This was probably the first time I ever felt really crafty when it came to computers. I was ontop of the Neopian world, I was the wolf of Neopian Wall Street, and this is probably where my god-complex began to evolve. Just kidding...but anyways..

I continued to explore my “technological prowess”, using Neopets as my tool for learning the ins and outs of the web. Each pet came with a default "pet page" which was essentially just a crude HTML/CSS mockup detailing the neopet’s breed, history, etc, with a lot of glaringly ugly .gifs, scrolling marquee headers, and flaming text (literally flaming -- the text appeared to be on fire). It was very reminiscent of geocities/angelfire webpages. Many people on Neopets would edit these pages and customize them, creating (relatively) beautiful layouts and photoshopped graphics. Quickly, I learned how easy it was to right-click, view source, and copy other people’s web designs and paste them into my own pet page. This was for personal use, of course. I didn’t know what a "div" was, but I knew how to make it a certain color, width, have a specific font style, etc. Trial and error, experimentation and manipulation — this is how I learned of the inner-workings of basic front end development. I was never exceedingly proficient in HTML/CSS, but I did get to the point of owning my own domain name (it was a fan website for the German industrial band Rammstein...), and that was pretty damn impressive for a 12 year old, in my opinion.

For reasons unbeknownst to me, I stopped dabbling with code. It was a combination of highschool being quite demanding, and the fact that I did not see the point in trying to pursue this stuff at a higher level, because I was never exposed to learning such things in an academic setting. I just thought I spent too much time on the computer — which I did -- but without logging all of those hours on the internet, I doubt I would have developed such a deep love for computers.

LONG STORY SHORT, after dabbling in a hodgepodge of subjects, and eventually earning a B.A. in History, I came across "software development". That name always sounded incredibly daunting to me because I associated it with building complex machines, or something really scientific, far beyond my realm of knowledge. I researched a bit more and began to get my feet wet in "programming", which I found to be a much more approachable term. I apologize if there is some official technical difference I am overlooking between "developing" and "programming" -- but hey, I'm still a newb!

I picked up Chris Pine's "Learn to Program", which teaches you to program in Ruby, a language that I had taken a liking to because it seemed a lot more approachable than C and Java. I took my time going through each chapter of the book, completing the exercises with care and frustration -- but it was a good frustration, because no matter how bad I wanted to pick up my laptop and bash it into the wall, I knew that the feeling of solving a problem was unlike anything else. Those 'Aha!' moments that have been documented by new and old developers are very real, and very rewarding.

I fumbled around with Ruby on Rails for a few months, using online resources and videos to help broaden my scope of knowledge. Eventually, I hit a wall. I had achieved all I could on my own -- I wanted more. I wanted to be a developer, not just a kid who watches a video, copies some code down, and calls it a night. I wanted to be surrounded by people who shared the same interests as me. I wanted to be instructed by developers more knowledgable than me, I wanted to fully understand the innerworkings of the Rails frameworks, and beyond.

Metis has provided me with the opportunity to satiate my programming needs, and much, much more. I am so thrilled to finally be able to pursue my dream. I didn't know what I wanted to be until I actually became it -- a developer -- and I am beyond excited to continue to expand my knowledge and skillset, with the help of the amazing instructors at Metis, and my fellow students.