Ruby is everywhere in industry, as anyone who went to the Healthcare IT event can tell you. But why? It's not a specialized language like PHP or SQL, it's not a derivative of C, and it doesn't have as varied a library as Python.
The answer lies in its versatility, simplicity, and numerous frameworks/enhancements, like the famous Ruby on Rails, RubyForge, RAA, RubyGems, and libraries for website and GUI applications. As such, Ruby is extremely useful for basic scripting and clear, intuitive design. An example of such a benefit is evident from this hypothetical scenario.
Suppose that you had to write a program in Java which took an array of literally anything (ints, strings, other lists, nulls, objects, kitchen sinks, black market organs, wookiees, etc-- all jumbled together) and returned it without all the nulls and duplicates. You could use sets or the like, but that'd be very complex. You could use an augmented for loop to add values to a new list if they're not nulls and not contained in the list, but that'd be very long. There are no solutions that are both simple and short.
So what can a more general language such as Ruby do? Well, this:
Oh snap.
No comments:
Post a Comment