1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

Ruby: Ruby PHP Equivilents

  1. Clicks today:
  2. Clicks this month:
  3. Overall rating:

Ruby » Basics — over 12 years ago
Learning Ruby and used to working with PHP? Here are some useful tips when crossing over.


avatarholman (administrator and creator)over 12 years ago

While these are valid examples, they seem a little bit PHP-y, from my point of view. As you get more into Ruby, you tend to place a lot of value on typical Ruby idioms of development. For example, a lot of these could use Ruby's String class, which seems (to me, at least) to be a more appropriate way of accomplishing these tasks. Using .include?('string') instead of the array-based approach, for example, or one of the many ways to use regexes on a String.

avatarvisionmedia over 12 years ago

Certainly. The square brace shorthand is meant for this purpose as well though so personally I do not see any reason not to use it, however I agree that more readable alternatives are available

Your Comment

You must be logged in to post a comment.