IT DRILLDOWN
 
NEWSLETTERS
 

CIO.com updates, insights and advice on technology, management and your career.

 
 
 
LEADERSHIP
 
CIO Executive Programs
The Leader in Face-to-Face Education for Senior Executives

Offering regional and national programs, CIO (and CSO) events bring together some of the most respected names and thought leaders in information technology and security. Presented by CIOs and other senior level executives, these invitation-only programs offer timely topics and strong networking. Learn More »

 
CIO Executive Council
A Peer-Advisory Service and Professional Association for CIOs

Portfolio Management Maturity Model at Chevron - Presentation & Discussion

November 13, 11:30 AM - 12:30 PM ET (GMT-4)

The fundamental goal of the model is to help IT become a business partner and earn a seat at the table. Core to the model is to establish a five year IT strategic road map that is owned by the business. Presenter Janinne Franke is manager of strategy, planning & optimization at Chevron's corporate department & services. She will share processes and lessons learned from developing and implementing the model.

More / Register »

Learn more about the CIO Executive Council »



 
 
RESOURCE CENTER
 
 
 
SUBSCRIBE TO CIO
 
Are you involved in setting the direction for your company's IT budget or strategy?

Apply today for a FREE subscription to CIO Magazine!

 
 
 

You Used Ruby to Write WHAT?!

Deciding when to use any language--including Ruby--depends on the appropriateness to task and the amount of yak shaving necessary. Zed Shaw explains when Ruby's MRI or JRuby is the best language for the job, and when it really isn't.

 

March 01, 2008CIO — Ask any programmer what his favorite language is good for and he'll yell, "Everything!" At least until his next favorite language comes along, which is also good for everything. The truth is: Any language that's Turing Complete and supports enough language features can solve any problem. The difference between languages and their usefulness is a matter of degrees of "yak shaving."

"Yak shaving" is a programmer's slang term for the distance between a task's start and completion and the tangential tasks between you and the solution. If you ever wanted to mail a letter, but couldn't find a stamp, and had to drive your car to get the stamp, but also needed to refill the tank with gas, which then let you get to the post office where you could buy a stamp to mail your letter—then you've done some yak shaving.

Some programming languages and some platforms (I'll make the distinction in a bit) minimize yak shaving. To create a simple language in Ruby, I have to find multiple undocumented libraries, install byzantine dependencies, track down build errors, find conflicts in things called "hoe" (which needs rubyforge which needs rake which needs Ruby), verify which version of Ruby I'm using, or try the undocumented lex and yacc integration, find out about Coco/R or other projects, install multiple non-Ruby packages, have the right libraries (again), talk with various people in IRC who don't want to talk to me—and then, after a few weeks, I might have just the harness done. Conversely, using ANTLR, without much fuss I can prototype an entire new language in a weekend and deploy it to just about any computer. It's not completely effortless; I can usually create a small parser for a protocol or mini-language in about a day or two using ANTLR and one book by Terrence Parr.

It's this distance between problem and solution that makes one language more suitable than another for a given task.

Aside: Sure, for the ultrageek in us, these yak-shaving expeditions can be fun, depending on the platform. I personally wouldn't do anything more complex than ant build on Java, but on Factor, Lua, Python or Ruby I'd gladly spend a weekend hacking at something just to prove I could do it (or to use it for something especially nerd powerful).

However, the platform is not the language. A programming language can be divorced from the physical computer it runs on. You can run multiple languages on virtual machines, such as the Sun Java Virtual Machine (JVM), Microsoft Common Language Runtime (CLR), NekoVM and LLVM; you can even host Forth in JavaScript in a browser. The separation of the language used to describe computation from the actual computational device means that programmers can choose various languages for a task, yet IT management can keep deployment platforms standardized and cohesive.

Why is this relevant to Ruby? Recently, there's been a huge push to take Ruby onto both the JVM and the CLR systems. Ruby's popularity means that companies like Sun, IBM and Microsoft want to add the language (and others, such as Python) to their platforms. This keeps programmers writing code for the vendors' platforms and keeps computers in the data center running their (expensive) software. Based on the adoption of Ruby on Rails I've seen for internal projects in 2008, this is a smart move.

In Ruby's case, the ability to host on multiple platforms means that whatever C, Java or C# can do, Ruby can do as well. The same advantage applies to Groovy, Boo, Python, Scala and JavaScript. What is left is a matter of style and reducing the number of yaks in the field you have to shave to get the job done.

Loading...
 
 
ABCs
 

Just the basics, please. Sometimes we all need a refresher or we need to make sure our team and our colleagues are all on the same page.

Over 25 tutorials on everything from business intelligence to virtualization.

 
 
FEATURED SPONSORS
 
 
 
SPONSORED LINKS
 

Best Practices in Choosing and Consuming Managed Security Services

A Guide to Messaging Archiving

2008 Google Communications Intelligence Report

The Impact of Messaging and Web Threats

Comparing Google and Other Leading Messaging Security Solutions

Universal Search in Healthcare Organizations

Google Case Study: Agile Software

Universal Search in High Tech Organizations

Enabling Enterprise 2.0

Renowned Engineering Institution Chooses AMD Processor-Based Servers

Extending the Enterprise Network Through Mobility

Industry Analyst Report: Top Hosted Exchange Vendors in 2008

Log onto Hitachi True Stories, films inspired by the next great achievement

CA delivers deeper insight into your assets, resources, projects & services so you can make more informed IT decisions

Manage your IT more effectively

Request a Novell/Microsoft deployment workshop and kit

Request a Novell/Microsoft deployment kit

Let Hubspan's managed service tackle your business integration challenge so you can focus on your core business

Strong Authentication. Secure USB data storage. One Device

Build up or Tear down? See how UC makes sense with Nortel. Calculate your UC ROI

Dell Latitude: Battery life up to 19 hours. Learn more

TDWI Report shows strong validation for investing in predictive analytics

Improve delivery of product information to customers.

E-LOAN Maintains Reputation as a Privacy Leader with Symantec

Information Security: Data Drains and How to Prevent Loss

A Guide to Understanding Hosted and Managed Messaging

Google Apps Premier Edition Helps Indoff Manage E-mail More Effectively

CapGemini Cut Call Center Costs with Google Apps Premier Edition

Comprehensive Review of Security and Vulnerability Protections for Google Apps

Deploying a Google Search Appliance is Not your Typical IT Implementation

Google Case Study: Pioneer Investments

The Case for Universal Search

Universal Search in Financial Services Organizations

Efficient by design: Watch this flash demo of the Quad-Core AMD Opteron Processor

HP and Oracle deploy unbreakable computing infrastructure at Replacements, Ltd.

Keep proven data center technology. Evolve with Brocade

Motorola AirDefense can identify and exterminate your rogue APs. Learn more

CA's IT Security centralizes your identity management to turn security into a proactive, business-building tool

Efficient - Flexible - Compliant

Is there a secret to Sharepoint® Security? www.SharePointSecured.com

Request a Novell/Microsoft deployment workshop

Keep your valued customers through tight business integration - it's a lot easier than you think

Simplified business collaboration, we make the connections so you don't have to

Compuware.com - See how we make IT rock around the world

Discover PMI's credentials and career path tools

SOA Educational Library at the TIBCO SOA Resource Center

Grassroots Data Governance with SAP MDM

Security and Trust: The Backbone of Doing Business over the Internet

7 Requirements of Data Loss Prevention

Data Loss Prevention: Keeping Sensitive Data Out of the Wrong Hands