Spudinski Posted February 1, 2012 Share Posted February 1, 2012 (edited) I thought I'd share the following: A quite entertaining way of learning Ruby. The guided tutorials are simple enough for anyone to get, though some parts of the language will be more familiar with experienced developers. http://tryruby.org An awesome site, it consists of a basic set of lessons to get you used to the language and interpreter. http://railsforzombies.org/ I love their videos, even though it's a bit lengthy for those who just want to jump in. In all, pretty decent way of getting acquainted with RoR. S. Edited February 1, 2012 by Spudinski Updated links... Quote Link to comment Share on other sites More sharing options...
Nickson Posted February 1, 2012 Share Posted February 1, 2012 I don't have ruby, I know nothing about ruby. So care to elaborate on its strong points, its goals and what not? Quote Link to comment Share on other sites More sharing options...
Spudinski Posted February 1, 2012 Author Share Posted February 1, 2012 (edited) Ruby's intention is to be fun to use, and to be as expressive and clean as possible. While the syntax is a bit on the "awkward" side for PHP developers, it may resemble some point of Javascript. Edit: See http://www.slideshare.net/DefV/rails-advantages-and-techniques, it explains below in depth. The things I personally find amusing from Ruby is: - Ability to join methods to each other, much like one would do in Javascript(jQuery users will like this). Example: post = <<-"." Rails on Ruby . print post.lines.to_a.reverse.join Output: Ruby on Rails - Simple typecasting & conversion of variables, though it may be difficult to learn for first timers. Example: "50".to_i * 2 Output: 100 PS. PHP developers may be used to "50" * 2 = 100 In ruby, it's "5050". - Easy arrays, although arrays alone can not contain key=>val like PHP user would know. key=>val is done by Hashes. Example: long_array = Array.new short_array = [] other_array = [a, b, c] another_array = %w[a b c] array_one = %w'a b c' array_two = 'a b c'.split - Ranges, "A range represents a subset of all possible values of a type, to be more precise, all possible values between a start value and an end value." Example: 'a'..'z' 0..0 0.1...1.0 r = 'a'..'d' puts r === 'c' // check if c is in range true - % Notations, and modifiers. Any single non-alpha-numeric character can be used as the delimiter, %[including these], %?or these?, %~or even these things~. [TABLE=class: wikitable, width: 1] [TR] [TD]Modifier[/TD] [TD]Meaning[/TD] [/TR] [TR] [TD]%q[ ][/TD] [TD]Non-interpolated String (except for \\ \[ and \])[/TD] [/TR] [TR] [TD]%Q[ ][/TD] [TD]Interpolated String (default)[/TD] [/TR] [TR] [TD]%r[ ][/TD] [TD]Interpolated Regexp (flags can appear after the closing delimiter)[/TD] [/TR] [TR] [TD]%s[ ][/TD] [TD]Non-interpolated Symbol[/TD] [/TR] [TR] [TD]%w[ ][/TD] [TD]Non-interpolated Array of words, separated by whitespace[/TD] [/TR] [TR] [TD]%W[ ][/TD] [TD]Interpolated Array of words, separated by whitespace[/TD] [/TR] [TR] [TD]%x[ ][/TD] [TD]Interpolated shell command[/TD] [/TR] [/TABLE] Edited February 1, 2012 by Spudinski code tags, takes getting used to... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.