I’ve spent the last month or so writing a decent amount of code in Ruby. Most of it was throw away code that I was playing around with, but I have put a few things up on GitHub that are written in Ruby, namely Spotty and GrowingUp. I’ve also been using it as my preferred language for one-off scripts at work and I plan to use it to build a Sinatra application to power the API for an upcoming project.
My programming background starts with developing homebrew (not the Mac OS X package manager) in Lua, C, and C++. It was an interesting experience, as it wasn’t incredibly easy to be babied into programming that way. The original guys who put together the tools were smart cookies, but they were also of the Unix hacker type. Their preferred development environment was the Unix terminal and IDEs were not very common in the PSP homebrew development world. As I progressed as a programmer and moved away from homebrew development I was introduced to tons of new tools that really helped to streamline the programming process. I left the days of using GNU Make behind and started to use IDEs like Visual Studio and Xcode, depending on the platform I was working on.
Using an IDE also introduced me to other incredibly useful tools like profilers and debuggers that have saved me countless hours over the years. However, I started using those tools almost five years ago, and I’ve been programming for about seven years, so I’ve spent the majority of my time developing with tools that drastically improved my efficiency.
Then I entered the Ruby world. Things are way weird in the Ruby world, mostly in a good way but sometimes not so much. I get the overwhelming feeling that many Rubyists are behind in the world of development. While coding in Ruby is incredibly fun, and I enjoy it more than programming in most other languages, I feel like the standard practices used by Ruby developers are almost archaic. And more concerning is that most of them seem to be perfectly okay with it! It’s almost like Ruby developers don’t know the precious, life-saving tools available to other languages exist. That makes me said.
Let me explain further.
Environment
I first realized something was off when I began researching the best environment for Ruby development. Through lots of googling and scouring answers to similar questions on sites like StackOverflow, I found that many a Rubyist prefers using TextMate and a terminal. I thought (and still think) that this so incredibly bizarre. I am a terminal junkie; I can dig a command line interface. But when it comes to real development, to real projects with scopes higher than spending a few days on a hack job, I can’t imagine programming without an IDE. My work flow is so IDE-centric that it is hard for me to accept that there are still programmers around that would rather stare at a terminal window than the a nice IDE. Granted, there doesn’t seem to be an IDE that really stands out well enough feature-wise for Ruby, at least not that I’ve found, in order to get people to jump onto this bandwagon. Which simply makes me raise the question, why hasn’t anyone created one yet? Where is the Visual Studio of Ruby?
Debugging
This one really hit me when I attended SpreeConf last month and sat through a presentation about writing fast code in Ruby. The speaker (whose name I cannot remember, unfortunately) presented the use of profilers as something special. Immediately, I wondered everyone in the room had not already been using one. I also wasn’t quite sure why it was being presented as a talking point at a conference. When I saw that he actually had the attention of most of the people in the room, it dawned on me that maybe Rubyists don’t have a lot of exposure to tools that I previously that were standard for all developers.
Maybe I’m spoiled, but I most definitely cannot get any real work done without a debugger. Breakpoints are an incredibly useful tool when working with software that doesn’t seem to be doing what you think it should. I know programmers who think its better and easier to litter their code with print statements in order to find certain functions that are executing and what order their executing in, or even to output the value of all kinds of variables. In all honesty, I find that incredibly naive. Debuggers are like magic that should be embraced, yet I don’t see widespread use in the Ruby world. I’m not sure if this again is due to a lack of available tools, but it seems silly that so many people are developing huge projects without the help of a real, powerful debugger. It truly is hard for me to grasp developing projects without being able to pause execution, inspect variables, view a stack trace at any moment, etc. And not only that, but also have all of those features integrated nicely into my editor.
Design Patterns
I’ve also come to feel like Rubyists lack knowledge of a lot of fundamental design patterns. I can’t attest to the average level of education of most Rubyists and I’m not bashing on anyone’s degree (considering I don’t hold one myself and I don’t attend a university). It does, however, seem to me like a lot of standard practices and design patterns used in other languages don’t carry over into the Ruby world. This first occurred to me after reading a post by Zach Holman from GitHub about developing their software for deployment on github.com as well as their GitHub Enterprise product. I’ve never met Zach personally, but he seems like an awesome dude and he’s really, really smart (I mean he graduated from Cornell, if I recall correctly. It was actually Carnegie Mellon; I should have fact-checked that before posting. Even better though, I love the folks over at CMU.). It just seemed to be a pretty obvious solution and really just an implementation of the Abstract Factory design pattern, but I guess that would was because I’ve used the pattern before? I don’t know, just seemed strange to me! I also get the impression that a lot of the design patterns that they use come straight out of Rails, which isn’t a bad thing, but makes me think that they learned Ruby through Rails tutorials. I’d love to get some feedback about this!
I could be pretty off, but these are just my impressions after being part of this community for about a month. I’d really love to hear from other Rubyists about their points of view, so feel free to spread this around and leave a comment!