you had to make me break out my ruby-fu didn't ya! :)
Ruby let's you solve problems easier than any other language I've used
in the past. To me that's what it's got over CF.
For instance, there was a question about how to find the largest
number smaller or equal to the one supplied by the user. The solution
in ruby is simple.
# our test input
input = 25
# change the list to an array
nums = "32,48,64,72,144,160,200,288,320,400,512,576,640,720,800".split(",")
# find all the numbers which would be smaller
target = nums.find_all {|num| input >= num.to_i }
# take the last element of the found elements, or if nil return the
first element of the
# original array
puts target.last || nums.first
4 whole lines of code. 2 if you only consider non-setup lines. And
the other great thing about it. I was able to create this from the
command line. No firing up a browser. No refreshing to test. Just a
simple run.
There really are a lot of things that ruby can do that CF can't. A
lot of it stems from the fact that CF is really only a web application
language whereas ruby is general purpose. Even if you don't want to
change your platform from CF, learning ruby to do your "glue" code
would really be advantageous. I've made a bunch of services on my
machine using ruby. I use it to export crystal reports nowadays
because the garbage collection on COM objects works better (no matter
how hard I tried, CF would always seem to hold on to one randomly and
not let it go until it crashed the app)
On 10/3/07, William Bowen <[EMAIL PROTECTED]> wrote:
> > That one might be funnier, if they could actually find reasons why
> > Rails is better than CF =)
>
> yeah, I heard a lot of Ruby does that, too... but not any Ruby does
> that but not CF...
>
> except for the command line reference.
>
> wow
>
> Ruby beats CF 'cause of a command line?
>
> or maybe it was the digs at MySpace that were supposed to be funny?
> ...sorta like shooting fish in a barrel though, digs against MySpace...
>
>
> --
> will
>
> "If my life weren't funny, it would just be true;
> and that would just be unacceptable."
> - Carrie Fisher
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648
Archive:
http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:243610
Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5