What mainstream language is Ruby most like?
I'm guessing Python, but my Ruby exposure is limited.
What do you think? Python, Smalltalk, etc...
This part of the forum is off to a very slow start...
I wonder if it reflects Ruby's overall popularity?
Ruby is most like?
Started by debtboy, Oct 23 2009 05:57 PM
11 replies to this topic
#1
Posted 23 October 2009 - 05:57 PM
|
|
|
#2
Posted 26 October 2009 - 03:52 PM
This forum is fairly new and it hasn't attracted much Ruby programmers yet. Part of the reason for that is there is no Ruby content here.
It looks similar to Python but I haven't used it much to know any better.
It looks similar to Python but I haven't used it much to know any better.
#3
Posted 26 October 2009 - 08:36 PM
Ruby is most similar to pseudocode
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)
Download the new operating system programming kit! (some assembly required)
#4
Posted 27 October 2009 - 04:34 PM
Guest said:
Ruby is most similar to pseudocode
get some code posted up here. :)
#5
Posted 28 October 2009 - 12:52 AM
#6
Guest_Jordan_*
Posted 28 October 2009 - 04:35 AM
Guest_Jordan_*
Ruby was actually based on a combination of languages: Perl, Smalltalk, Eiffel, Ada, and Lisp. You can see in the code several of those languages (and others):
[highlight=ruby]def create_set_and_get(initial_value=0) # Note the default value of 0
closure_value = initial_value
return Proc.new {|x| closure_value = x}, Proc.new { closure_value }
end
setter, getter = create_set_and_get # ie. returns two values
setter.call(21)
getter.call # => 21
#You can also use a parameter variable as a binding for the closure.
#So the above can be rewritten as...
def create_set_and_get(closure_value=0)
proc {|x| closure_value = x } , proc { closure_value }
end[/highlight]
# look like Perl
def/end look like Basic
Optional line ending syntax is similar to JavaScript
What else?
[highlight=ruby]def create_set_and_get(initial_value=0) # Note the default value of 0
closure_value = initial_value
return Proc.new {|x| closure_value = x}, Proc.new { closure_value }
end
setter, getter = create_set_and_get # ie. returns two values
setter.call(21)
getter.call # => 21
#You can also use a parameter variable as a binding for the closure.
#So the above can be rewritten as...
def create_set_and_get(closure_value=0)
proc {|x| closure_value = x } , proc { closure_value }
end[/highlight]
# look like Perl
def/end look like Basic
Optional line ending syntax is similar to JavaScript
What else?
#7
Posted 28 October 2009 - 12:53 PM
I compared Ruby to pseudocode because it is so readable.
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)
Download the new operating system programming kit! (some assembly required)
#9
Posted 30 October 2009 - 03:30 PM
the more I look at that code, the more my stomach turns. :blink:
#10
Guest_Jordan_*
Posted 30 October 2009 - 04:44 PM
Guest_Jordan_*
Why?
#11
Posted 30 October 2009 - 06:03 PM
I personally don't like pipe characters used for passing in variables/parameters
#12
Posted 01 September 2010 - 12:35 AM
Ruby is most likely to pseudo code.


Sign In
Create Account


Back to top










