Archive for the ‘Ruby On Rails’ Category

Rejection!

Posted on May 8th, 2007 in Ruby On Rails | View Comments

It’s certainly been a very interesting week for me. First, I was infected with the dreaded Pink Eye early last week, which prompted me to stay indoors from Tuesday to Friday. I finally got completely cured on Sunday night. Too bad it was just in time for Monday morning, which can be dreadful, especially when I had tons of work waiting for me on my desk for the four days I was absent.

However, I didn’t mind that much, as I got to make a ton of advances with the task of migrating the company’s current inventory system to Ruby On Rails (more on that in a future post). I also took the time to send the ol’ resume to some companies (which shall remain nameless for the moment) in the U.S., particularly San Francisco. Surprisingly enough, I received two answers to initiate the interview process with them! For some reason, I wasn’t expecting it at all. It’s probably the fact that I thought most employers would don’t waste their time with local candidates (although I made sure to emphasize the fact that I’m planning to move soon). In any case, that was pretty damn exciting for me, and I’m still psyched because of the quick responses.

So I initialized the interview process with both companies. One company sent some questions, seemingly just to gauge my personality traits. Once I completed it, someone from the company actually took the time to schedule a phone conversation with me and talk about the position. That was a really great touch, and I don’t think companies looking to hire great talent do this enough. After the conversation, which got me even more interested in the position, I received a programming test. It was right up my alley, and best of all, as the company is a Ruby On Rails shop, I had a chance to show my up-and-coming Rails skills. It took about a single day to complete (Sunday). I’ve been waiting for a reply, but I feel really, really good about this opportunity.

The other company sent me a written exam, mostly consisting of questions that challenge your logical way of thinking which I had to complete and return in an hour. These types of exams have been made famous by companies like Google. I thought I did pretty well, although I have to admit the questions were pretty tough. Maybe I was too nervous. In any case, I sent the exam on Friday afternoon and waited.

This morning, I woke up and checked my E-Mail for any response. I saw an E-Mail from the company that sent the written exam (not the Rails program). My heart raced as I clicked the link. Then I saw the following words: “Unfortunately we feel that *the company* is not the right fit for you at this time.” Needless to say, it certainly wasn’t the best feeling in the world.

I don’t know why I wasn’t accepted, although maybe I didn’t complete the exam as well as I originally thought. However, I do thank the representative from the company for taking the time to send the test in the first place. I’m guessing that if the company didn’t think I was actually qualified by looking at my resume, they wouldn’t have taken the time to schedule the test.

After a few minutes of being sort of heart-broken, those feelings were quickly removed. Why? I now know that I can – and need – to do better every time out. And to tell you the truth, the rejection pretty much motivated me to keep on going forward with learning new things. In fact, I took half of my lunch hour just to keep on adding new stuff to the program I’m migrating to Rails. This kind of opened my eyes, and makes me want to be better, the best I can.

I’m not bitter at all with the rejection. As I said, I genuinely thank the company for the opportunity in the first place. In the future, I’ll thank them again, when I’m much, much better at what I do.

Digg API with Ruby (and Rails too!)

Posted on April 25th, 2007 in Programming, Ruby, Ruby On Rails, Software, Web Development | View Comments

Note: This site has changed a lot over the last year. I’m not using Rails anymore on the site, so there’s no place where I’m currently using the Digg API. However, I’ll leave this post intact, as it might help others with something similar.

If any of you readers have come in through my main site lately, you should notice that I added a little something on the sidebar. One of my favorite time-wasting activities of the day is browsing Digg. I tell you, there should be some sort of “Diggers Anonymous” for us simple-minded folk who can’t stop from visiting the site for stories many times a day!

Anyway, they recently announced the release of the Digg API, to allow any user to access the stories on the site in any way, shape or form we desire. Now, I must say that I have no real use for this. Of course, being the geek I am, I just wanted to try it out and see how I could use a simple API using Ruby, for use on my Rails site (this one). This is also made in case anyone else wants to do the same. One note, however: I’m only a Ruby / Rails beginner. I’m sure there are much better and efficient ways to do this. Since I haven’t dabbled in this too much, and “it works on my machine“, I’ll leave it as it is for now.

Just for the record, the testing and development for this code was made on my computer running Ubuntu 7.04, along with Ruby 1.8.6 (compiled by myself, not downloaded from the Ubuntu repos), RubyGems 0.9.2 and Rails 1.2.3. It should work correctly with any fairly recent version of the software mentioned above.

The Digg API is rather simplistic right now. All you need is a simple request using a URL like this:

http://services.digg.com/stories?appkey=http%3A%2F%2Fdennmart.com&type=xml&count=5

In the example above, the API is called to the ‘http://services.digg.com’ server. The parameters afterwards (in this case, ‘/stories‘) is the request. You can add more parameters for a finer-grained search.

Once the request URL is complete, you need some additional actions to add as well. The ‘appkey‘ is required, but can be anything for now. Digg isn’t generating application keys (a la eBay or other external API’s), but an appkey is required for ‘statistical purposes’, according to the documentation. The ‘type‘ is how the data is going to be returned to the app, and it can be either XML, Javascript, JSON or PHP. I use good ol’ XML for now, until I can actually play around further with the other response types. Finally, the ‘count’ action is to limit how many stories are returned. I’m only going over these options quickly, as the API documentation has much more information.

Once you figure out which request you want to make (using Mozilla Firefox can help greatly, as the XML response is nicely formatted), it’s a matter of getting that data into your Ruby or Rails app. Going back to the ol’ trusty Pickaxe book, I found a nice little module integrated in Ruby called open-uri. This module allows the Ruby application to open a URL (either http, https or ftp) and get the returned contents. To use this module, a simple line of code is needed:

require 'open-uri'

That should load your module correctly. Now it’s just a matter of having Ruby open the API connection and store its XML response in a variable:

response = open('http://services.digg.com/stories/popular?appkey=http%3A%2F%2Fdennmart.com&type=xml&count=5').read

The ‘open‘ function, well, opens the connection to the API, while the ‘read‘ method gets the data that’s returned from the URL. Like I said, rather simple.

However, I was getting timeout errors when calling the ‘open’ function. Strangely enough, the function worked fine when using any other URL. Upon further reading of the API documentation, I found this little tidbit:

“All API requests must include a User-Agent HTTP Header. A request without this header will receive no response.”

So, after that small mistake, I edited the request like so:

response = open('http://services.digg.com/stories/popular?appkey=http%3A%2F%2Fdennmart.com&type=xml&count=5', 'User-Agent' => 'Ruby/1.8.6').read

The ‘User-Agent‘ parameter can be anything. I just decided to use the Ruby version I have. Once I added that, I had my nice XML with the five most recent Digg stories that have been promoted to the front page.

After that, I needed to parse that XML. I searched around the Internet, and found a great little module called ‘XmlSimple‘. This module reads and writes XML, and formats it according to whatever’s needed. In my case, I needed to read the XML response. Just like the ‘open-url’ module previously, you need to load the ‘XmlSimple’ module as well, once installed (“gem install xml-simple“):

require 'xmlsimple'

I did run into some minor problems when loading this module. The Ruby interpreter cried out loud, saying it couldn’t load the module. How come? I verified that the gem was installed correctly, and it was. Then I realized that since this is a gem, I need to have ‘RubyGems‘ loaded before loading ‘xmlsimple’:

require 'rubygems'

I believe that Rails already loads the module for you. But if you’re testing this out on Ruby and not on Rails, you’ll need it.

Okay, once I did that, I was able to load the ‘xmlsimple’ module. Now I need it to parse the XML response that I stored in the aptly-named ‘response‘ variable. A simple line of code can convert the XML into a hash:

XmlSimple.xml_in(response)

That takes the entire XML string and puts it into a neatly organized hash. I really don’t need everything in the hash, just the story title, link and how many diggs the story has. So I just access those particular keys:

digg_hash = XmlSimple.xml_in(response)
story_title = digg_hash['story'][0]['title']
story_link = digg_hash['story'][0]['link']
story_diggs = digg_hash['story'][0]['diggs']

In the example above, the ‘story_title‘ variable has the most recent story title, the ‘story_link‘ is the link that takes you directly to the story, and the ‘story_diggs‘ has the current amount of diggs that story has. The number zero used in the array is the story number. If you want to get more than one, you’ll need to loop through the array and get the other stories.

The code I’m using on the main site right now is the following:

<%
  require 'open-uri'
  require 'rubygems'
  require 'xmlsimple'

  response = open('http://services.digg.com/stories/popular?appkey=http%3A%2F%2Fdennmart.com&type=xml&count=5', 'User-Agent' => 'Ruby/1.8.6').read
  articles = 0
  while articles < 5
%>

(Dugg <%= XmlSimple.xml_in(response)['story'][articles]['diggs'] %> times)
<% articles += 1 end %>

In all, this was rather simple, and I’m sure there will be a much more creative use for the Digg API soon. But for those who want to learn how to use it, or those who need a very simple approach, this works just fine. I’m interested in listening on how other people have put this to use. Hope this helps someone!

Rails Screencasts = The best learning tool on the Internet

Posted on April 16th, 2007 in Programming, Ruby On Rails | View Comments

Well, it’s been a while since I last posted. Maybe it was due to the fact that I received so many damn spam comments that Akismet seemingly didn’t block. I’ll look into that when I have some free time to check it out. For now, I’ll just give a quick post on what’s on my mind.

Even though I haven’t been posting on this blog, it doesn’t mean I haven’t been occupied with my Rails learnings. I just discovered the wonderful new world of screencasts as a learning tool. If you don’t know what a screencast is, it’s basically a video tutorial. Instead of reading something off the Internet, where the instructions aren’t always crystal clear, a screencast shows you what to do, and how it’s supposed to work. I’ve found them to be an invaluable tool in my quest for Rails wisdom.

There are a couple of sites that offer Rails screencasts exclusively. The first site is Railscasts. This site is frequently updated with short screencasts about various Rails topics. I’ve noticed these videos are truly great for beginners, as most of the topics covered so far seem geared more towards people without much Rails experience. Even though the videos are normally short (about five minutes in length, maybe less, as an average), they’re packed with useful information that’ll help any beginner get a better grasp at certain Rails topics.

The other site I’ve visited is Peepcode. These people make high-quality and full-length screencasts (over an hour long!) for the low price of $9.00 for each video. Many may think “But why pay for screencasts that can be freely accessible from the other site?” There’s a very large distinction between the screencasts from both sites. While length is obviously the main factor, the material shown on Peepcode screencasts is much more extensive and covers absolutely all the bases. Many of the screencasts that are currently available for purchase on Peepcode are geared to more advanced users, though. But in all honesty, $9.00 is a very small price to pay, given what you learn.

So if you’re trying to learn Rails like myself, I’d suggest you head over to one of these site pronto. You’ll be amazed at the great work that’s put out on the Internet for the sake of teaching others. That’s the beauty of the Internet.

Too bad it can’t all be Rails

Posted on February 22nd, 2007 in Ruby On Rails, Software | View Comments

I finally finished the minor remodeling of my personal page, as I transferred the old, plain HTML files to Ruby on Rails. It didn’t take too long, since the site is all static (for the time being). Just in case you’re wondering, I moved everything to Rails mostly because I was tired of having to make a change to a menu, and I had to change every single HTML file. Not anymore. Although this apparently is the only benefit I’ve gained, I’m planning on adding many more things in the future (using Rails, of course).

Anyway, I was explaining what I was doing to the website to a co-worker. Although he doesn’t understand much about programming, he did seem to understand the whole Rails thing. So he asked me if the blog was also made with Rails. I told him no, it was using WordPress, which runs on PHP. SO his next question was a natural one: Why don’t you use a Rails blog?

I’m sure some people who visit this site will ask the same thing. I have a couple of answers to this. I had tried to use Typo previously on this site, but rapidly removed it and started using WordPress. First off, the web hosting company I’m using isn’t the fastest or most reliable host around for Rails applications. So Typo felt damn slow, probably due to the amount of memory it needs to run. I know there’s other blogging software built on Rails, but I haven’t had time to review them thouroughly yet, and I don’t seem to think they’re good for what I want.

Besides the slow speed, Typo hasn’t been updated in quite a while. The last update was in August of last year. Now that normally wouldn’t be a problem. But I think that at the very rapid pace Rails is evolving, most Rails developers need to keep up with this pace. Granted, that’s not always possible. But with all the new additions Rails gets with each release, I’m sure Typo and other Rails software could greatly benefit from those changes.

So for the time being, I’ll stick with WordPress. It’s relatively fast and stable, and very easy to manage. Can’t ask for more. Maybe in the future Typo will be updated, or I’ll switch hosting companies and find Typo to be great, or maybe there’s some blogging software out there built on Rails that can solve this minor dilemma for me. For now, it’s too bad all my site can’t be built on Rails.

Is Rails confusing?

Posted on February 18th, 2007 in Programming, Ruby On Rails, Web Development | View Comments

I’ve been learning Rails with great success these past two weeks. I’ve learned so many things during this period, much more than I’ve learned in a similar time frame for other languages / technologies. While there is still much, much more to learn (and memorize), I’m very happy in the time I’m investing in Rails, and don’t mind spending most of my free time reading and coding.

However, something that has happened to me a couple of times is that I get confused with certain things. For example, last week, I was really confused when reading about how forms work in Rails, and how to save and edit records in a database. Basically, it all came down to its simplicity confusing the hell out of me. For example, to save a new user, the only line of code needed in the controller was User.new(params[:user]). After watching this work nicely, I was amazed, but at the same time confused. How did Rails know what to save and in which fields? Where’s the SQL code? After reading a bit more about the form_for and form element helpers, as well as reading the logs, I found out how Rails does this automatically. Really great stuff.

However, some further confusion happened while reading about the form helpers. There were similar tags for the same thing. For example, there’s a form_for helper, as well as a form_tag helper, which create the form in the web page. Same with the elements. The text_field and text_field_tag apparently did the same thing, albeit each had different parameters. So that caused a bit of confusion early on.

So, maybe my mind was just fatigued because of the week I had at work, or I didn’t read my book well, but this caused me to look around to better understand these tags and what each one did, and why two (or more) similar helpers did different things. Thankfully, I’m the type of person who needs to know how things work. I’m never satisfied if I use something and if it works, I never question it. It may be the inner hacker in me.

Be ready for Intype

Posted on February 16th, 2007 in Programming, Ruby On Rails, Software, Web Development | View Comments

Last year, after a friend of mine lent me here Macbook for a week (I want one for myself so bad!), I discovered the most amazing programming software I had ever found, called TextMate. I’m sure many of you have heard about this program. In fact, if you have watched any of the Ruby On Rails screencasts, you know what software I’m talking about. I think it strikes a balance between simplicity and power that’s rarely seen, and that I never even thought was possible. I tell you, once you get used to their snippets function, you’ll never want to try another IDE again.

So I went off, searching for a nice alternative for Windows that would work similarly. Shockingly enough, there wasn’t any program out there that was even similar to TextMate. I thought that was pretty weird. But after doing enough searching, I found a place where some people were making a program for Windows that would basically be a TextMate-like clone for Windows. Unfortunately, the program was only in its initial phase, with no alpha released yet. Sadly, I thought this program would just die out like many other software projects I’ve seen before, never to see the light of day.

But early this year, I received an E-Mail, stating that the very first Alpha release was available for download! Giddy, I went to their site, and lo-and-behold, there it was. I would finally get to use the program known as Intype. I rarely get excited for a software release, but this was an exception.

So I tried out the program, and it worked fine. Of course, as all alpha software, it had its fair share of bugs, and most of the functionality found in other text editors was missing (more noticeably, an Undo / Redo function). Still, it showed lots of promise, and many other people in their forums shared the same excitement as I did.

After a couple of more releases, there is finally a very usable Alpha version – one with an Undo function – available right now. I’ve been using it while I’m learning Rails, and it’s helped greatly, in terms of writing code much faster. I won’t dive into specifics, as there are already a couple of reviews out there in the wild. Even though it’s an Alpha release, it’s coming along really nicely. If the project continues forward, and all the proposed features are added, this will truly be a blessing for the developers – like myself – that are stuck at work with a Windows environment.

Intype

If you have a chance, download the most recent version and give it a spin. Besides helping with bug reports, you’ll probably be pleasantly surprised at the current state of the project, and you’ll certainly be excited as to where it’s headed. Be ready.

Ubuntu – Linux Leader

Posted on February 14th, 2007 in Linux, Open Source, Programming, Ruby On Rails | View Comments

It’s been a while since I last used any Linux operating system full-time in my own computer. Back when I was in college and still had tons of free time, I would always try to get the latest and great Linux distribution just to try it out. That’s how I really got familiar with Linux. I always recommend to co-workers and other people interested in Linux to just grab a distribution, even if it’s a Live CD, and just play around with it. If they get stuck, there’s tons of help on the Internet, along with my own help, so any fears they have should disappear.

Anyway, I’m heading off topic with that, and I’ll maybe write about it some other time. For now, I wanted to write about my recent experience. I do use Linux every single day at work, but only at servers, where the command line rules them all. However, I hadn’t used Linux for the desktop in a while. I guess I didn’t want to fiddle around with installing and configuring the OS to my needs. But a friend at work told me he started using Ubuntu, and that basically got me into the Linux mood again.

I had already tried Ubuntu, ever since version 4.10, and I liked it. Still, I thought it was too “user friendly” for me. I know user friendliness is a great thing. But come on – this is Linux! It’s meant to be difficult, right? That was my previous point of view on the subject. But after installing Ubuntu once again, I’m totally hooked. The last version, 6.10, really makes a great name for itself. It has all the user friendliness you can give new users, but it also allows those power users do whatever they can do with other Linux distributions.

I obviously installed Linux to work with Ruby on Rails. I have to tell you, Rails on Windows is a bit of a pain. It just doesn’t feel right to work with Ruby or Rails in a Windows environment. I’ll also save that for some other time. But after installing Ruby and Rails here, I’ve been pretty damn productive with my Rails learnings. It’s been a really great tool.

For now, Ubuntu stands as the leader of the Linux world, at least in my option. This is the distribution that will most likely propel Linux into mainstream usage, not just for geeks like myself who just love to tinker around with these things. Other companies have been doing great on other fronts, such as Novell (with SuSE and OpenSuSE) and Red Hat (with Fedora Core and its own Enterprise Server). But to me, Ubuntu is the distribution that will help get Linux into many homes that have only seen Windows stuff before. And with Windows Vista’s apparent shortcomings (I haven’t tried the OS yet, so I may be misinformed), along with Apple’s very excellent Mac OS X (with increased Apple hardware sales), I think these systems that are in the minority will finally gain some market share that Microsoft has been hogging for years. Look out, Vista.

Love those Pragmatic guys

Posted on February 13th, 2007 in Programming, Ruby On Rails | View Comments

I’ve fallen completely in love with The Pragmatic Programmers.

Well, not literally in love with them. But I’ve really turned into a complete fan of their work in very little time. Obviously, my first foray with their work was the first edition of their awesome Ruby On Rails book, Agile Web Development with Rails, as I mentioned in a previous post. I didn’t get much time to read that book, but I did take time a couple of weeks ago and purchased the second edition. And let me tell you, there hasn’t been a programming book that I’ve understood so quickly, nor have I’ve immersed myself in so deeply.

The laid-back tone Dave Thomas uses in the book makes for easy reading and comprehension. Also, the method the authors choose to help the reader learn, which is explain things while actually building a fully-functional application, is simply great. I have so many programming books at home that I never got around to reading, due to the seemingly forced way they try to shove information about classes, methods and other nuances. This is quite the contrary. I’ve learn so much about Rails this past week, that I’m just about finishing a personal project I was building for quite a while in PHP. And that’s just in a week.

Anyway, the reason why I say I’m in love with these guys is because their books are simply the best. Before picking up the second edition of the Rails book, I picked up the good ol’ Pickaxe book (Programming Ruby), it has the same concept of teaching you the Ruby language. I was hesitant to buy this book due to its sheer size. But really, it teaches a lot without overwhelming the reader. It’s also helped me along in my Ruby learnings.

After seeing that these two books were great and that I was actually learning a lot in such a short time, I went on ahead and bought another Pragmatic book this weekend: Pragmatic Version Control: Using Subversion. I set up a Subversion server at my job, but only used it simply for having a log with the source code changes. I didn’t use it for anything else. After reading this book (I’m almost done after three days!), I now know that Subversion can do so much more. I was totally ignorant to things like branching, tagging and merging, and now that I have this knowledge I’m sure I’ll be using it every week.

After these three books, I know I’ll be buying many more from them. After I learn a bit more about Rails, I’m definitely going to buy the Rails Recipes book. Also, since I manage the servers at work, I’m thinking of getting the newly released book, Everyday Scripting With Ruby. And if I ever get a Macbook, I’ll surely buy their Textmate book.

So really, if you haven’t checked The Pragmatic Programmers or their books out, you really should. They’re the most easy to read and understand books available on programming topics. I guarantee you that you won’t regret shelling out the cash.

Don’t take the easy way out

Posted on January 30th, 2007 in Linux, Programming, Ruby, Ruby On Rails | View Comments

I remember when I first started using Linux back in the day – “back in the day” referring to about the year 2000 – it was a total pain to work with. From not-so-great hardware detection, to installation and partitioning pains, to the ever-lasting fight against making a Winmodem work, it surely wasn’t for the weak-minded. However, something I sort of enjoyed during that period was downloading and compiling the programs myself. Well, I didn’t enjoy it much when dependency problems arose. But just the fact that I was taking this free and accessible source code, compiling it myself, then having fully functional software made me have a sense of accomplishment.

Nowadays most people have it easy. With friendly and easy-to-use Linux distributions, such as Ubuntu and OpenSUSE, all you need is to just click on a checkmark in a GUI interface and your programs, along with all dependencies, are immediately installed. Nowadays no one even has to use the command-line at all if they wish to do so. So as Linux gets easier to use, less and less people learn how to really use the operating system to its fullest.

Unfortunately, I too have fallen into that trap as well. I remember I used to compile the kernel every single time a new one was announced. Now, I barely do it. If the operating system I’m using at the time doesn’t have a current update, I don’t install it. Every time I see a new program I was to try out, I check first if there are already pre-compiled binaries for my distribution, and only compile the source code if all else fails. It’s kinda sad how much I’ve lost during these past few years.

That will probably change from now on. Last night, I took a spare computer in my apartment (1.0 GHz Athlon with 768 MB of RAM and a 20 GB hard drive) and decided to put it to good use. Seeing that I’m trying to learn Ruby and Rails, I wanted to install an easy-to-use distribution to save me some time with installation and configuration duties. So I chose Ubuntu, and it all installed just fine, until it came time to install Ruby and Rails afterwards. With Ubuntu, installing Ruby is just as easy as doing this:

sudo apt-get install ruby

Ubuntu did its magic, even though I didn’t have a good feeling when I saw it was installing version 1.8.4 (Ruby is now at 1.8.5). Oh well, I thought. It was just a minor revision, no big deal. I then went on to install RubyGems, and it installed okay, until I started getting some warnings. Since it finished the installation, I just kept on going. When it came time to install Rails, This time one of the gems didn’t install (I believe is was Action Web Service). I had installed Rails in other distributions without warnings, even on Windows. Since I had a couple of spare minutes at night, I decided to go the long route, and install everything from scratch, and make sure it’s up-to-date.

I’ll skip the entire process, as I’ll probably cover it in another, more formal, post. But I grabbed the source code of Ruby and after uninstalling all the mess the Ubuntu binaries caused, I compiled everything and I had absolutely no errors at all! I was even able to install the Mongrel gem without any problems.

So, that taught me a lesson as far as relying on pre-compiled binaries goes. Besides the obvious reasons why you should try to compile your own software (if the code is available), such as optimizing the compiled binary for your system and making sure you have the latest versions, you can avoid problems from the beginning, even if package managers such as Ubuntu’s apt are supposed to help you there. Also, it brought back that sense of accomplishment I used to previously have. So from now on, as long as time and skill allows me, I’ll be compiling my own code.

Time to pay a visit to the Linux Kernel Archives. Long time I haven’t been there.

Ruby makes me want to rock out

Posted on January 28th, 2007 in Programming, Ruby, Ruby On Rails | View Comments

During these past few weeks, I’ve been making a conscious effort to learn a couple of new programming languages, more specifically Ruby. As many people on the Internet, I was introduced to the beauty of the Ruby language when Ruby on Rails started to become popular around version 0.14. After reading a lot of Internet beginner tutorials, I decided to take the plunge and start learning Ruby now.

After grabbing the Programming Ruby book (lovingly known as ‘Pickaxe’ around Ruby circles), I have really fallen in love with this programming language. It’s not too difficult to learn, and you can produce really clean, readable and over-all beautiful code. I even feel Ruby has helped me become a better programmer, in the sense that I am striving to have all my code as clean and readable as possible. Being a full-time PHP programmer, you can imagine that clean and readable code isn’t my strong suit. After learning a bit more about Ruby, I’ll go ahead and dedicate myself to start learning Rails. I know I can start using Rails without vast Ruby knowledge, but I want to start with the basics, and I feel that’ll make me better at learning Rails.

However, the reason I’m writing this post today is because of an age-old question I’ve had ever since I started taking my programming courses in college. A lot of people question my choice of music while programming. This has popped up in some conversations because I love Rock music, especially anything that’s Punk Rock or Metal. The harder and faster it is, the better. So in a profession where I need to have absolute concentration to produce the best results possible, how can it be that I can concentrate more with some Bad Religion or Bullet For My Valentine on my MP3 player? It’s really weird.

At my current job, I tend to put some Rock music when no one’s around (just because I’m considerate of others). When I do, I notice I don’t move from my seat, and just start coding away. When I don’t have any music on, I tend to be distracted more easily, and go out for frequent bathroom breaks or just to chat with other co-workers. I wish my current employers could notice this and let me bring my own MP3 player to work and just leave me alone for long periods of time. I can guarantee that I can work much better and efficiently this way. But that seems like wishful thinking for now.

This past week, I think I’ve learned a whole lot with Ruby, partly because I’ve taken more time out of my schedule to sit down and practice hands-on. But it could also be because I just bought a couple of more CD’s for the collection, and I tend to listen to my CD’s completely when I code, instead of just having them in my car and listening to one or two songs before I move on to the next. I should do a formal study of this some day. Has anyone else in the world noticed this?